Skip to content

Commit

Permalink
chore: remove scss reference
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Dec 10, 2024
1 parent 3d5182e commit 1f9bfa0
Showing 1 changed file with 11 additions and 48 deletions.
59 changes: 11 additions & 48 deletions playground/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ import { ToastCode, ToastCodeProps } from './ToastCode';
import { flags, positions, themes, transitions, typs } from './constants';

import React from 'react';
import '../../../scss/main.scss';
import { Id, ToastContainer, toast } from '../../../src/index';
import { Id, toast, ToastContainer } from '../../../src';
import { defaultProps } from '../../../src/components/ToastContainer';

// Attach to window. Can be useful to debug
// @ts-ignore
window.toast = toast;

// const animateCss = cssTransition({
// enter: 'animate__animated animate__bounceIn',
// exit: 'animate__animated animate__bounceOut'
// });

class App extends React.Component {
state = App.getDefaultState();
toastId: Id;
Expand Down Expand Up @@ -75,8 +69,7 @@ class App extends React.Component {
);
};

updateToast = () =>
toast.update(this.toastId, { progress: this.state.progress });
updateToast = () => toast.update(this.toastId, { progress: this.state.progress });

handleAutoCloseDelay = e =>
this.setState({
Expand All @@ -101,10 +94,7 @@ class App extends React.Component {

handleRadioOrSelect = e =>
this.setState({
[e.target.name]:
e.target.name === 'limit'
? parseInt(e.target.value, 10)
: e.target.value
[e.target.name]: e.target.name === 'limit' ? parseInt(e.target.value, 10) : e.target.value
});

toggleCheckbox = e =>
Expand All @@ -115,12 +105,7 @@ class App extends React.Component {
renderFlags() {
return flags.map(({ id, label }) => (
<li key={id}>
<Checkbox
id={id}
label={label}
onChange={this.toggleCheckbox}
checked={this.state[id]}
/>
<Checkbox id={id} label={label} onChange={this.toggleCheckbox} checked={this.state[id]} />
</li>
));
}
Expand All @@ -131,10 +116,9 @@ class App extends React.Component {
<Header />
<div className="container">
<p>
By default, all toasts will inherit ToastContainer's props. Props
defined on toast supersede ToastContainer's props. Props marked with
* can only be set on the ToastContainer. The demo is not exhaustive,
check the repo for more!
By default, all toasts will inherit ToastContainer's props. Props defined on toast supersede
ToastContainer's props. Props marked with * can only be set on the ToastContainer. The demo is not
exhaustive, check the repo for more!
</p>
<section className="container__options">
<div>
Expand All @@ -151,12 +135,7 @@ class App extends React.Component {
<div>
<h3>Type</h3>
<ul>
<Radio
options={typs}
name="type"
checked={this.state.type}
onChange={this.handleRadioOrSelect}
/>
<Radio options={typs} name="type" checked={this.state.type} onChange={this.handleRadioOrSelect} />
</ul>
</div>
<div>
Expand Down Expand Up @@ -191,12 +170,7 @@ class App extends React.Component {
</label>
<label htmlFor="theme">
Theme
<select
name="theme"
id="theme"
onChange={this.handleRadioOrSelect}
value={this.state.theme}
>
<select name="theme" id="theme" onChange={this.handleRadioOrSelect} value={this.state.theme}>
{themes.map(k => (
<option key={k} value={k}>
{k}
Expand Down Expand Up @@ -279,19 +253,8 @@ class App extends React.Component {
transition={transitions[this.state.transition]}
autoClose={this.state.disableAutoClose ? false : this.state.autoClose}
/>
<ToastContainer
containerId="xxx"
position="top-left"
autoClose={false}
theme="dark"
limit={3}
/>
<ToastContainer
limit={3}
containerId="yyy"
autoClose={false}
position="top-right"
/>
<ToastContainer containerId="xxx" position="top-left" autoClose={false} theme="dark" limit={3} />
<ToastContainer limit={3} containerId="yyy" autoClose={false} position="top-right" />
</main>
);
}
Expand Down

0 comments on commit 1f9bfa0

Please sign in to comment.