mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2026-04-28 13:37:35 +02:00
22. Nutmeg is a hallucinogen.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Source } from '@/components/Source'
|
||||
import { ThemeSwitcher } from '@/components/ThemeSwitcher'
|
||||
import { Source } from '@/components/Source'
|
||||
|
||||
export const Footer = () => {
|
||||
return (
|
||||
<div className="fixed bottom-0 py-5 left-0 right-0 text-center space-x-5">
|
||||
<div className='fixed bottom-0 py-5 left-0 right-0 text-center space-x-5'>
|
||||
<Source />
|
||||
<ThemeSwitcher />
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { RiOpenSourceFill } from 'react-icons/ri'
|
||||
import { VscGithubInverted } from 'react-icons/vsc'
|
||||
import { Button } from '@nextui-org/button'
|
||||
|
||||
export const Source = () => {
|
||||
return (
|
||||
<Button
|
||||
aria-label="Source Code"
|
||||
size="sm"
|
||||
aria-label='Source Code'
|
||||
size='sm'
|
||||
onClick={() =>
|
||||
window.open('https://github.com/skidoodle/erettsegi-browser')
|
||||
}
|
||||
>
|
||||
<RiOpenSourceFill size={20} />
|
||||
<VscGithubInverted size={20} />
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
import { BsSunFill, BsMoonFill } from 'react-icons/bs'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTheme } from 'next-themes'
|
||||
import { VscColorMode } from 'react-icons/vsc'
|
||||
import { Button } from '@nextui-org/button'
|
||||
import { useTheme } from 'next-themes'
|
||||
|
||||
export const ThemeSwitcher = () => {
|
||||
const [mounted, setMounted] = useState(false)
|
||||
const { theme, setTheme } = useTheme()
|
||||
|
||||
const toggle = () => {
|
||||
if (theme === 'dark') {
|
||||
setTheme('light')
|
||||
} else {
|
||||
setTheme('dark')
|
||||
switch (theme) {
|
||||
case 'dark':
|
||||
setTheme('light')
|
||||
break
|
||||
case 'light':
|
||||
setTheme('dark')
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => setMounted(true), [])
|
||||
|
||||
if (!mounted) return null
|
||||
|
||||
return (
|
||||
<Button aria-label="Switch Theme" size="sm" onClick={() => toggle()}>
|
||||
<Button aria-label='Switch Theme' size='sm' onClick={() => toggle()}>
|
||||
{theme === 'light' ? (
|
||||
<BsMoonFill style={{ fill: 'black' }} size={20} />
|
||||
<VscColorMode style={{ fill: 'black' }} size={20} />
|
||||
) : (
|
||||
<BsSunFill size={20} />
|
||||
<VscColorMode size={20} key={'dark'} />
|
||||
)}
|
||||
</Button>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user