Skip to content

Commit

Permalink
Drop custom style prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed Feb 14, 2024
1 parent 965c479 commit 7e9850a
Show file tree
Hide file tree
Showing 4 changed files with 4,582 additions and 16,703 deletions.
8 changes: 4 additions & 4 deletions docs/src/app/Docs/playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Box, Card, Chip, Divider, FormControl, FormLabel, IconButton, Input, Sh

import Codeblock from '@/design/components/Codeblock';

import Amicon, { aiBroom, IAmicon, IAmiconStyle } from '@studio384/amaranth';
import Amicon, { aiBroom, IAmicon } from '@studio384/amaranth';

export interface IPlaygroundConfig {
icons: IAmicon[];
Expand Down Expand Up @@ -76,13 +76,13 @@ export default function Playground({ config }: IPlaygroundProps) {
}, [iconProperties]);

// CSS Variables
const [playgroundCssVariable, setPlaygroundCssVariable] = useState<IAmiconStyle>({});
const [playgroundCssVariable, setPlaygroundCssVariable] = useState<{ [cssVar: string]: string }>({});

const iconVariables: { [index: string]: string | number | boolean } = useMemo(() => {
const props: { [index: string]: string | number | boolean } = {};

config.cssVariables?.map((variable) => {
props[variable.name] = playgroundCssVariable?.[variable.name as keyof IAmiconStyle] ?? variable.default;
props[variable.name] = playgroundCssVariable?.[variable.name as string] ?? variable.default;
});

return props;
Expand Down Expand Up @@ -185,7 +185,7 @@ export default function Playground({ config }: IPlaygroundProps) {
<Input
onChange={(e) => setPlaygroundCssVariable((prev) => ({ ...prev, [variable.name]: e.target.value }))}
placeholder={variable.default.toString()}
value={playgroundCssVariable?.[variable.name as keyof IAmiconStyle] ?? ''}
value={playgroundCssVariable?.[variable.name as string] ?? ''}
/>
</FormControl>
))}
Expand Down
Loading

0 comments on commit 7e9850a

Please sign in to comment.