Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Oct 13, 2023
1 parent 66ed75f commit 4f76026
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/toast/Toast.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const useGetRgbBackgroundColor = (status: string) => {
const theme = useTheme();
switch (status) {
case 'success':
return 'rgba(10, 173, 166, 0.4)';
return `rgba(${theme.statusHealthyRGB}, 0.4)`;
case 'error':
return 'rgba(232, 72, 85, 0.4)';
return `rgba(${theme.statusCriticalRGB}, 0.4)`;
case 'warning':
return 'rgba(248, 243, 43, 0.4)';
return `rgba(${theme.statusWarningRGB}, 0.4)`;
default:
return theme.infoSecondary;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ function Toast({
return (
<div
ref={ref}
role="alert"
role="status"
aria-live="polite"
style={{
position: 'fixed',
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/toast/useMutationsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { ReactNode, useCallback, useEffect } from 'react';
import { UseMutationResult } from 'react-query';
import { useToast } from './ToastProvider';

export type MutationConfig<Data, Variables> = {
export type MutationConfig<Data = unknown, Variables = unknown> = {
mutation: UseMutationResult<Data, unknown, Variables, unknown>;
name: string;
};

type DescriptionBuilder<Data> = {
type DescriptionBuilder<Data = unknown> = {
data?: Data;
error?: unknown;
name: string;
};

type MutationsHandlerProps<Data, Variables> = {
type MutationsHandlerProps<Data = unknown, Variables = unknown> = {
mainMutation: MutationConfig<Data, Variables>;
dependantMutations?: MutationConfig<Data, Variables>[];
messageDescriptionBuilder: (
Expand All @@ -24,7 +24,7 @@ type MutationsHandlerProps<Data, Variables> = {
onMainMutationSuccess?: () => void;
};

export const useMutationsHandler = <Data, Variables>({
export const useMutationsHandler = <Data = unknown, Variables = unknown>({
mainMutation,
dependantMutations,
messageDescriptionBuilder,
Expand Down
3 changes: 3 additions & 0 deletions src/lib/style/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ export const grayLightest = '#E9EBED';
export const defaultTheme = {
darkRebrand: {
statusHealthy: '#0AADA6',
statusHealthyRGB: '10,173,166',
statusWarning: '#F8F32B',
statusWarningRGB: '248,243,43',
statusCritical: '#E84855',
statusCriticalRGB: '232,72,85',
selectedActive: '#037AFF',
highlight: '#1A3C75',
border: '#4A4A4A',
Expand Down

0 comments on commit 4f76026

Please sign in to comment.