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:
parent
6ecd92de0b
commit
048766884d
4 changed files with 12 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
@use '@/scss/underscore' as _;
|
||||
|
||||
.banner {
|
||||
@include _.z-index(modal);
|
||||
@include _.z-index(front);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
.fullScreen {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 100;
|
||||
|
||||
&:focus-visible {
|
||||
outline: none;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue