Skip to content

Commit

Permalink
chore(Text): stories changed
Browse files Browse the repository at this point in the history
  • Loading branch information
SySagar committed Jan 12, 2025
1 parent e138034 commit edc6b95
Show file tree
Hide file tree
Showing 3 changed files with 292 additions and 295 deletions.
91 changes: 45 additions & 46 deletions apps/ui/.storybook/decorator.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,56 @@
import React from 'react';
import { useEffect } from 'react';

export function withGlobalStyles(Story, context) {
let { scheme } = context.globals;
let { scheme } = context.globals;

useEffect(() => {
if (scheme === 'dark') {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
useEffect(() => {
if (scheme === 'dark') {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
}, [scheme]);

function Flex({ children, ...props }) {
return (
<div
{...props}
style={{
display: 'flex',
padding: '3rem',
justifyContent: 'center',
alignItems: 'center',
}}
>
{children}
</div>
);
}
}, [scheme]);

function Flex({ children, ...props }) {
return (
<div
{...props}
style={{
display: 'flex',
padding: '3rem',
justifyContent: 'center',
alignItems: 'center',
}}
>
{children}
</div>
);
}
if (scheme === 'light') {
return (
<Flex className="color-scheme--light">
<Story />
</Flex>
);
}

if (scheme === 'light') {
return (
<Flex className="color-scheme--light">
<Story />
</Flex>
);
}
if (scheme === 'dark') {
return (
<Flex className="color-scheme--dark">
<Story />
</Flex>
);
}

if (scheme === 'dark') {
return (
<Flex className="color-scheme--dark">
<Story />
</Flex>
<div>
<Flex className="color-scheme--dark">
<Story />
</Flex>
<Flex className="color-scheme--light">
<Story />
</Flex>
</div>
);
}

return (
<div>
<Flex className="color-scheme--dark">
<Story />
</Flex>
<Flex className="color-scheme--light">
<Story />
</Flex>
</div>
);
}
Loading

0 comments on commit edc6b95

Please sign in to comment.