Add UpdateToast for testing
This commit is contained in:
parent
dca5a541a3
commit
6ec5bc3230
2 changed files with 14 additions and 5 deletions
|
|
@ -1,6 +1,9 @@
|
|||
import type { ReactElement } from 'react'
|
||||
import TopHeader from '~components/Header'
|
||||
import Toast from '~components/Toast'
|
||||
import UpdateToast from '~components/UpdateToast'
|
||||
|
||||
import './index.scss'
|
||||
interface Props {
|
||||
children: ReactElement
|
||||
}
|
||||
|
|
@ -9,6 +12,7 @@ const Layout = ({ children }: Props) => {
|
|||
return (
|
||||
<>
|
||||
<TopHeader />
|
||||
<UpdateToast open={true} updateType="feature" />
|
||||
<main>{children}</main>
|
||||
</>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,10 +7,13 @@ import Toast from '~components/Toast'
|
|||
import './index.scss'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
||||
interface Props {}
|
||||
interface Props {
|
||||
open: boolean
|
||||
updateType: 'feature' | 'content'
|
||||
}
|
||||
|
||||
const UpdateToast = (props: Props) => {
|
||||
const { t } = useTranslation('updates')
|
||||
const { t } = useTranslation('roadmap')
|
||||
|
||||
const classes = classNames({
|
||||
Update: true,
|
||||
|
|
@ -19,10 +22,12 @@ const UpdateToast = (props: Props) => {
|
|||
return (
|
||||
<Toast
|
||||
className={classes}
|
||||
title={t('updates.latest.title')}
|
||||
content={t('updates.latest.content')}
|
||||
title={t(`toasts.title`)}
|
||||
content={t(`toasts.description.${props.updateType}`)}
|
||||
open={true}
|
||||
type="background"
|
||||
>
|
||||
<Button buttonSize="small" contained={true} text="" />
|
||||
<Button buttonSize="small" contained={true} text={t('toasts.button')} />
|
||||
</Toast>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue