wip(shared): Working on custom layout
This commit is contained in:
parent
f4ee97a626
commit
34c8a6b2a5
13 changed files with 357 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
import PageIcon from 'shared/components/icons/page'
|
||||
import { useTranslation } from 'next-i18next'
|
||||
|
||||
const PageOrientationPicker = ({ gist, updateGist }) => {
|
||||
const { t } = useTranslation(['workbench'])
|
||||
|
||||
return (
|
||||
<button className={`
|
||||
btn btn-primary flex flex-row gap-2 items-center
|
||||
hover:text-primary-content
|
||||
`}
|
||||
onClick={() => updateGist(
|
||||
['_state', 'layout', 'forPrinting', 'page', 'orientation'],
|
||||
gist._state?.layout?.forPrinting?.page?.orientation === 'portrait'
|
||||
? 'landscape'
|
||||
: 'portrait'
|
||||
)}
|
||||
>
|
||||
<span className={
|
||||
gist._state?.layout?.forPrinting?.page?.orientation === 'landscape'
|
||||
? 'rotate-90'
|
||||
: ''
|
||||
}><PageIcon /></span>
|
||||
<span>{t(`pageOrientation`)}</span>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
export default PageOrientationPicker
|
Loading…
Add table
Add a link
Reference in a new issue