-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
224f714
commit 5d14bfc
Showing
4 changed files
with
72 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { extendTheme, ThemeConfig } from '@chakra-ui/react'; | ||
|
||
export const theme = extendTheme({ | ||
|
||
config: { | ||
initialColorMode: 'light', // or 'light' | ||
useSystemColorMode: false, | ||
}, | ||
styles: { | ||
global: { | ||
body: { | ||
minHeight: '100vh', | ||
overflowX: 'hidden', | ||
height: '100%', | ||
}, | ||
'*': { | ||
'&::-webkit-scrollbar': { | ||
width: 1.5, | ||
borderRadius: 20, | ||
backgroundColor: 'black' | ||
}, | ||
'&::-webkit-scrollbar-thumb': { | ||
backgroundColor: 'white', | ||
borderRadius: 20, | ||
}, | ||
}, | ||
}, | ||
}, | ||
breakpoints: { | ||
sm: '320px', | ||
md: '768px', | ||
lg: '960px', | ||
xl: '1200px', | ||
'2xl': '1560px', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { SessionProvider } from "next-auth/react" | ||
import { ChakraProvider, CSSReset } from '@chakra-ui/react' | ||
import type { AppProps } from 'next/app' | ||
import { theme } from '../config/chakraTheme'; | ||
|
||
export default function App({ | ||
Component, | ||
pageProps: { session, ...pageProps }, | ||
}: AppProps) { | ||
return ( | ||
<SessionProvider session={session} refetchInterval={5 * 60}> | ||
<Component {...pageProps} /> | ||
<ChakraProvider theme={theme}> | ||
<CSSReset /> | ||
<Component {...pageProps} /> | ||
</ChakraProvider> | ||
</SessionProvider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,41 @@ | ||
import { useSession, signIn, signOut } from "next-auth/react" | ||
import { Button, Box } from "@chakra-ui/react"; | ||
|
||
export default function Home() { | ||
|
||
const { data: session } = useSession() | ||
console.log(session); | ||
|
||
if (session) { | ||
return ( | ||
<> | ||
<Box> | ||
Signed in as {session?.user?.email} <br /> | ||
<button onClick={() => signOut()}>Sign out</button> | ||
</> | ||
<Button | ||
w={'fit'} | ||
_hover={{ | ||
opacity: 1, | ||
boxShadow: 'lg' | ||
}} | ||
onClick={() => signOut()} | ||
> | ||
Sign Out | ||
</Button> | ||
</Box> | ||
) | ||
} | ||
return ( | ||
<> | ||
<Box> | ||
Not signed in <br /> | ||
<button onClick={() => signIn()}>Sign in</button> | ||
</> | ||
<Button | ||
w={'fit'} | ||
_hover={{ | ||
opacity: 1, | ||
boxShadow: 'lg' | ||
}} | ||
onClick={() => signIn()} | ||
> | ||
Sign in | ||
</Button> | ||
</Box> | ||
) | ||
} |