-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom alerts, update needs funds copy
- Loading branch information
Atatakai
authored and
Atatakai
committed
May 23, 2024
1 parent
0115447
commit 57fb471
Showing
12 changed files
with
134 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
ExclamationCircleOutlined, | ||
InfoCircleOutlined, | ||
WarningOutlined, | ||
} from '@ant-design/icons'; | ||
import { Alert as AlertAntd, AlertProps } from 'antd'; | ||
|
||
type AlertType = 'primary' | 'info' | 'warning' | 'error'; | ||
|
||
const icons = { | ||
primary: <InfoCircleOutlined />, | ||
info: <InfoCircleOutlined />, | ||
warning: <WarningOutlined />, | ||
error: <ExclamationCircleOutlined />, | ||
}; | ||
|
||
export const Alert = ({ | ||
type, | ||
fullWidth, | ||
...rest | ||
}: { type: AlertType; fullWidth?: boolean } & Omit<AlertProps, 'type'>) => ( | ||
<AlertAntd | ||
type={type === 'primary' ? undefined : type} | ||
className={`custom-alert custom-alert--${type} ${fullWidth ? 'custom-alert--full-width' : ''}`} | ||
icon={rest.showIcon ? icons[type] : undefined} | ||
{...rest} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.