File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change 11import React , { useState } from 'react' ;
22import AnimateHeight from 'react-animate-height' ;
33
4- import { useColorMode } from '@docusaurus/theme-common' ;
5-
64type ChipProps = {
75 children ?: string ;
86} ;
97
10- const COLORS = {
11- dark : {
12- description : 'border-gray-200 bg-neutral-600 text-gray-200' ,
13- } ,
14- light : {
15- description : 'border-neutral-500 bg-gray-200 text-neutral-600' ,
16- } ,
17- } as const ;
18-
198export const Chip = ( { children } : ChipProps ) => {
20- const { colorMode } = useColorMode ( ) ;
219 const [ descriptionHeight , setDescriptionHeight ] = useState < 'auto' | 0 > ( 0 ) ;
2210
2311 return (
2412 < div className = "mb-2" >
2513 < div
26- className = { ` mb-1 inline-flex cursor-pointer items-center rounded-lg bg-neutral-500 px-1.5 text-[11px] font-normal text-gray-200 dark:bg-gray-200 dark:text-neutral-600` }
14+ className = " mb-1 inline-flex cursor-pointer items-center rounded-lg bg-neutral-500 px-1.5 text-[11px] font-normal text-gray-200 dark:bg-gray-200 dark:text-neutral-600"
2715 onClick = { ( ) => setDescriptionHeight ( ( prev ) => ( prev === 0 ? 'auto' : 0 ) ) }
2816 >
2917 < div className = "mr-1" > Note</ div >
3018 < InfoIcon />
3119 </ div >
3220 < AnimateHeight duration = { 500 } easing = "ease" height = { descriptionHeight } >
33- < div
34- className = { `rounded-md border-0 border-l-[5px] border-solid p-2 text-xs italic [&_p]:mb-0 ${ COLORS [ colorMode ] . description } ` }
35- >
21+ < div className = "rounded-md border-0 border-l-[5px] border-solid border-neutral-500 bg-gray-200 p-2 text-xs italic text-neutral-600 dark:border-gray-200 dark:bg-neutral-600 dark:text-gray-200 [&_p]:mb-0" >
3622 { children }
3723 </ div >
3824 </ AnimateHeight >
You can’t perform that action at this time.
0 commit comments