mirror of
https://github.com/vercel/commerce.git
synced 2025-07-28 04:31:22 +00:00
.github
.vscode
packages
site
assets
components
auth
cart
checkout
common
icons
product
ui
Button
Collapse
Container
Dropdown
ErrorMessage
Grid
Hero
Input
Link
LoadingDots
Logo
Marquee
Modal
Quantity
Rating
Sidebar
Skeleton
Text
ThemeSwitcher
ThemeIcon.tsx
ThemeSwitcher.tsx
index.ts
README.md
context.tsx
index.ts
wishlist
search.tsx
config
lib
pages
public
static_data
workers
.env.template
.eslintrc
.gitignore
.npmrc
.prettierignore
.prettierrc
commerce-config.js
commerce.config.json
global.d.ts
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
.editorconfig
.gitignore
.prettierignore
.prettierrc
LICENSE-CC-BY-NC-ND-4.0.md
README.md
license.md
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
turbo.json
* Footer theme switcher * Remove lazy loading & change rotation animation * Changes * Update ThemeSwitcher.tsx * Requested style changes * Update ThemeSwitcher.tsx * Fix alignment * Update ThemeSwitcher.tsx
23 lines
397 B
TypeScript
23 lines
397 B
TypeScript
import { Moon, Sun, System } from '@components/icons'
|
|
|
|
interface ThemeIconProps {
|
|
theme?: string
|
|
width: number
|
|
height: number
|
|
}
|
|
|
|
const ThemeIcon = ({ theme, ...props }: ThemeIconProps) => {
|
|
switch (theme) {
|
|
case 'light':
|
|
return <Sun {...props} />
|
|
|
|
case 'dark':
|
|
return <Moon {...props} />
|
|
|
|
default:
|
|
return <System {...props} />
|
|
}
|
|
}
|
|
|
|
export default ThemeIcon
|