Skip to content

Commit d1838f5

Browse files
committed
feat: golden toast
1 parent ae0572a commit d1838f5

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/components/Toast.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ const Toast = ({
2727
' bg-toast-background border-toast-border hover:bg-toast-background/90';
2828
const errorStyle =
2929
' bg-toast-error-background border-toast-error-border hover:bg-toast-error-background/90';
30+
const goldStyle =
31+
' bg-toast-gold-background border-toast-gold-border hover:bg-toast-gold-background/90';
32+
33+
let toastStyle = successStyle;
34+
if (type === 'error') toastStyle = errorStyle;
35+
if (type === 'gold') toastStyle = goldStyle;
36+
3037
return (
3138
<motion.div
3239
initial={{ x: '100%', opacity: 0 }}
3340
animate={{ x: 0, opacity: 1 }}
3441
exit={{ opacity: 0 }}
3542
transition={{ type: 'spring', stiffness: 120, damping: 20 }}
36-
className={`${defaultStyle} ${type === 'error' ? `${errorStyle}` : `${successStyle}`}`}
43+
className={`${defaultStyle} ${toastStyle}`}
3744
>
3845
<div className="flex flex-col text-sm group w-max flex-grow">
3946
<div className="flex items-center gap-2">

src/config/colors.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ module.exports = {
8383
'toast-error-hover-background': 'rgba(122,84,84,0.8)',
8484
'toast-error-border': '#684b4b',
8585

86+
// Toast gold colors
87+
'toast-gold-background': 'rgba(87, 72, 35, 0.8)',
88+
'toast-gold-hover-background': 'rgba(122, 100, 49, 0.8)',
89+
'toast-gold-border': '#68562b',
90+
8691
// Code Theme Colors (from src/utils/customTheme.js)
8792
codeTheme: {
8893
'text-default': '#d1d5db',

src/context/AchievementContext.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export const AchievementProvider = ({ children }) => {
4040
title: 'Achievement Unlocked!',
4141
message: achievement.title,
4242
duration: 4000,
43-
icon: <TrophyIcon weight="duotone"/>
43+
icon: <TrophyIcon weight="duotone"/>,
44+
type: 'gold'
4445
// You might want to add a specific type or icon here later for styling
4546
});
4647
};

0 commit comments

Comments
 (0)