Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
fixed toasts styles
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhipster committed Apr 2, 2020
1 parent 25a115b commit 7fc1763
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pmet-public/luma-ui",
"version": "1.0.1",
"version": "1.0.2",
"description": "Luma React UI LIbrary",
"repository": "https://github.com/PMET-public/luma-ui.git",
"author": "Carlos A. Cabrera @fnhhipster",
Expand Down
34 changes: 25 additions & 9 deletions src/components/App/App.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { storiesOf } from '@storybook/react'
import { boolean } from '@storybook/addon-knobs'
import { toast } from '../../lib'
import { action } from '@storybook/addon-actions'
import styled from 'styled-components'

export const AppMockData: AppProps = {
logo: {
Expand Down Expand Up @@ -74,17 +75,32 @@ export const AppMockData: AppProps = {
},
}

const Toast = styled.div`
display: grid;
grid-gap: 1rem;
& > button {
background-color: #fff;
border-radius: 2.4rem;
box-sizing: border-box;
color: #222;
cursor: pointer;
display: inline-flex;
font-weight: 800;
padding: 1rem 2.2rem;
place-content: center;
}
`

storiesOf('📦 Components/App', module).add('Default', () => {
toast.success('Success!')
toast.error('Error!')
toast.warn('Warning!')
toast.info(
<>
Info!{' '}
<button className="button" onClick={action('onClick')}>
Button
</button>
</>
<Toast>
🎉 A new update (x.x.x) is available.
<button onClick={action('onClick')}>Reload</button>
</Toast>,
{
autoClose: false,
}
)
return <App loading={boolean('loading', false)} {...AppMockData} />
})
19 changes: 4 additions & 15 deletions src/theme/ToastStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,12 @@ export const ToastsStyles = createGlobalStyle<{ $colors: typeof light | typeof d
z-index: 9999;
transform: translate3d(0, 0, 9999px);
position: fixed;
padding: 4px;
width: 400px;
box-sizing: border-box;
color: #fff;
& .button {
background-color: #fff;
border-radius: 2.4rem;
box-sizing: border-box;
color: #222;
cursor: pointer;
display: inline-flex;
font-weight: 800;
margin-left: 1rem;
padding: 1rem 2.2rem;
font-size: 0.8em;
}
padding: 4px;
min-width: 30rem;
max-width: 100%;
font-size: 1.4rem;
}
.Toastify__toast-container--top-left {
top: 1em;
Expand Down

0 comments on commit 7fc1763

Please sign in to comment.