Skip to content

Commit

Permalink
feat(Frontend): Add toast
Browse files Browse the repository at this point in the history
  • Loading branch information
talhabalaj committed Mar 9, 2022
1 parent 8f63e1b commit 03e59e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions apps/frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { AppProps } from 'next/app'
import Head from 'next/head'
import './global.scss'
import 'react-toastify/dist/ReactToastify.css'
import AuthStoreProvider from '@modules/auth/store/auth-store'
import MeStoreProvider from '@modules/auth/store/me-store'
import { ToastContainer } from 'react-toastify'

function CustomApp({ Component, pageProps }: AppProps) {
return (
Expand Down Expand Up @@ -36,6 +38,7 @@ function CustomApp({ Component, pageProps }: AppProps) {
</MeStoreProvider>
</AuthStoreProvider>
</main>
<ToastContainer hideProgressBar position='bottom-right' className={"font-sans"} toastClassName={"rounded-xl p-4"} />
</div>
</>
)
Expand Down
21 changes: 13 additions & 8 deletions apps/frontend/pages/test.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import Button from '@components/primitives/button'
import ScreenCenter from '@components/primitives/screen-center'
import { useRef } from 'react'
import { toast } from 'react-toastify'


export default function Test() {
const count = useRef(0)

return (
<ScreenCenter>
{/* <Select value={'test4'} onChange={value => value}>
<Select.Option value={'test'}> Test</Select.Option>
<Select.Option value={'test2'}> Test</Select.Option>
<Select.Option value={'test3'}> Test</Select.Option>
<Select.Option value={'test4'}> Test</Select.Option>
<Select.Option value={'test5'}> Test</Select.Option>
<Select.Option value={'test6'}> Test</Select.Option>
</Select> */}
<Button
onClick={() => {
toast.error("Hello world!")
}}
>
Show toast
</Button>
</ScreenCenter>
)
}

0 comments on commit 03e59e9

Please sign in to comment.