generated from theodorusclarence/ts-nextjs-tailwind-starter
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
a4e64b2
commit fbdacd0
Showing
18 changed files
with
192 additions
and
122 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
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
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,6 +1,30 @@ | ||
import clsx from 'clsx'; | ||
import * as React from 'react'; | ||
|
||
import { demoMode } from '@/lib/config'; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
// Put Header or Footer Here | ||
return <div className='default'>{children}</div>; | ||
const [theme, setTheme] = React.useState('dark'); | ||
|
||
return ( | ||
<div className={theme}> | ||
<div | ||
className={clsx('dark:bg-dark dark:text-white', 'milky:bg-[#fff5e3]')} | ||
> | ||
{demoMode && ( | ||
<select | ||
name='theme' | ||
className='fixed top-4 left-4 rounded bg-transparent' | ||
value={theme} | ||
onChange={(e) => setTheme(e.target.value)} | ||
> | ||
<option value='light'>light</option> | ||
<option value='dark'>dark</option> | ||
<option value='theme-milky'>milky</option> | ||
</select> | ||
)} | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} |
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,67 @@ | ||
/* eslint-disable @next/next/no-img-element */ | ||
import clsx from 'clsx'; | ||
import * as React from 'react'; | ||
|
||
import clsxm from '@/lib/clsxm'; | ||
import { Tree } from '@/lib/notion'; | ||
|
||
type TreeLinkProps = { | ||
link: Tree; | ||
} & React.ComponentPropsWithoutRef<'div'>; | ||
|
||
export default function TreeLink({ | ||
className, | ||
link: { display, link, icon }, | ||
...rest | ||
}: TreeLinkProps) { | ||
return ( | ||
<div className={clsxm('group relative', className)} {...rest}> | ||
<div | ||
className={clsx( | ||
'opacity-0 group-hover:opacity-100', | ||
'absolute -inset-0.5 z-0 animate-tilt rounded blur', | ||
'accent-gradient bg-gradient-to-r', | ||
'transition duration-300 group-hover:duration-200', | ||
'milky:rounded-full', | ||
'pointer-events-none' | ||
)} | ||
/> | ||
|
||
<a | ||
href={link} | ||
className={clsx( | ||
'relative flex items-center justify-center gap-2', | ||
'px-4 py-4 font-medium transition-colors md:text-lg', | ||
'border', | ||
'focus:outline-none focus-visible:ring focus-visible:ring-primary-500', | ||
'border-gray-400 bg-white', | ||
'dark:border-gray-600 dark:bg-dark', | ||
'milky:rounded-full milky:bg-milky-100 milky:text-milky-500' | ||
)} | ||
> | ||
{icon ? ( | ||
icon.type === 'emoji' ? ( | ||
icon.emoji + ' ' | ||
) : icon.type === 'external' ? ( | ||
<img | ||
src={icon.external.url} | ||
width={20} | ||
height={20} | ||
className='text-transparent' | ||
alt={`${display} Icon`} | ||
/> | ||
) : ( | ||
<img | ||
src={icon.file.url} | ||
width={20} | ||
height={20} | ||
className='text-transparent' | ||
alt={`${display} Icon`} | ||
/> | ||
) | ||
) : null} | ||
{display} | ||
</a> | ||
</div> | ||
); | ||
} |
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
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
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
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
Oops, something went wrong.