Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toast colors #440

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions src/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,12 @@ export function ToastContent(props: ToastContentProps) {
const { t, ...rest } = props;

const toastIcons = {
success: <FiCheckCircle size={24} />,
error: <FiAlertCircle size={24} />,
loading: <Spinner />,
blank: <FiInfo size={24} />,
success: <FiCheckCircle size={24} className="text-s-success" />,
error: <FiAlertCircle size={24} className="text-s-error" />,
loading: <Spinner className="text-f-primary" />,
blank: <FiInfo size={24} className="text-f-primary" />,
custom: t.icon ?? <FiInfo size={24} />,
};

const typeToTextClass = {
success: 'text-s-success',
error: 'text-s-error',
loading: 'text-f-primary',
blank: 'text-f-primary',
custom: 'text-f-primary',
};

let content;
if (typeof t.message === 'string') {
content = t.message;
Expand All @@ -65,8 +56,6 @@ export function ToastContent(props: ToastContentProps) {
content = (t.message as CallableFunction)().props.children;
}

const textClassName = typeToTextClass[t.type];

return (
<Transition
appear
Expand All @@ -81,7 +70,7 @@ export function ToastContent(props: ToastContentProps) {
>
<div
className={`flex items-center w-fit p-4 rounded-lg shadow-2xl
bg-secondary ${textClassName}`}
bg-secondary text-f-primary`}
{...rest}
>
<div
Expand Down
Loading