diff --git a/libs/remix-ui/toaster/.eslintrc b/libs/remix-ui/toaster/.eslintrc index 4cbd2b99cf..b8666066e9 100644 --- a/libs/remix-ui/toaster/.eslintrc +++ b/libs/remix-ui/toaster/.eslintrc @@ -3,7 +3,7 @@ "browser": true, "es6": true }, - "extends": "../../.eslintrc", + "extends": "../../../.eslintrc", "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" diff --git a/libs/remix-ui/toaster/src/index.ts b/libs/remix-ui/toaster/src/index.ts index f252befc14..1db646761e 100644 --- a/libs/remix-ui/toaster/src/index.ts +++ b/libs/remix-ui/toaster/src/index.ts @@ -1 +1 @@ -export * from './lib/toaster'; +export * from './lib/toaster' diff --git a/libs/remix-ui/toaster/src/lib/toaster.tsx b/libs/remix-ui/toaster/src/lib/toaster.tsx index 35f279f971..f1117cc48c 100644 --- a/libs/remix-ui/toaster/src/lib/toaster.tsx +++ b/libs/remix-ui/toaster/src/lib/toaster.tsx @@ -1,6 +1,6 @@ -import React, { useEffect, useState } from 'react' +import React, { useEffect, useState } from 'react' // eslint-disable-line -import './toaster.css'; +import './toaster.css' /* eslint-disable-next-line */ export interface ToasterProps { @@ -32,7 +32,7 @@ export const Toaster = (props: ToasterProps) => { } }) }, opts.time) - } + } setState(prevState => { return { @@ -45,7 +45,7 @@ export const Toaster = (props: ToasterProps) => { }, [props.message]) const shortTooltipText = state.message.length > 201 ? state.message.substring(0, 200) + '...' : state.message - + function hide () { if (state.timeOutId) clearTimeout(state.timeOutId) } @@ -55,7 +55,7 @@ export const Toaster = (props: ToasterProps) => { } function closeTheToaster () { - hide() + hide() } // out() @@ -63,21 +63,20 @@ export const Toaster = (props: ToasterProps) => { // const hide = state.timeOutId const className = `remixui_tooltip alert alert-info p-2 ${animate}` return ( -
{ }} onMouseLeave={() => { }}> +
{ }} onMouseLeave={() => { }}> {shortTooltipText} - { state.message.length > 201 ? : ''} + { state.message.length > 201 ? : ''} - +
) - - // animation(this.tooltip, css.animateBottom.className) -}; + // animation(this.tooltip, css.animateBottom.className) +} -export default Toaster; +export default Toaster const defaultOptions = (opts) : ToasterOptions => { opts = opts || {}