Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

fix(notification & message): icon #18

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions packages/message/src/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ import { cx as clsx, __DEV__ } from "@vechaiui/utils";
import * as React from "react";

const statuses = {
info: { icon: InfoIcon, cx: "message-icon-info", label: "info" },
success: { icon: XCricleIcon, cx: "message-icon-success", label: "x-circle" },
error: {
info: {
icon: InfoIcon,
cx: "message-icon-info",
label: "info"
},
success: {
icon: CheckCircleIcon,
cx: "message-icon-success",
label: "check-circle"
},
error: {
icon: XCricleIcon,
cx: "message-icon-error",
label: "check-circle",
label: "x-circle"
},
warning: {
icon: ExclamationIcon,
Expand All @@ -32,7 +40,7 @@ type OmittedTypes =
| "undoText"
| "description";

export interface MessageProps extends Omit<useToastOptions, OmittedTypes> {}
export interface MessageProps extends Omit<useToastOptions, OmittedTypes> { }

const Message = React.forwardRef<HTMLDivElement, MessageProps>(
({ message, className, icon: customIcon, status = "" }, ref) => {
Expand Down
18 changes: 13 additions & 5 deletions packages/notification/src/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ import { cx as clsx, __DEV__ } from "@vechaiui/utils";
import * as React from "react";

const statuses = {
info: { icon: InfoIcon, cx: "notification-icon-info", label: "info" },
success: { icon: XCricleIcon, cx: "notification-icon-success", label: "x-circle" },
error: {
info: {
icon: InfoIcon,
cx: "notification-icon-info",
label: "info"
},
success: {
icon: CheckCircleIcon,
cx: "notification-icon-error",
cx: "notification-icon-success",
label: "check-circle",
},
error: {
icon: XCricleIcon,
cx: "notification-icon-error",
label: "x-circle"
},
warning: {
icon: ExclamationIcon,
cx: "notification-icon-warning",
Expand All @@ -29,7 +37,7 @@ const statuses = {
type OmittedTypes = "message";

export interface NotificationProps
extends Omit<useToastOptions, OmittedTypes> {}
extends Omit<useToastOptions, OmittedTypes> { }

const Notification = React.forwardRef<HTMLDivElement, NotificationProps>(
(props, ref) => {
Expand Down