Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chapters #228

Merged
merged 4 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added nepalingo-web/public/Emergency.webp
Binary file not shown.
Binary file added nepalingo-web/public/First Words.webp
Binary file not shown.
Binary file added nepalingo-web/public/Knowing Someone.webp
Binary file not shown.
Binary file added nepalingo-web/public/Making Introductions.webp
Binary file not shown.
Binary file added nepalingo-web/public/Shopping.webp
Binary file not shown.
Binary file added nepalingo-web/public/Traveling.webp
Binary file not shown.
4 changes: 3 additions & 1 deletion nepalingo-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ReactGA from "react-ga4";
import { PrivateRoutes } from "@/components/PrivateRoutes";
import About from "@/pages/About";
import Credits from "@/pages/Credits";
import Chapters from "@/pages/Chapters";
import Quiz from "@/pages/Quiz";
import SignUp from "./pages/SignUp";

Expand All @@ -31,7 +32,8 @@ const App: React.FC = () => {
<Route path="/" element={<Home />} />
<Route path="/flashcard" element={<FlashcardPage />} />
<Route path="/dictionary" element={<DictionaryPage />} />
<Route path="/quiz" element={<Quiz />} />
<Route path="/quiz/:chapter" element={<Quiz />} />
<Route path="/chapters" element={<Chapters />} />
</Route>
</Routes>
</Router>
Expand Down
5 changes: 4 additions & 1 deletion nepalingo-web/src/components/Flashcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const Flashcard: React.FC = () => {
useEffect(() => {
// Initialize the word generator when the language changes
const initWordGenerator = async () => {
const generator = await getNextWord(selectedLanguage || "Newari");
const generator = await getNextWord(
selectedLanguage || "Newari",
undefined,
);
setWordGenerator(generator);
handleNextWord(generator);
};
Expand Down
4 changes: 2 additions & 2 deletions nepalingo-web/src/components/header/ChangeLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const ChangeLanguage: React.FC = () => {
value: Languages[key as LanguageKey],
}));
return (
<div ref={dropdownRef} className="relative text-left h-full">
<div ref={dropdownRef} className="relative text-left">
<button
type="button"
className="w-48 bg-grayDark px-4 h-10 rounded-lg text-sm font-medium text-gray-900 focus:outline-none flex justify-between items-center"
className="w-32 bg-grayDark px-4 h-10 rounded-lg text-sm font-medium text-gray-900 focus:outline-none flex justify-between items-center"
onClick={toggleMenu}
>
<span className="text-white font-primary font-black">
Expand Down
53 changes: 35 additions & 18 deletions nepalingo-web/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,48 @@ const Header: React.FC = () => {
};

return (
<nav className=" border-gray-200 py-1 bg-black text-white flex gap-4 justify-between items-center w-full h-16">
<div>
<Link to={"/"}>
<img src={logo} alt="Nepalingo Logo" className="h-12" />
</Link>
<>
<nav className="border-gray-200 py-1 bg-black text-white flex gap-2 justify-between items-center w-full h-16">
<div>
<Link to={"/"}>
<img src={logo} alt="Nepalingo Logo" className="max-h-12" />
</Link>
</div>
<button
onClick={handleOpenFeedbackForm}
className="hover:underline hidden md:block"
>
Give us Feedback!
</button>
<a href="/about" className="hover:underline hidden md:block">
About
</a>
<a href="/credits" className="hover:underline hidden md:block">
Credits
</a>
<div className="flex-1"></div>
<ChangeLanguage />
<UserProfile />
</nav>

<div className="md:hidden flex gap-4 justify-center text-white">
<button onClick={handleOpenFeedbackForm} className="hover:underline">
Give us Feedback!
</button>
<a href="/about" className="hover:underline">
About
</a>
<a href="/credits" className="hover:underline">
Credits
</a>
</div>
<button onClick={handleOpenFeedbackForm} className="hover:underline">
Give us Feedback!
</button>

{isFeedbackFormOpen && (
<div className="z-20 fixed inset-0 bg-white-800 bg-opacity-50 flex justify-center items-center">
<FeedbackForm onClose={handleCloseFeedbackForm} />
</div>
)}
<a href="/about" className="text-white hover:underline">
About
</a>
<a href="/credits" className="text-white hover:underline">
Credits
</a>
<div className="flex-1"></div>
<ChangeLanguage />
<UserProfile />
</nav>
</>
);
};

Expand Down
Loading
Loading