Skip to content

Commit

Permalink
OPHJOD-1194: Use NavigationBar from design system
Browse files Browse the repository at this point in the history
  • Loading branch information
sauanto committed Jan 20, 2025
1 parent 8a50bbd commit dcfd481
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 290 deletions.
80 changes: 0 additions & 80 deletions src/components/NavigationBar/NavigationBar.test.tsx

This file was deleted.

62 changes: 0 additions & 62 deletions src/components/NavigationBar/NavigationBar.tsx

This file was deleted.

117 changes: 0 additions & 117 deletions src/components/NavigationBar/__snapshots__/NavigationBar.test.tsx.snap

This file was deleted.

1 change: 0 additions & 1 deletion src/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export {
export { MainLayout } from './MainLayout/MainLayout';
export { RoutesNavigationList, type RoutesNavigationListProps } from './MainLayout/RoutesNavigationList';
export { SimpleNavigationList } from './MainLayout/SimpleNavigationList';
export { NavigationBar } from './NavigationBar/NavigationBar';
export { OpportunityCard } from './OpportunityCard/OpportunityCard';
export { OsaamisSuosittelija, type Osaaminen, type OsaaminenValue } from './OsaamisSuosittelija/OsaamisSuosittelija';
export { Title } from './Title/Title';
Expand Down
42 changes: 12 additions & 30 deletions src/routes/Root/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import { components } from '@/api/schema';
import {
LanguageButton,
LanguageMenu,
LogoIconRgb,
LogoRgbEn,
LogoRgbFi,
LogoRgbSv,
NavigationBar,
UserButton,
} from '@/components';
import { LanguageButton, LanguageMenu, UserButton } from '@/components';
import { ErrorNote, useErrorNote } from '@/components/ErrorNote';
import { MegaMenu } from '@/components/MegaMenu/MegaMenu';
import { ActionBarContext } from '@/hooks/useActionBar';
import { useMenuClickHandler } from '@/hooks/useMenuClickHandler';
import i18n from '@/i18n/config';
import { useToolStore } from '@/stores/useToolStore';
import { Footer, SkipLink, useMediaQueries } from '@jod/design-system';
import { Footer, NavigationBar, SkipLink, useMediaQueries } from '@jod/design-system';

Check failure on line 9 in src/routes/Root/Root.tsx

View workflow job for this annotation

GitHub Actions / Build

Module '"@jod/design-system"' has no exported member 'NavigationBar'.
import React from 'react';
import { useTranslation } from 'react-i18next';
import { MdMenu } from 'react-icons/md';
Expand Down Expand Up @@ -44,17 +35,6 @@ const NavigationBarItem = (to: string, text: string) => ({
),
});

const LogoRgb = ({ language, size }: { language: string; size: number }) => {
switch (language) {
case 'sv':
return <LogoRgbSv size={size} />;
case 'en':
return <LogoRgbEn size={size} />;
default:
return <LogoRgbFi size={size} />;
}
};

const Root = () => {
const {
t,
Expand Down Expand Up @@ -187,14 +167,11 @@ const Root = () => {
<NavigationBar
languageButtonComponent={<LanguageButton onClick={toggleMenu('lang')} />}
userButtonComponent={<UserButton onLogout={logout} />}
logo={
<NavLink to={`/${language}`} className="flex">
<div className="inline-flex select-none items-center p-3">
{sm ? <LogoRgb language={language} size={32} /> : <LogoIconRgb size={32} />}
<span className="sr-only">{t('osaamispolku')}</span>
</div>
</NavLink>
}
logo={{
to: `/${language}`,
language,
srText: t('osaamispolku'),
}}
menuComponent={
sm ? (
<button
Expand Down Expand Up @@ -224,6 +201,11 @@ const Root = () => {
)
}
refs={{ langMenuButtonRef: langMenuButtonRef }}
renderLink={({ to, className, children }) => (

Check failure on line 204 in src/routes/Root/Root.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'to' implicitly has an 'any' type.

Check failure on line 204 in src/routes/Root/Root.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'className' implicitly has an 'any' type.

Check failure on line 204 in src/routes/Root/Root.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'children' implicitly has an 'any' type.
<NavLink to={to} className={className}>
{children as React.ReactNode}
</NavLink>
)}
/>
{langMenuOpen && (
<div className="relative xl:container mx-auto">
Expand Down

0 comments on commit dcfd481

Please sign in to comment.