Skip to content

Instantly share code, notes, and snippets.

@margauxflores
Created August 18, 2022 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save margauxflores/16cd86b59dad1ddc2c8070f333c55741 to your computer and use it in GitHub Desktop.
Save margauxflores/16cd86b59dad1ddc2c8070f333c55741 to your computer and use it in GitHub Desktop.
import React from 'react';
import styles from './DocsLayout.module.css';
import { Header, HeaderType } from '~/components/_shared/Header';
type DocsLayoutProps = HasChildrenProps;
export const Layout: React.FC<LayoutProps> = ({ children }) => {
return (
<>
<Header layout={HeaderType.DOCSLAYOUT} />
<main className={styles.container}>{children}</main>
</>
);
};
import React from 'react';
import styles from './Header.module.css';
import { NavigationBar } from '~/components/_shared/NavigationBar';
import Image from 'next/image';
export enum HeaderType {
LAYOUT = 'LAYOUT',
DOCSLAYOUT = 'DOCSLAYOUT'
}
type HeaderProps = {
layout?: HeaderType;
}
export const Header: React.FC<HeaderProps> = ({ layout }) => {
return (
<>
{ layout === HeaderType.LAYOUT && //default layout header code here }
{ layout === HeaderType.DOCSLAYOUT && // docs layout header code here }
</>
);
};
import React from 'react';
import styles from './Header.module.css';
import { NavigationBar } from '~/components/_shared/NavigationBar';
import Image from 'next/image';
export enum HeaderType {
LAYOUT = 'LAYOUT',
DOCSLAYOUT = 'DOCSLAYOUT'
}
type HeaderProps = {
layout?: HeaderType;
}
export const Header: React.FC<HeaderProps> = ({ layout }) => {
return (
<>
{ layout === HeaderType.LAYOUT && //default layout header code here }
{ layout === HeaderType.DOCSLAYOUT && // docs layout header code here }
</>
);
};
import React from 'react';
import styles from './Layout.module.css';
import { Header, HeaderType } from '~/components/_shared/Header';
import { useAuth } from '~/hooks/useAuth';
type LayoutProps = HasChildrenProps;
export const Layout: React.FC<LayoutProps> = ({ children }) => {
useAuth();
return (
<>
<Header layout={HeaderType.LAYOUT} />
<main className={styles.container}>{children}</main>
</>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment