0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

refactor(console): set portal z-index properly (#5948)

This commit is contained in:
Gao Sun 2024-05-31 10:54:08 +08:00 committed by GitHub
parent 6ecd92de0b
commit 048766884d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 4 deletions

View file

@ -1,7 +1,7 @@
@use '@/scss/underscore' as _;
.banner {
@include _.z-index(modal);
@include _.z-index(front);
position: absolute;
left: 50%;
transform: translateX(-50%);

View file

@ -1,5 +1,6 @@
import { TenantTag } from '@logto/schemas';
import { useContext, useState } from 'react';
import { createPortal } from 'react-dom';
import { useTranslation } from 'react-i18next';
import { type TenantResponse } from '@/cloud/types/router';
@ -20,7 +21,7 @@ function CreateProductionTenantBanner() {
return null;
}
return (
return createPortal(
<div className={styles.banner}>
<CreateTenantModal
isOpen={isCreateModalOpen}
@ -40,7 +41,8 @@ function CreateProductionTenantBanner() {
>
{t('action')}
</TextLink>
</div>
</div>,
document.body
);
}

View file

@ -25,7 +25,6 @@
.fullScreen {
position: fixed;
inset: 0;
z-index: 100;
&:focus-visible {
outline: none;

View file

@ -46,3 +46,10 @@ input {
height: 100%;
flex: 1;
}
.ReactModalPortal {
position: relative;
// Set `z-index` for the portal to ensure it can be placed on the right layer among other
// top-level doms.
@include _.z-index(modal);
}