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

Commit

Permalink
Merge pull request #18 from Ademking/main
Browse files Browse the repository at this point in the history
fix(notification & message): icon
  • Loading branch information
pepelele committed Jul 7, 2021
2 parents ca4353c + 5783822 commit f555b17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
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

0 comments on commit f555b17

Please sign in to comment.