Skip to content

Commit

Permalink
Add success and attached toast types
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaraJay committed Nov 12, 2023
1 parent a6715b8 commit e9bc8bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/renderer/pages/Pile/Toasts/Toast/Toast.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@
&.thinking {
color: var(--active);
}

&.success {
color: var(--base);
}

&.attached {
color: var(--base);
}
}
5 changes: 5 additions & 0 deletions src/renderer/pages/Pile/Toasts/Toast/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Logo from 'renderer/pages/Home/logo';
import Thinking from './Loaders/Thinking';
import Waiting from './Loaders/Waiting';
import Info from './Loaders/Info';
import { PaperclipIcon, SmileIcon } from 'renderer/icons';

export default function Toast({ notification }) {
const renderIcon = (type) => {
Expand All @@ -13,6 +14,10 @@ export default function Toast({ notification }) {
return <Thinking className={styles.icon} />;
case 'waiting':
return <Waiting className={styles.icon} />;
case 'success':
return null;
case 'attached':
return <PaperclipIcon className={styles.icon} />;
default:
return <Info className={styles.icon} />;
}
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/pages/Pile/Toasts/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export default function Toasts() {

return (
<div className={styles.container}>
<AnimatePresence initial={false} mode={'wait'}>
{renderNotifications()}
</AnimatePresence>
<AnimatePresence mode={'wait'}>{renderNotifications()}</AnimatePresence>
</div>
);
}

0 comments on commit e9bc8bf

Please sign in to comment.