Fix Inbox storybook

This commit is contained in:
Fedor Indutny 2024-07-02 13:31:51 -07:00 committed by GitHub
parent 0ab8ec34d0
commit 19049c252e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 5 deletions

View file

@ -21,7 +21,10 @@ export default {
hasInitialLoadCompleted: false,
isCustomizingPreferredReactions: false,
},
} satisfies Meta<PropsType>;
argTypes: {
daysAgo: { control: { type: 'number' } },
},
} satisfies Meta<PropsType & { daysAgo?: number }>;
// eslint-disable-next-line react/function-component-definition
const Template: StoryFn<PropsType & { daysAgo?: number }> = ({
@ -32,7 +35,7 @@ const Template: StoryFn<PropsType & { daysAgo?: number }> = ({
const [dayOffset, setDayOffset] = useState(0);
useEffect(() => {
if (daysAgo === undefined) {
if (!daysAgo) {
setDayOffset(0);
return noop;
}
@ -64,3 +67,8 @@ const Template: StoryFn<PropsType & { daysAgo?: number }> = ({
};
export const Default = Template.bind({});
export const FourDaysAgo = Template.bind({});
FourDaysAgo.args = {
daysAgo: 4,
};

View file

@ -128,7 +128,7 @@ export function Inbox({
<div className="module-splash-screen__logo module-img--150" />
{envelopeTimestamp === undefined ? (
<div className="container">
<div className="dot-container">
<span className="dot" />
<span className="dot" />
<span className="dot" />