diff --git a/components/Toast/Toast.css b/components/Toast/Toast.css
index 7c0857c..f74158d 100644
--- a/components/Toast/Toast.css
+++ b/components/Toast/Toast.css
@@ -1,13 +1,17 @@
.toast {
+ font-size: 14px;
+ font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Hiragino Kaku Gothic Pro", Meiryo, "Malgun Gothic", sans-serif;
background: hsla(192, 55%, 42%, 1);
- /* border: .1rem solid #ededed; */
- border-radius: .3rem;
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
+ display: flex;
+ align-items: center;
+ min-width: 320px;
+ width: 33vw;
color: #fff;
- display: block;
padding: 1.4rem;
- width: 100%;
- font-size: 14px;
- font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Hiragino Kaku Gothic Pro", Meiryo, "Malgun Gothic", sans-serif;
+ margin-bottom: 20px;
+ border-radius: .3rem;
+ animation: toast-in-anim 0.3s;
}
.toast-success {
@@ -25,65 +29,74 @@
color: #fff;
}
-.toast .btn-clear {
- color: #fff;
- float: right;
+.toast-icon {
+ fill: white;
height: 24px;
width: 24px;
- border-radius: 48px;
- padding: 0;
-}
-
-.toast .btn:not(.btn-clear) {
- float: right;
- padding: 5px 10px;
- background: rgba(255,255,255,0.75)
+ padding: 3px;
+ flex-shrink: 0;
}
-.app-toast-center .toast .btn-clear{
- height: 24px;
- width: 24px;
- border-radius: 48px;
-}
-
-.show-outline .toast .btn:focus {
- outline: none;
- box-shadow: 0 0 0 2px #fff;
+.toast p {
+ margin: 0;
+ padding: 0;
}
-.btn {
+.toast-btn {
position: relative;
-webkit-appearance: none;
- background: white;
border: none;
- border-radius: .3rem;
cursor: pointer;
display: inline-block;
outline: 0;
text-align: center;
text-decoration: none;
user-select: none;
- vertical-align: middle;
white-space: nowrap;
transition-duration: .2s;
+ margin-left: auto;
+ flex-shrink: 0;
}
-.btn-clear {
+.toast-btn:focus {
+ outline: none;
+ box-shadow: 0 0 0 2px #fff;
+}
+
+.toast-btn.dismiss-btn {
+ fill: #fff;
+ padding: 0;
+ height: 24px;
+ width: 24px;
+ border-radius: 48px;
background: transparent;
- border: 0;
- color: #666;
- margin-left: .3rem;
opacity: .45;
- padding: 0;
}
-.btn-clear:hover {
- opacity: .85;
- }
-.btn-clear::before {
- content: '\00d7';
- font-size: 2rem;
+
+.toast-btn.dismiss-btn:hover,
+.toast-btn.dismiss-btn:focus {
+ opacity: .85;
}
-button:active {
- transform: translateY(1px)
+.toast-btn.dismiss-btn .dismiss-btn-icon {
+ outline: 0;
+}
+
+.toast-btn.action-btn {
+ padding: 8px 16px;
+ background: white;
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
+}
+
+.toast-btn:active {
+ transform: translateY(1px);
+}
+
+@keyframes toast-in-anim {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
}
\ No newline at end of file
diff --git a/components/Toast/Toast.d.ts b/components/Toast/Toast.d.ts
index 5798960..6097a45 100644
--- a/components/Toast/Toast.d.ts
+++ b/components/Toast/Toast.d.ts
@@ -3,7 +3,6 @@ import * as React from 'react'
export interface IToast {
id: string
type: string
- icon: string
message: string
}
diff --git a/components/Toast/Toast.js b/components/Toast/Toast.js
index 4a3f98a..14c6708 100644
--- a/components/Toast/Toast.js
+++ b/components/Toast/Toast.js
@@ -1,7 +1,16 @@
import React, { Component } from 'react'
+import Icon from '@mdi/react'
+import { mdiCheck, mdiAlert, mdiAlertOctagon, mdiInformationOutline, mdiClose } from '@mdi/js'
+
import './Toast.css'
+const IconMap = {
+ success: mdiCheck,
+ warning: mdiAlert,
+ danger: mdiAlertOctagon,
+}
+
class Toast extends Component {
componentDidMount() {
if (!this.props.toast.callback && this.props.toast.type !== 'danger') {
@@ -22,30 +31,19 @@ class Toast extends Component {
className={`toast toast-${toast.type}`}
role="alert"
>
- {toast.icon && (
-
- )}
- {toast.message}
+
+
{toast.message}
{toast.callback
- ?
- :