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

Fix doc warnings #779

Merged
merged 3 commits into from
Nov 19, 2021
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
4 changes: 2 additions & 2 deletions docs/src/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const Footer = () => {
</Flex>
<View textAlign="center">
<Button
as="a"
as={Link}
variation="link"
gap={tokens.space.small}
alignItems="baseline"
Expand All @@ -33,7 +33,7 @@ export const Footer = () => {
Github
</Button>
<Button
as="a"
as={Link}
variation="link"
gap={tokens.space.small}
alignItems="baseline"
Expand Down
6 changes: 5 additions & 1 deletion docs/src/components/Layout/SecondaryNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {

const NavLinks = ({ items }: { items: ComponentNavItem[] }) => (
<Collection type="list" items={items} gap="0">
{({ href, label }) => <NavLink href={href}>{label}</NavLink>}
{({ href, label }) => (
<NavLink key={label} href={href}>
{label}
</NavLink>
)}
</Collection>
);

Expand Down
11 changes: 8 additions & 3 deletions docs/src/pages/_app.page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react';
import * as React from 'react';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { AmplifyProvider, ColorMode } from '@aws-amplify/ui-react';
Expand All @@ -8,11 +8,16 @@ import { Header } from '@/components/Layout/Header';
import { theme } from '../theme';
import '../styles/index.scss';

// suppress useLayoutEffect warnings when running outside a browser
// See: https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85#gistcomment-3886909
// @ts-ignore Cannot assign to 'useLayoutEffect' because it is a read-only property.ts(2540)
if (typeof window === 'undefined') React.useLayoutEffect = React.useEffect;

function MyApp({ Component, pageProps }) {
const router = useRouter();
const { platform = 'react' } = router.query;
const [colorMode, setColorMode] = useState<ColorMode>('system');
const [themeOverride, setThemeOverride] = useState('');
const [colorMode, setColorMode] = React.useState<ColorMode>('system');
const [themeOverride, setThemeOverride] = React.useState('');

const favicon =
process.env.NODE_ENV === 'development'
Expand Down