Skip to content

Commit

Permalink
Fix notistack clear button vertical alignment when text is too large
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Apr 17, 2024
1 parent 2bebd19 commit 46260a0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/screens/component-catalog/snackbar-story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@ export const SnackbarStory = () => {
Show success snackbar
</button>

<button onClick={() => notifyError({}, { duration: 10000 })}>
<button onClick={() => notifyError(false, { duration: 10000 })}>
Show error snackbar
</button>

<button
onClick={() =>
notifyError(false, {
duration: 100 * 1000,
message:
"Unable to generate cards. Please try updating your prompt",
})
}
>
Show long error snackbar
</button>
</div>
);
};
4 changes: 4 additions & 0 deletions src/screens/shared/snackbar/notistack.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Fix notistack clear button vertical alignment */
#notistack-snackbar {
width: calc(100% - 50px);
}
1 change: 1 addition & 0 deletions src/screens/shared/snackbar/snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { userStore } from "../../../store/user-store.ts";
import { hapticNotification } from "../../../lib/telegram/haptics.ts";
import { t } from "../../../translations/t.ts";
import { ClearSnackbar } from "./clear-snackbar.tsx";
import "./notistack.css";

const sharedStyles = {
borderRadius: theme.borderRadius,
Expand Down

0 comments on commit 46260a0

Please sign in to comment.