Skip to content

Commit

Permalink
fix drawer locales
Browse files Browse the repository at this point in the history
  • Loading branch information
noams24 committed Jun 8, 2024
1 parent 1a0530d commit 2b3bf54
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 48 deletions.
12 changes: 6 additions & 6 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ export default function RootLayout({
} ${inter.variable}`}
>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<Header />
<main className="flex flex-col flex-1 h-full pt-24 md:pt-32">
<NextIntlClientProvider locale={locale} messages={messages}>
<NextIntlClientProvider locale={locale} messages={messages}>
<Header />
<main className="flex flex-col flex-1 h-full pt-24 md:pt-32">
{children}
</NextIntlClientProvider>
</main>
<Footer />
</main>
<Footer />
</NextIntlClientProvider>
</ThemeProvider>
</body>
</html>
Expand Down
63 changes: 31 additions & 32 deletions components/Header/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,34 @@ interface SidebarProps {
toggleSidebar: () => void;
}

const navigationItems: NavigationItems[] = [
{
title: 'Newbies',
linkPath: '/newbies',
},
{
title: 'Members',
linkPath: '/members',
},
{
title: 'Maintainers',
linkPath: '/maintainers',
},
{
title: 'WhoWeAre',
linkPath: '/about',
},
{
title: 'TheProjects',
linkPath: '/projects',
},
];

const Sidebar: React.FC<SidebarProps> = ({ isOpen, toggleSidebar }) => {
const sidebarRef = useRef<HTMLDivElement | null>(null);
const localActive = useTypedLocale();
const { theme } = useTheme();
const t = useTranslations('Components.sideBar');
const navigationItems: NavigationItems[] = [
{
title: 'Newbies',
text: 'פעם ראשונה בקוד פתוח',
linkPath: '/newbies',
},
{
title: 'Members',
text: 'מי שכבר התנסה בקוד פתוח',
linkPath: '/members',
},
{
title: 'Maintainers',
text: 'בעלי פרויקטים שרוצים להצטרף',
linkPath: '/maintainers',
},
{
title: 'מי אנחנו',
linkPath: '/about',
},
{
title: 'הפרויקטים',
linkPath: '/projects',
},
];

useEffect(() => {
const handleOutsideClick = (event: MouseEvent) => {
Expand Down Expand Up @@ -132,13 +130,14 @@ const Sidebar: React.FC<SidebarProps> = ({ isOpen, toggleSidebar }) => {
className="flex flex-col gap-3 p-5 select-none group hover:first:rounded-tl-md hover:first:rounded-tr-md hover:last:rounded-bl-md hover:last:rounded-br-md cursor-pointer leading-none text-darkText dark:text-lightText hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none"
onClick={toggleSidebar}
>
{navItem.linkPath ? (
<Link href={navItem.linkPath as string}>
<NavBody title={navItem.title} text={navItem.text} />
</Link>
) : (
<NavBody title={navItem.title} text={navItem.text} />
)}
<Link href={navItem.linkPath as string}>
<NavBody
//@ts-ignore
title={t(`title.${navItem.title}`)}
//@ts-ignore
text={t(`text.${navItem.title}`)}
/>
</Link>
</li>
))}
</ul>
Expand Down
19 changes: 14 additions & 5 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,20 @@
"secondParagraph": "with genuinely, the nicest people you'll ever meet, who are always willing to help anyone who needs it"
},
"sideBar": {
"newbies": "First time in Open Source",
"members": "already participated in Open Source",
"maintainers": "Project maintainers who wants to join",
"whoWeAre": "About us",
"theProjects": "The projects"
"title": {
"Newbies": "Newbies",
"Members": "Members",
"Maintainers": "Maintainers",
"WhoWeAre": "About us",
"TheProjects": "The projects"
},
"text": {
"Newbies": "First time in Open Source",
"Members": "Already participated in Open Source",
"Maintainers": "Project maintainers who wants to join",
"WhoWeAre": "",
"TheProjects": ""
}
}
},
"Header": {
Expand Down
19 changes: 14 additions & 5 deletions public/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,20 @@
"secondParagraph": "עם אנשים באמת, אבל באמת, הכי נחמדים שיש ומוכנים לעזור לכל מי שרק צריך."
},
"sideBar": {
"newbies": "פעם ראשונה בקוד פתוח",
"members": "מי שכבר התנסה בקוד פתוח",
"maintainers": "בעלי פרויקטים שרוצים להצטרף",
"whoWeAre": "מי אנחנו",
"theProjects": "הפרויקטים"
"title": {
"Newbies": "Newbies",
"Members": "Members",
"Maintainers": "Maintainers",
"WhoWeAre": "מי אנחנו",
"TheProjects": "הפרויקטים"
},
"text": {
"Newbies": "פעם ראשונה בקוד פתוח",
"Members": "מי שכבר התנסה בקוד פתוח",
"Maintainers": "בעלי פרויקטים שרוצים להצטרף",
"WhoWeAre": "",
"TheProjects": ""
}
}
},
"Header": {
Expand Down

0 comments on commit 2b3bf54

Please sign in to comment.