Skip to content

Commit 2e3503b

Browse files
committed
update docusaurus
1 parent a2c2ab6 commit 2e3503b

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

website/src/components/Chip.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
11
import React, { useState } from 'react';
22
import AnimateHeight from 'react-animate-height';
33

4-
import { useColorMode } from '@docusaurus/theme-common';
5-
64
type 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-
198
export 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>

0 commit comments

Comments
 (0)