Fix buttons and z-index (#1438)

* Fix buttons

* Remove useless code
This commit is contained in:
Charles Bochet 2023-09-04 17:52:03 +02:00 committed by GitHub
parent 2eac5df05b
commit d04c661ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 28 deletions

View File

@ -39,7 +39,6 @@ export function DeleteAccount() {
<Button <Button
accent="danger" accent="danger"
size="small"
onClick={() => setIsDeleteAccountModalOpen(true)} onClick={() => setIsDeleteAccountModalOpen(true)}
variant="secondary" variant="secondary"
title="Delete account" title="Delete account"

View File

@ -56,10 +56,6 @@ const StyledDropdownButton = styled.div<StyledDropdownButtonProps>`
} }
`; `;
const StyledDropdownMenuContainer = styled(DropdownMenuContainer)`
z-index: 2;
`;
function DropdownButton({ function DropdownButton({
anchor, anchor,
label, label,
@ -101,9 +97,9 @@ function DropdownButton({
{label} {label}
</StyledDropdownButton> </StyledDropdownButton>
{isUnfolded && ( {isUnfolded && (
<StyledDropdownMenuContainer anchor={anchor} onClose={onOutsideClick}> <DropdownMenuContainer anchor={anchor} onClose={onOutsideClick}>
{children} {children}
</StyledDropdownMenuContainer> </DropdownMenuContainer>
)} )}
</StyledDropdownButtonContainer> </StyledDropdownButtonContainer>
); );

View File

@ -25,7 +25,6 @@ const StyledDropdownButtonContainer = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
z-index: 1;
`; `;
export function SingleEntityFilterDropdownButton({ export function SingleEntityFilterDropdownButton({

View File

@ -37,6 +37,7 @@ const StyledBar = styled.div`
flex-direction: row; flex-direction: row;
height: 40px; height: 40px;
justify-content: space-between; justify-content: space-between;
z-index: 4;
`; `;
const StyledChipcontainer = styled.div` const StyledChipcontainer = styled.div`
@ -93,6 +94,10 @@ const StyledSeperator = styled.div`
width: 1px; width: 1px;
`; `;
const StyledAddFilterContainer = styled.div`
z-index: 5;
`;
function SortAndFilterBar<SortField>({ function SortAndFilterBar<SortField>({
canToggle, canToggle,
context, context,
@ -189,13 +194,15 @@ function SortAndFilterBar<SortField>({
})} })}
</StyledChipcontainer> </StyledChipcontainer>
{hasFilterButton && ( {hasFilterButton && (
<FilterDropdownButton <StyledAddFilterContainer>
context={context} <FilterDropdownButton
HotkeyScope={FiltersHotkeyScope.FilterDropdownButton} context={context}
color={theme.font.color.tertiary} HotkeyScope={FiltersHotkeyScope.FilterDropdownButton}
icon={<IconPlus size={theme.icon.size.md} />} color={theme.font.color.tertiary}
label="Add filter" icon={<IconPlus size={theme.icon.size.md} />}
/> label="Add filter"
/>
</StyledAddFilterContainer>
)} )}
</StyledFilterContainer> </StyledFilterContainer>
{filters.length + sorts.length > 0 && ( {filters.length + sorts.length > 0 && (

View File

@ -99,6 +99,7 @@ export function PageHeader({
<StyledBackIconButton <StyledBackIconButton
icon={<IconChevronLeft size={iconSize} />} icon={<IconChevronLeft size={iconSize} />}
onClick={navigateBack} onClick={navigateBack}
variant="tertiary"
/> />
</StyledTopBarButtonContainer> </StyledTopBarButtonContainer>
)} )}

View File

@ -43,7 +43,6 @@ const StyledTable = styled.table`
border-right-color: transparent; border-right-color: transparent;
} }
:last-of-type { :last-of-type {
min-width: fit-content;
width: 100%; width: 100%;
} }
} }
@ -63,10 +62,6 @@ const StyledTable = styled.table`
border-left-color: transparent; border-left-color: transparent;
border-right-color: transparent; border-right-color: transparent;
} }
:last-of-type {
min-width: fit-content;
width: 100%;
}
} }
`; `;

View File

@ -198,8 +198,10 @@ export function EntityTableHeader() {
<StyledAddIconButtonWrapper> <StyledAddIconButtonWrapper>
<IconButton <IconButton
size="medium" size="medium"
variant="tertiary"
icon={<IconPlus />} icon={<IconPlus />}
onClick={toggleColumnMenu} onClick={toggleColumnMenu}
position="middle"
/> />
{isColumnMenuOpen && ( {isColumnMenuOpen && (
<StyledEntityTableColumnMenu <StyledEntityTableColumnMenu

View File

@ -36,10 +36,6 @@ const StyledContainer = styled.div`
position: relative; position: relative;
`; `;
const StyledDropdownMenuContainer = styled(DropdownMenuContainer)`
z-index: 1;
`;
type TableUpdateViewButtonGroupProps = { type TableUpdateViewButtonGroupProps = {
onViewSubmit?: () => void; onViewSubmit?: () => void;
HotkeyScope: string; HotkeyScope: string;
@ -139,7 +135,7 @@ export const TableUpdateViewButtonGroup = ({
return ( return (
<StyledContainer> <StyledContainer>
<ButtonGroup size="small"> <ButtonGroup size="small" accent="blue">
<Button <Button
title="Update view" title="Update view"
disabled={ disabled={
@ -156,14 +152,14 @@ export const TableUpdateViewButtonGroup = ({
</ButtonGroup> </ButtonGroup>
{isDropdownOpen && ( {isDropdownOpen && (
<StyledDropdownMenuContainer onClose={handleDropdownClose}> <DropdownMenuContainer onClose={handleDropdownClose}>
<StyledDropdownMenuItemsContainer> <StyledDropdownMenuItemsContainer>
<DropdownMenuItem onClick={handleCreateViewButtonClick}> <DropdownMenuItem onClick={handleCreateViewButtonClick}>
<IconPlus size={theme.icon.size.md} /> <IconPlus size={theme.icon.size.md} />
Create view Create view
</DropdownMenuItem> </DropdownMenuItem>
</StyledDropdownMenuItemsContainer> </StyledDropdownMenuItemsContainer>
</StyledDropdownMenuContainer> </DropdownMenuContainer>
)} )}
</StyledContainer> </StyledContainer>
); );

View File

@ -26,6 +26,7 @@ const StyledTopBar = styled.div<{ displayBottomBorder: boolean }>`
justify-content: space-between; justify-content: space-between;
padding-left: ${({ theme }) => theme.spacing(3)}; padding-left: ${({ theme }) => theme.spacing(3)};
padding-right: ${({ theme }) => theme.spacing(2)}; padding-right: ${({ theme }) => theme.spacing(2)};
z-index: 5;
`; `;
const StyledLeftSection = styled.div` const StyledLeftSection = styled.div`

View File

@ -33,7 +33,8 @@ export function WorkspaceInviteLink({ inviteLink }: OwnProps) {
</StyledLinkContainer> </StyledLinkContainer>
<Button <Button
icon={<IconLink size={theme.icon.size.md} />} icon={<IconLink size={theme.icon.size.md} />}
variant={'primary'} variant="primary"
accent="blue"
title="Copy link" title="Copy link"
onClick={() => { onClick={() => {
enqueueSnackBar('Link copied to clipboard', { enqueueSnackBar('Link copied to clipboard', {