Rename component

pull/693/head
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 VmDebuggerHead from './vm-debugger/vm-debugger-head'
import { TransactionDebugger as Debugger } from '@remix-project/remix-debug' import { TransactionDebugger as Debugger } from '@remix-project/remix-debug'
import { DebuggerUIProps } from './DebuggerAPI' import { DebuggerUIProps } from './DebuggerAPI'
import { RemixUiToaster } from '@remix-ui/toaster' import { Toaster } from '@remix-ui/toaster'
/* eslint-disable-next-line */ /* eslint-disable-next-line */
import './debugger-ui.css' import './debugger-ui.css'
@ -209,7 +209,7 @@ const vmDebugger = {
} }
return ( return (
<div> <div>
<RemixUiToaster message={state.toastMessage} /> <Toaster message={state.toastMessage} />
<div className="px-2"> <div className="px-2">
<div className="mt-3"> <div className="mt-3">
<p className="mt-2 debuggerLabel">Debugger Configuration</p> <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 React, { useEffect, useState } from 'react'
import './remix-ui-toaster.css'; import './toaster.css';
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface RemixUiToasterProps { export interface ToasterProps {
message: any message: any
opts?: RemixUiToasterOptions opts?: ToasterOptions
} }
export interface RemixUiToasterOptions { export interface ToasterOptions {
time: number time: number
} }
export const RemixUiToaster = (props: RemixUiToasterProps) => { export const Toaster = (props: ToasterProps) => {
const [state, setState] = useState({ const [state, setState] = useState({
timeOutId: null, timeOutId: null,
message: '', message: '',
@ -51,7 +51,7 @@ export const RemixUiToaster = (props: RemixUiToasterProps) => {
} }
function showFullMessage () { function showFullMessage () {
alert(state.message) // alert(state.message)
} }
function closeTheToaster () { function closeTheToaster () {
@ -60,7 +60,7 @@ export const RemixUiToaster = (props: RemixUiToasterProps) => {
// out() // out()
const animate = state.timeOutId ? (state.hiding ? 'remixui_animateBottom' : 'remixui_animateTop') : '' 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}` const className = `remixui_tooltip alert alert-info p-2 ${animate}`
return ( return (
<div data-shared="tooltipPopup" className={className} onMouseEnter={() => { }} onMouseLeave={() => { }}> <div data-shared="tooltipPopup" className={className} onMouseEnter={() => { }} onMouseLeave={() => { }}>
@ -77,9 +77,9 @@ export const RemixUiToaster = (props: RemixUiToasterProps) => {
// animation(this.tooltip, css.animateBottom.className) // animation(this.tooltip, css.animateBottom.className)
}; };
export default RemixUiToaster; export default Toaster;
const defaultOptions = (opts) : RemixUiToasterOptions => { const defaultOptions = (opts) : ToasterOptions => {
opts = opts || {} opts = opts || {}
return { return {
time: opts.time || 7000 time: opts.time || 7000
Loading…
Cancel
Save