Skip to content

Commit

Permalink
Fix doc warnings (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericclemmons committed Nov 19, 2021
1 parent 32850d4 commit 1bfdd0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
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

0 comments on commit 1bfdd0f

Please sign in to comment.