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 type { ReactElement } from 'react'
|
||||||
import TopHeader from '~components/Header'
|
import TopHeader from '~components/Header'
|
||||||
|
import Toast from '~components/Toast'
|
||||||
|
import UpdateToast from '~components/UpdateToast'
|
||||||
|
|
||||||
|
import './index.scss'
|
||||||
interface Props {
|
interface Props {
|
||||||
children: ReactElement
|
children: ReactElement
|
||||||
}
|
}
|
||||||
|
|
@ -9,6 +12,7 @@ const Layout = ({ children }: Props) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TopHeader />
|
<TopHeader />
|
||||||
|
<UpdateToast open={true} updateType="feature" />
|
||||||
<main>{children}</main>
|
<main>{children}</main>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,13 @@ import Toast from '~components/Toast'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
interface Props {}
|
interface Props {
|
||||||
|
open: boolean
|
||||||
|
updateType: 'feature' | 'content'
|
||||||
|
}
|
||||||
|
|
||||||
const UpdateToast = (props: Props) => {
|
const UpdateToast = (props: Props) => {
|
||||||
const { t } = useTranslation('updates')
|
const { t } = useTranslation('roadmap')
|
||||||
|
|
||||||
const classes = classNames({
|
const classes = classNames({
|
||||||
Update: true,
|
Update: true,
|
||||||
|
|
@ -19,10 +22,12 @@ const UpdateToast = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<Toast
|
<Toast
|
||||||
className={classes}
|
className={classes}
|
||||||
title={t('updates.latest.title')}
|
title={t(`toasts.title`)}
|
||||||
content={t('updates.latest.content')}
|
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>
|
</Toast>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue