Skip to content

Commit

Permalink
chore: story for popup
Browse files Browse the repository at this point in the history
  • Loading branch information
mshatikhin committed Jun 28, 2024
1 parent c861066 commit 4da3a41
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/react-ui/components/__stories__/sandbox.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useEffect, useRef, useState } from 'react';

import { Meta } from '../../typings/stories';
import { Tooltip } from '../Tooltip';
import { Hint } from '../Hint';
import { Gapped } from '../Gapped';
import { WidgetContainer } from '../../lib/widgets';

export default {
title: 'Sandbox',
} as Meta;

export const Default = () => {
const root = useRef<HTMLDivElement>(null);
const [_, forceUpdate] = useState<number>();

useEffect(() => forceUpdate(Date.now), [root.current]);

return (
<div style={{ position: 'relative', overflow: 'hidden' }}>
<div ref={root} />
{root.current && (
<WidgetContainer root={root.current}>
<div style={{ padding: '100px 0' }}>
<Gapped vertical gap={60}>
<Tooltip pos="right middle" trigger="opened" render={() => <div>Tooltip</div>}>
<div>Tooltip</div>
</Tooltip>
<Hint pos="right middle" manual opened text="Hint">
<div>Hint</div>
</Hint>
</Gapped>
</div>
</WidgetContainer>
)}
</div>
);
};

0 comments on commit 4da3a41

Please sign in to comment.