fix: fix dropdown buttons z-index (#1431)

Closes #1430, Closes #1422
This commit is contained in:
Thaïs
2023-09-04 16:51:12 +02:00
committed by GitHub
parent 96a0f30e98
commit 8e22ffd021
7 changed files with 40 additions and 22 deletions

View File

@ -1,4 +1,4 @@
import { ReactNode, useCallback } from 'react';
import { type ComponentProps, type ReactNode, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import styled from '@emotion/styled';
import { useRecoilValue } from 'recoil';
@ -63,14 +63,20 @@ const StyledPageActionContainer = styled.div`
gap: ${({ theme }) => theme.spacing(2)};
`;
type OwnProps = {
type OwnProps = ComponentProps<'div'> & {
title: string;
hasBackButton?: boolean;
icon: ReactNode;
children?: JSX.Element | JSX.Element[];
};
export function PageHeader({ title, hasBackButton, icon, children }: OwnProps) {
export function PageHeader({
title,
hasBackButton,
icon,
children,
...props
}: OwnProps) {
const navigate = useNavigate();
const navigateBack = useCallback(() => navigate(-1), [navigate]);
@ -81,7 +87,7 @@ export function PageHeader({ title, hasBackButton, icon, children }: OwnProps) {
: navbarIconSize.desktop;
return (
<StyledTopBarContainer>
<StyledTopBarContainer {...props}>
<StyledLeftContainer>
{!isNavbarOpened && (
<StyledTopBarButtonContainer>