Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use icon component for unknown icon in table #594

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions src/lib/components/tablev2/Tablestyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from './TableUtils';
import { HeaderGroup } from 'react-table';
import { Icon } from '../icon/Icon.component';
import { BasicText } from '../text/Text.component';

const borderSize = '4px';
export const SortIncentive = styled.span`
Expand Down Expand Up @@ -153,10 +152,7 @@ export const TooltipContent = styled.div`
font-weight: bold;
min-width: 60px;
`;
export const UnknownIcon = styled.i`
// Increase the height so that the users don't need to hover precisely on the hyphen.
height: 70%;
`;

export const NoResult = styled.div`
display: flex;
justify-content: center;
Expand Down
9 changes: 6 additions & 3 deletions src/lib/components/tablev2/Tablev2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ import { MultiSelectableContent } from './MultiSelectableContent';
import { TableSearch as Search } from './Search';
import { SearchWithQueryParams } from './SearchWithQueryParams';
import { SingleSelectableContent } from './SingleSelectableContent';
import { TableWrapper, TooltipContent, UnknownIcon } from './Tablestyle';
import { TableWrapper, TooltipContent } from './Tablestyle';
import { compareHealth, TableHeightKeyType } from './TableUtils';
import { useCheckbox } from './useCheckbox';
import { Icon } from '../icon/Icon.component';

type UpdateTableData<
DATA_ROW extends Record<string, unknown> = Record<string, unknown>,
Expand Down Expand Up @@ -111,15 +112,17 @@ export const useTableContext = <

export const EmptyCell = ({
tooltipContent,
mr = 4,
}: {
tooltipContent?: string | JSX.Element;
mr?: number;
}) => {
return (
<Box mr={4}>
<Box mr={mr}>
<Tooltip
overlay={<TooltipContent>{tooltipContent || 'unknown'}</TooltipContent>}
>
<UnknownIcon className="fas fa-minus"></UnknownIcon>
<Icon name="Minus" />
</Tooltip>
</Box>
);
Expand Down