Skip to content

Commit

Permalink
Update column visibility button to include updated icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Vega committed Oct 7, 2024
1 parent 55b2a3b commit c743418
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/components/GenericTable/ColumnVisibilityButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import React, { ReactNode, useState } from "react";
import { IconButton } from "@mui/material";
import { IconButton, Stack, styled } from "@mui/material";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import { ReactComponent as TableColumnsIcon } from "../../assets/icons/table_columns_icon.svg";
import ColumnVisibilityPopper from "./ColumnVisibilityPopper";

const StyledIconButton = styled(IconButton)({
padding: 0,
paddingLeft: "3px",
});

const StyledExpandMoreIcon = styled(ExpandMoreIcon)({
color: "#000",
fontSize: "18px",
alignSelf: "flex-end",
});

type ColumnVisibilityModel = { [key: string]: boolean };

type Props<C extends { hideable?: boolean }> = {
Expand Down Expand Up @@ -44,13 +56,21 @@ const ColumnVisibilityButton = <C extends { hideable?: boolean }>({

return (
<>
<IconButton
<StyledIconButton
onClick={handleOpenPopper}
aria-label="Manage columns button"
data-testid="column-visibility-button"
disableTouchRipple
disableRipple
disableFocusRipple
>
{icon ?? <TableColumnsIcon />}
</IconButton>
{icon ?? (
<Stack direction="row">
<TableColumnsIcon />
<StyledExpandMoreIcon />
</Stack>
)}
</StyledIconButton>
<ColumnVisibilityPopper
anchorEl={anchorEl}
open={Boolean(anchorEl)}
Expand Down

0 comments on commit c743418

Please sign in to comment.