Skip to content

Commit

Permalink
chore: fix lint errors in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
@casey_baggz_omni committed Oct 2, 2024
1 parent 475ab2a commit 3b45af3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
11 changes: 6 additions & 5 deletions docs/app/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { button } from '@cerberus/styled-system/recipes'
import { DogIcon } from './icons/DogIcon'
import { FireIcon } from './icons/FireIcon'
import { getTheme, injectTheme, type ThemeName } from '@/styled-system/themes'
import { PAGE_BORDER_INITIAL } from '../utils/const'

const navLogoContent = (
<section
Expand Down Expand Up @@ -89,7 +90,7 @@ export function Nav() {
const currentTheme = e.currentTarget.value
const newTheme = currentTheme === 'cerberus' ? 'acheron' : 'cerberus'
updateTheme(newTheme)
const pandaTheme = await getTheme(theme as ThemeName)
const pandaTheme = await getTheme(newTheme as ThemeName)
injectTheme(document.documentElement, pandaTheme)
},
[updateTheme],
Expand All @@ -112,7 +113,7 @@ export function Nav() {
bgColor: 'rgba(255, 255, 255, 0.3)',
},
_darkMode: {
bgColor: 'rgba(19, 0, 36, 0.3)',
bgColor: 'page.backdrop.initial',
},
md: {
gridTemplateRows: '1fr',
Expand Down Expand Up @@ -140,11 +141,11 @@ export function Nav() {
<ul
className={hstack({
border: '1px solid',
borderColor: 'page.border.initial',
borderColor: PAGE_BORDER_INITIAL,
gap: '0',
w: 'full',
'& li:nth-child(2)': {
borderColor: 'page.border.initial',
borderColor: PAGE_BORDER_INITIAL,
borderLeft: '1px solid',
borderRight: '1px solid',
md: {
Expand Down Expand Up @@ -276,7 +277,7 @@ export function Nav() {
css({
bgColor: 'page.bg.100',
border: '1px solid',
borderColor: 'page.border.initial',
borderColor: PAGE_BORDER_INITIAL,
fontWeight: 500,
h: '2.275rem',
rounded: 'sm',
Expand Down
7 changes: 1 addition & 6 deletions docs/app/preset/colors/components/AvatarSwatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,15 @@ interface ColorSwatchProps {
}

export default function ColorSwatch(props: ColorSwatchProps) {
const { mode } = useThemeContext()
const searchParams = useSearchParams()

const modeValue = useMemo(() => {
return mode === 'dark' ? '_darkMode' : '_lightMode'
}, [mode])
const color = useMemo(() => {
const snakeCaseToken = props.tokenName
.replace(/([A-Z])/g, ' $1')
.trim()
.toLowerCase()
.replace(/\s+/g, '-')
return `var(--cerberus-colors-${snakeCaseToken})`
}, [modeValue, props.tokenName])
}, [props.tokenName])

const bgColor = {
backgroundColor: color,
Expand Down
5 changes: 1 addition & 4 deletions docs/app/preset/colors/components/color-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,14 @@ export default function ColorDetails() {
}
}, [scope, splitToken])

const modeValue = useMemo(() => {
return mode === 'dark' ? '_darkMode' : '_lightMode'
}, [mode])
const color = useMemo(() => {
const snakeCaseToken = paramsToken
.replace(/([A-Z])/g, ' $1')
.trim()
.toLowerCase()
.replace(/\s+/g, '-')
return `var(--cerberus-colors-${snakeCaseToken})`
}, [modeValue, paramsToken])
}, [paramsToken])

const swatchColor = {
backgroundColor: color,
Expand Down
1 change: 1 addition & 0 deletions docs/app/utils/const.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const NEUTRAL_BORDER_100 = 'page.border.100'
export const PAGE_BORDER_INITIAL = 'page.border.initial'
export const PAGE_BORDER_100 = 'page.border.100'
export const PAGE_TEXT_INITIAL = 'page.text.initial'
export const NEUTRAL_TEXT_INVERSE = 'page.text.inverse'
Expand Down

0 comments on commit 3b45af3

Please sign in to comment.