Skip to content

Commit 3d634cf

Browse files
billy-lekylemh
andauthored
Chore/alert tw (#1898)
Co-authored-by: Kyle Holmberg <[email protected]>
1 parent f90594a commit 3d634cf

File tree

5 files changed

+13
-56
lines changed

5 files changed

+13
-56
lines changed

components/Alert/Alert.module.css

Lines changed: 0 additions & 48 deletions
This file was deleted.

components/Alert/Alert.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { cx } from 'common/utils/cva';
22
import { ALERT, ALERT_CLOSE_BUTTON } from 'common/constants/testIDs';
33
import ScreenReaderOnly from 'components/ScreenReaderOnly/ScreenReaderOnly';
4-
import styles from './Alert.module.css';
54

65
export interface AlertPropsType {
76
type: 'error' | 'success' | 'warning';
@@ -20,10 +19,10 @@ function Alert({
2019
}: AlertPropsType) {
2120
return (
2221
<div
23-
className={cx(styles.Alert, className, {
24-
[styles.error]: type === 'error',
25-
[styles.success]: type === 'success',
26-
[styles.warning]: type === 'warning',
22+
className={cx('border border-solid border-black rounded shadow-md text-sm px-3', className, {
23+
'bg-error border-error-deep text-error-deep': type === 'error',
24+
'bg-success border-success-deep text-success-deep': type === 'success',
25+
'bg-warning border-warning-deep text-warning-deep': type === 'warning',
2726
})}
2827
data-testid={testID}
2928
role="alert"
@@ -32,7 +31,7 @@ function Alert({
3231
{Boolean(onClose) && (
3332
<button
3433
type="button"
35-
className={styles.alertCloseButton}
34+
className="text-2xl align-middle py-1 px-2 mr-1 transition-all duration-200 ease-linear cursor-pointer hover:text-black hover:scale-110"
3635
onClick={onClose}
3736
data-testid={ALERT_CLOSE_BUTTON}
3837
>

components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`Alert > should render error alert with required props 1`] = `
44
<div
5-
className="Alert error"
5+
className="border border-solid rounded shadow-md text-sm px-3 bg-error border-error-deep text-error-deep"
66
data-testid="ALERT"
77
role="alert"
88
>

components/Forms/UpdateProfileForm/steps/__tests__/__snapshots__/MilitaryStatus.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`UpdateProfileForm/Steps/MilitaryStatus > should render in context of Fo
1010
className="row"
1111
>
1212
<div
13-
className="Alert warning"
13+
className="border border-solid rounded shadow-md text-sm px-3 bg-warning border-warning-deep text-warning-deep"
1414
data-testid="ALERT"
1515
role="alert"
1616
>

tailwind.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ module.exports = {
2626
themeGray800: '#e2e2e2',
2727
burntOrange500: 'hsl(14, 55%, 45%, 1)',
2828
white: '#f7f7f7',
29+
error: 'var(--error)',
30+
'error-deep': 'var(--errorDeep)',
31+
success: 'var(--success)',
32+
'success-deep': 'var(--successDeep)',
33+
warning: 'var(--warning)',
34+
'warning-deep': 'var(--warningDeep)',
2935
},
3036
maxWidth: {
3137
girderWidth: '700px',

0 commit comments

Comments
 (0)