Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 6.5k
init: add skip-to-main-content shortcut#7390
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
bfd4bbd85e3e14af3799a0c9c1b59f14df00b24e44c05f0b9b5f2322536bfd761d34c8db8543f2a465e32233341File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| 'use client'; | ||
| import { useLocale } from 'next-intl'; | ||
| import { useLocale, useTranslations } from 'next-intl'; | ||
| import { useTheme } from 'next-themes'; | ||
| import type { FC } from 'react'; | ||
yaten2302 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @@ -10,19 +10,29 @@ import { useSiteNavigation } from '@/hooks'; | ||
| import { useRouter, usePathname } from '@/navigation.mjs'; | ||
| import { availableLocales } from '@/next.locales.mjs'; | ||
| import Button from './Common/Button'; | ||
| const WithNavBar: FC = () => { | ||
| const { navigationItems } = useSiteNavigation(); | ||
| const { resolvedTheme, setTheme } = useTheme(); | ||
| const { replace } = useRouter(); | ||
| const pathname = usePathname(); | ||
| const locale = useLocale(); | ||
| const t = useTranslations(); | ||
| const toggleCurrentTheme = () => | ||
| setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'); | ||
| return ( | ||
| <div> | ||
| <Button | ||
| className="absolute left-3 top-3 -translate-y-16 focus:translate-y-0" | ||
| href="#main" | ||
| > | ||
| {t('components.containers.navBar.links.skipToContent')} | ||
| </Button> | ||
| <WithBanner section="index" /> | ||
| <NavBar | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,4 +6,5 @@ export type Layouts = | ||
| | 'blog-category' | ||
| | 'blog-post' | ||
| | 'download' | ||
| | 'article'; | ||
| | 'article' | ||
| | 'skipToContent'; | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, IMO there should be no skip to content layout | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
skipToContentis a page layout, IMO it is a feature in layoutsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone mentioned about this in previous suggestions, that it needs to be added in
withLayout.tsx, should I remove this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are talking about this comment; #7390 (comment)
@araujogui As far as I understand, the suggestion is to move the skip to content button here, not add it as a layout right? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, saying about this 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's what I meant