Skip to content

Commit

Permalink
fix(dialog): support theme=danger (#2365)
Browse files Browse the repository at this point in the history
* fix(dialog): support theme=danger

* test: update snapshots
  • Loading branch information
chaishi authored Jul 12, 2023
1 parent 0297e64 commit e9a2047
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dialog/DialogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const DialogCard = forwardRef<HTMLDivElement, DialogCardProps>((props, ref) => {
const iconMap = {
info: <InfoCircleFilledIcon className={`${classPrefix}-is-info`} />,
warning: <InfoCircleFilledIcon className={`${classPrefix}-is-warning`} />,
// error is going to deprecated
error: <InfoCircleFilledIcon className={`${classPrefix}-is-error`} />,
danger: <InfoCircleFilledIcon className={`${classPrefix}-is-error`} />,
success: <CheckCircleFilledIcon className={`${classPrefix}-is-success`} />,
};

Expand Down
26 changes: 26 additions & 0 deletions test/snap/__snapshots__/csr.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -66331,6 +66331,19 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
<div
class="t-dialog__header-content"
>
<svg
class="t-icon t-icon-info-circle-filled t-is-error"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M8 15A7 7 0 108 1a7 7 0 000 14zM7.4 4h1.2v1.2H7.4V4zm.1 2.5h1V12h-1V6.5z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
confirm
</div>
<span
Expand Down Expand Up @@ -66693,6 +66706,19 @@ exports[`csr snapshot test > csr test src/config-provider/_example/dialog.jsx 1`
<div
class="t-dialog__header-content"
>
<svg
class="t-icon t-icon-info-circle-filled t-is-error"
fill="none"
height="1em"
viewBox="0 0 16 16"
width="1em"
>
<path
d="M8 15A7 7 0 108 1a7 7 0 000 14zM7.4 4h1.2v1.2H7.4V4zm.1 2.5h1V12h-1V6.5z"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
confirm
</div>
<span
Expand Down
Loading

0 comments on commit e9a2047

Please sign in to comment.