Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
srilekha279 committed Aug 1, 2024
2 parents 7f43da9 + a4133d2 commit 0c7beb7
Show file tree
Hide file tree
Showing 17 changed files with 426 additions and 271 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"rimraf": "^5.0.7",
"svgo": "^3.3.2",
"tailwindcss": "^3.4.3",
"vite": "^5.3.3",
"vite": "^5.3.5",
"webpack": "^5.92.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
Expand Down
14 changes: 7 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ import Contributors from './Pages/Contributors.jsx';
const ThemeContext = createContext();

const App = () => {
const theme = useSelector((state) => state.theme.value) ? "dark" : "light";
const [currentTheme, setTheme] = useState(theme);
const theme = useSelector((state) => state.theme.value) ? "dark" : "light";
const [currentTheme, setTheme] = useState(theme);

const toggleTheme = () => {
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
setTheme(newTheme);
localStorage.setItem('theme', newTheme);
};
const toggleTheme = () => {
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
setTheme(newTheme);
localStorage.setItem('theme', newTheme);
};

useEffect(() => {
AOS.init({
Expand Down
10 changes: 5 additions & 5 deletions src/Components/ChatAssistant/ChatAssistant.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

.react-chatbot-kit-chat-message-container {
overflow-x: hidden;
padding: 0.5px 5px 25px 5.5px;
padding: 0.5px 1px 0px 6.5px;
}

.react-chatbot-kit-user-chat-message {
Expand All @@ -65,13 +65,13 @@

.react-chatbot-kit-chat-container {
width: 90vw;
max-width: 336px;
height: 97vh;
max-height: 475px;
max-width: 349px;
height: 173vh;
max-height: 508px;
border: 2px solid blue;
border-radius: 22px;
overflow: hidden;
margin-bottom: 34px;
margin-bottom: 49px;
}

.react-chatbot-kit-chat-bot-message {
Expand Down
184 changes: 106 additions & 78 deletions src/Components/ChatBot/ActionProvider.jsx
Original file line number Diff line number Diff line change
@@ -1,97 +1,125 @@
import React from 'react';
import {createChatBotMessage} from 'react-chatbot-kit'
import { createChatBotMessage } from 'react-chatbot-kit';
import { shuffleArray } from './utils';

const ActionProvider = ({ createChatBotMessage, setState, children }) => {
const questions = [
"What services do you offer?",
"Can you tell me about your pricing?",
"How can I contact your support team?",
"What is the mission of your company?",
"Where are you located?",
"How long have you been in business?"
];

const updateState = (message) => {
setState((prev) => ({
...prev,
messages: [...prev.messages, message],
}));
};

const handleHello = () => {
const message = createChatBotMessage('Hello, I am InvestIQ, type in your query.');
updateState(message);
};

const companyDetails = () => {
const message = createChatBotMessage('At StartConnect-Hub, our mission is to create a thriving ecosystem where entrepreneurs and investors can come together to turn ideas into reality. We understand the challenges that startups face, from securing funding to navigating the complexities of the business world. With our platform, entrepreneurs can bring their visions to life and take their businesses to new heights.');
updateState(message);
};

const contactUs = () => {
const message = createChatBotMessage('Contact details can be viewed on our CONTACT US section. Feel free to drop us your query.');
updateState(message);
};

const handleServices = () => {
const message = createChatBotMessage("Our services include investor management, financial services,full service funds, and more. You can visit our website for a detailed list of services.");
updateState(message);
};

const handleCost = () => {
const message = createChatBotMessage("Our pricing varies depending on the scope of the project and specific requirements. Please contact our sales team for detailed pricing information tailored to your needs.");
updateState(message);
};


const handleMore = () => {
const message = createChatBotMessage("Our mission is to empower businesses with innovative technology solutions and help them achieve their goals efficiently and effectively.");
updateState(message);
};

const handleLocation = () => {
const message = createChatBotMessage("We are located in India. You can visit contact details for more");
updateState(message);
};

const handleExperience = () => {
const message = createChatBotMessage("We have been in business for more than 2 years, serving clients worldwide.");
updateState(message);
};

const handleThank = () => {
const message = createChatBotMessage("Hope I could help! Stay connected and thank you.");
updateState(message);
};

const defaultResponse = () => {
const message = createChatBotMessage("I'm not sure about that. Can you ask something else? Or You can feel free to checkout Frequently asked questions") ;
updateState(message) ;
}

const suggestQuestions = () => {
const questionsMessage = questions.map((question, idx) => `${idx + 1}. ${question}`).join('\n');
const message = createChatBotMessage(`Here are some questions you can ask:\n\n${questionsMessage}`);
updateState(message);
const actions = {
services: () => {
const message = createChatBotMessage('Our services include investor management, financial services, full-service funds, and more.', {
widget: 'options'
});
updateState(message);
},
pricing: () => {
const message = createChatBotMessage('Our pricing varies depending on the project. Please contact our sales team for detailed information.', {
widget: 'options'
});
updateState(message);
},
contact: () => {
const message = createChatBotMessage('You can contact us through the Contact Us section on our website.', {
widget: 'options'
});
updateState(message);
},
mission: () => {
const message = createChatBotMessage('Our mission is to create a thriving ecosystem for entrepreneurs and investors.', {
widget: 'options'
});
updateState(message);
},
location: () => {
const message = createChatBotMessage('We are located in India.', {
widget: 'options'
});
updateState(message);
},
experience: () => {
const message = createChatBotMessage('We have been in business for over 2 years.', {
widget: 'options'
});
updateState(message);
},
startups: () => {
const message = createChatBotMessage('We work with a diverse range of startups across various industries.', {
widget: 'options'
});
updateState(message);
},
featured: () => {
const message = createChatBotMessage('To get featured, submit your startup profile through our platform.', {
widget: 'options'
});
updateState(message);
},
benefits: () => {
const message = createChatBotMessage('Joining StartConnectHub offers numerous benefits including access to investors and mentors.', {
widget: 'options'
});
updateState(message);
},
resources: () => {
const message = createChatBotMessage('We offer resources like mentorship programs, funding opportunities, and business development guides.', {
widget: 'options'
});
updateState(message);
},
collaboration: () => {
const message = createChatBotMessage('We encourage collaboration among startups.', {
widget: 'options'
});
updateState(message);
},
contactSupport: () => {
const message = createChatBotMessage('Contact our support team through the Contact Us section on our website.', {
widget: 'options'
});
updateState(message);
},
SuccessStories: () => {
const message = createChatBotMessage('We feature success stories from startups on our website.', {
widget: 'options'
});
updateState(message);
},
investors: () => {
const message = createChatBotMessage('Investors can sign up on our platform to explore investment opportunities.', {
widget: 'options'
});
updateState(message);
},
handleHello: () => {
const message = createChatBotMessage('Hello, I am InvestIQ. Type in your query or Here are some options you can choose from:', {
widget: 'options'
});
updateState(message);
},
handleThank: () => {
const message = createChatBotMessage('You are Welcome! If you have any more questions or need further assistance, feel free to ask.', {
widget: 'options'
});
updateState(message);
},
defaultResponse: () => {
const message = createChatBotMessage("I'm not sure about that. Can you ask something else? Here are some options you can choose from Or feel free to check out the Frequently Asked Questions.", {
widget: 'options'
});
updateState(message);
}
};

return (
<div>
{React.Children.map(children, (child) => {
return React.cloneElement(child, {
actions: {
handleHello,
companyDetails,
contactUs,
suggestQuestions ,
handleCost,
handleExperience,
handleLocation,
handleServices,
handleMore,
handleThank,
defaultResponse
},
actions,
});
})}
</div>
Expand Down
Loading

0 comments on commit 0c7beb7

Please sign in to comment.