From 85c986f5b24e6f8a6db661cca84aa5d83dd5c114 Mon Sep 17 00:00:00 2001
From: automated-signal <37887102+automated-signal@users.noreply.github.com>
Date: Tue, 2 Jul 2024 18:09:35 -0500
Subject: [PATCH] Fix Inbox storybook
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
---
images/signal-logo.svg | 2 +-
stylesheets/_global.scss | 2 +-
ts/components/Inbox.stories.tsx | 12 ++++++++++--
ts/components/Inbox.tsx | 2 +-
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/images/signal-logo.svg b/images/signal-logo.svg
index 2ba32a87c7..ff0e2a07e0 100644
--- a/images/signal-logo.svg
+++ b/images/signal-logo.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss
index d0f5caf391..fa6535f3b7 100644
--- a/stylesheets/_global.scss
+++ b/stylesheets/_global.scss
@@ -292,7 +292,7 @@ $loading-height: 16px;
justify-content: center;
user-select: none;
- .container {
+ .dot-container {
display: flex;
gap: 7px;
margin-block: 6px 22px;
diff --git a/ts/components/Inbox.stories.tsx b/ts/components/Inbox.stories.tsx
index b2f93e4dfc..6ecbc01712 100644
--- a/ts/components/Inbox.stories.tsx
+++ b/ts/components/Inbox.stories.tsx
@@ -21,7 +21,10 @@ export default {
hasInitialLoadCompleted: false,
isCustomizingPreferredReactions: false,
},
-} satisfies Meta;
+ argTypes: {
+ daysAgo: { control: { type: 'number' } },
+ },
+} satisfies Meta;
// eslint-disable-next-line react/function-component-definition
const Template: StoryFn = ({
@@ -32,7 +35,7 @@ const Template: StoryFn = ({
const [dayOffset, setDayOffset] = useState(0);
useEffect(() => {
- if (daysAgo === undefined) {
+ if (!daysAgo) {
setDayOffset(0);
return noop;
}
@@ -64,3 +67,8 @@ const Template: StoryFn = ({
};
export const Default = Template.bind({});
+
+export const FourDaysAgo = Template.bind({});
+FourDaysAgo.args = {
+ daysAgo: 4,
+};
diff --git a/ts/components/Inbox.tsx b/ts/components/Inbox.tsx
index 74a6233521..6a79300d0b 100644
--- a/ts/components/Inbox.tsx
+++ b/ts/components/Inbox.tsx
@@ -128,7 +128,7 @@ export function Inbox({
{envelopeTimestamp === undefined ? (
-