Skip to content

Commit

Permalink
Rename ErrorAlerts component
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrindlaub committed Sep 6, 2024
1 parent 833d16b commit 1359cce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import { selectManageUserErrors, dismissManageUsersError } from '../features/pro

// TODO: add updateAutomationRules errors

const ErrorAlerts = () => {
const ErrorToast = () => {
const dispatch = useDispatch();
const labelsErrors = useSelector(selectLabelsErrors);
const commentsErrors = useSelector(selectCommentsErrors);
Expand Down Expand Up @@ -176,4 +176,4 @@ function enrichErrors(errors, title, entity) {
}));
}

export default ErrorAlerts;
export default ErrorToast;
19 changes: 8 additions & 11 deletions src/components/Toast.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import { styled, keyframes } from '@stitches/react';
import { slate, red, green } from '@radix-ui/colors';
import * as ToastPrimitive from '@radix-ui/react-toast';
Expand Down Expand Up @@ -43,10 +41,9 @@ const StyledToast = styled(ToastPrimitive.Root, {
boxShadow: 'hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px',
padding: 15,
display: 'grid',
gridTemplateAreas: '"title action" "description action"',
gridTemplateAreas: '"title action" "description ."',
gridTemplateColumns: 'auto max-content',
columnGap: 15,
alignItems: 'center',

'@media (prefers-reduced-motion: no-preference)': {
'&[data-state="open"]': {
Expand Down Expand Up @@ -80,9 +77,9 @@ const StyledToast = styled(ToastPrimitive.Root, {
backgroundColor: green.green2,
color: '$successText',
boxShadow: `inset 0 0 0 1px ${green.green7}`,
}
}
}
},
},
},
});

const StyledTitle = styled(ToastPrimitive.Title, {
Expand All @@ -96,12 +93,12 @@ const StyledTitle = styled(ToastPrimitive.Title, {
variant: {
red: {
color: '$errorText',
},
},
green: {
color: '$successText',
}
}
}
},
},
},
});

const StyledDescription = styled(ToastPrimitive.Description, {
Expand Down
4 changes: 2 additions & 2 deletions src/features/projects/ViewExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SidebarNav from './SidebarNav.jsx';
import FiltersPanel from '../filters/FiltersPanel.jsx';
import ImagesPanel from '../images/ImagesPanel.jsx';
import Loupe from '../loupe/Loupe.jsx';
import ErrorAlerts from '../../components/ErrorAlerts.jsx';
import ErrorToast from '../../components/ErrorToast.jsx';
import HydratedModal from '../../components/HydratedModal.jsx';

const ViewExplorerWrapper = styled('div', {
Expand Down Expand Up @@ -39,7 +39,7 @@ const ViewExplorer = () => {
<ImagesPanel />
{loupeOpen && <Loupe />}
<HydratedModal />
<ErrorAlerts />
<ErrorToast />
</ViewExplorerWrapper>
);
};
Expand Down

0 comments on commit 1359cce

Please sign in to comment.