Rename component

toaster
ioedeveloper 4 years ago
parent 9c7cf28a00
commit f74b3d222e
  1. 4
      libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx
  2. 2
      libs/remix-ui/toaster/src/index.ts
  3. 0
      libs/remix-ui/toaster/src/lib/toaster.css
  4. 18
      libs/remix-ui/toaster/src/lib/toaster.tsx

@ -5,7 +5,7 @@ import VmDebugger from './vm-debugger/vm-debugger'
import VmDebuggerHead from './vm-debugger/vm-debugger-head'
import { TransactionDebugger as Debugger } from '@remix-project/remix-debug'
import { DebuggerUIProps } from './DebuggerAPI'
import { RemixUiToaster } from '@remix-ui/toaster'
import { Toaster } from '@remix-ui/toaster'
/* eslint-disable-next-line */
import './debugger-ui.css'
@ -209,7 +209,7 @@ const vmDebugger = {
}
return (
<div>
<RemixUiToaster message={state.toastMessage} />
<Toaster message={state.toastMessage} />
<div className="px-2">
<div className="mt-3">
<p className="mt-2 debuggerLabel">Debugger Configuration</p>

@ -1 +1 @@
export * from './lib/remix-ui-toaster';
export * from './lib/toaster';

@ -1,18 +1,18 @@
import React, { useEffect, useState } from 'react'
import './remix-ui-toaster.css';
import './toaster.css';
/* eslint-disable-next-line */
export interface RemixUiToasterProps {
export interface ToasterProps {
message: any
opts?: RemixUiToasterOptions
opts?: ToasterOptions
}
export interface RemixUiToasterOptions {
export interface ToasterOptions {
time: number
}
export const RemixUiToaster = (props: RemixUiToasterProps) => {
export const Toaster = (props: ToasterProps) => {
const [state, setState] = useState({
timeOutId: null,
message: '',
@ -51,7 +51,7 @@ export const RemixUiToaster = (props: RemixUiToasterProps) => {
}
function showFullMessage () {
alert(state.message)
// alert(state.message)
}
function closeTheToaster () {
@ -60,7 +60,7 @@ export const RemixUiToaster = (props: RemixUiToasterProps) => {
// out()
const animate = state.timeOutId ? (state.hiding ? 'remixui_animateBottom' : 'remixui_animateTop') : ''
const hide = state.timeOutId
// const hide = state.timeOutId
const className = `remixui_tooltip alert alert-info p-2 ${animate}`
return (
<div data-shared="tooltipPopup" className={className} onMouseEnter={() => { }} onMouseLeave={() => { }}>
@ -77,9 +77,9 @@ export const RemixUiToaster = (props: RemixUiToasterProps) => {
// animation(this.tooltip, css.animateBottom.className)
};
export default RemixUiToaster;
export default Toaster;
const defaultOptions = (opts) : RemixUiToasterOptions => {
const defaultOptions = (opts) : ToasterOptions => {
opts = opts || {}
return {
time: opts.time || 7000
Loading…
Cancel
Save