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
accent="danger"
size="small"
onClick={() => setIsDeleteAccountModalOpen(true)}
variant="secondary"
title="Delete account"

View File

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

View File

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

View File

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

View File

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

View File

@ -43,7 +43,6 @@ const StyledTable = styled.table`
border-right-color: transparent;
}
:last-of-type {
min-width: fit-content;
width: 100%;
}
}
@ -63,10 +62,6 @@ const StyledTable = styled.table`
border-left-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>
<IconButton
size="medium"
variant="tertiary"
icon={<IconPlus />}
onClick={toggleColumnMenu}
position="middle"
/>
{isColumnMenuOpen && (
<StyledEntityTableColumnMenu

View File

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

View File

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

View File

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