Skip to content

Commit

Permalink
OPHJOD-1074: Disable eslint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikuo committed Dec 17, 2024
1 parent f1243b1 commit 691a1a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/components/UserButton/UserButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ interface UserButtonProps {
}

export const UserButton = ({ onLogout }: UserButtonProps) => {
const { t } = useTranslation();
const {
t,
i18n: { language },
} = useTranslation();

const { sm } = useMediaQueries();
const data = useLoaderData() as components['schemas']['YksiloCsrfDto'] | null;
Expand Down
16 changes: 9 additions & 7 deletions src/routes/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { MdArrowForward } from 'react-icons/md';
import { NavLink, useLocation, useNavigate, useRouteLoaderData } from 'react-router';

const LandingPage = () => {
const { i18n } = useTranslation();
const { t } = useTranslation();
const {
t,
i18n: { language },
} = useTranslation();
const location = useLocation();

const rootLoaderData = useRouteLoaderData('root') as components['schemas']['YksiloCsrfDto'];
Expand All @@ -19,8 +21,8 @@ const LandingPage = () => {

const loginLink = useLoginLink({
callbackURL: state?.callbackURL
? `/${i18n.language}/${state?.callbackURL}`
: `/${i18n.language}/${t('slugs.profile.index')}/${t('slugs.profile.preferences')}`,
? `/${language}/${state?.callbackURL}`
: `/${language}/${t('slugs.profile.index')}/${t('slugs.profile.preferences')}`,
});

// Redirect to root if already logged-in
Expand Down Expand Up @@ -62,7 +64,7 @@ const LandingPage = () => {
<Button
variant="white"
label={t('login-to-service')}
/* eslint-disable-next-line sonarjs/no-unstable-nested-components */
/* eslint-disable-next-line react/no-unstable-nested-components */
LinkComponent={({ children }: { children: React.ReactNode }) => <a href={loginLink}>{children}</a>}
/>
</div>
Expand All @@ -71,8 +73,8 @@ const LandingPage = () => {
</div>
<div className="mb-8">
<NavLink
to={`/${i18n.language}/${basicInformation}/${t('slugs.privacy-policy')}`}
lang={i18n.language}
to={`/${language}/${basicInformation}/${t('slugs.privacy-policy')}`}
lang={language}
key={'competence'}
type="button"
className="text-button-md hover:underline text-accent ml-3"
Expand Down

0 comments on commit 691a1a2

Please sign in to comment.