Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): ensure unpublish confirmation is reachable when opened in drawers #10109

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/ui/src/elements/Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import { toast } from 'sonner'
import { useForm } from '../../forms/Form/context.js'
import { useConfig } from '../../providers/Config/index.js'
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
import { useEditDepth } from '../../providers/EditDepth/index.js'
import { useLocale } from '../../providers/Locale/index.js'
import { useTranslation } from '../../providers/Translation/index.js'
import { requests } from '../../utilities/api.js'
import { Button } from '../Button/index.js'
import { drawerZBase } from '../Drawer/index.js'
import './index.scss'

const baseClass = 'status'
Expand All @@ -36,6 +38,8 @@ export const Status: React.FC = () => {
const { code: locale } = useLocale()
const { i18n, t } = useTranslation()

const editDepth = useEditDepth()

const unPublishModalSlug = `confirm-un-publish-${id}`
const revertModalSlug = `confirm-revert-${id}`

Expand Down Expand Up @@ -159,7 +163,11 @@ export const Status: React.FC = () => {
>
{t('version:unpublish')}
</Button>
<Modal className={`${baseClass}__modal`} slug={unPublishModalSlug}>
<Modal
className={`${baseClass}__modal`}
slug={unPublishModalSlug}
style={{ zIndex: drawerZBase + editDepth }}
>
<div className={`${baseClass}__wrapper`}>
<div className={`${baseClass}__content`}>
<h1>{t('version:confirmUnpublish')}</h1>
Expand Down
Loading