mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-13 13:48:59 +02:00
refactor: remove conditionally render
This commit is contained in:
parent
8089e366b8
commit
607700b932
@ -9,7 +9,6 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { Tooltip } from '@mui/material';
|
import { Tooltip } from '@mui/material';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
||||||
import { AnnouncerContext } from 'component/common/Announcer/AnnouncerContext/AnnouncerContext';
|
import { AnnouncerContext } from 'component/common/Announcer/AnnouncerContext/AnnouncerContext';
|
||||||
import {
|
import {
|
||||||
StyledButton,
|
StyledButton,
|
||||||
@ -114,9 +113,7 @@ export const CellSortable: FC<ICellSortableProps> = ({
|
|||||||
isFlexGrow={isFlexGrow}
|
isFlexGrow={isFlexGrow}
|
||||||
isSortable={isSortable}
|
isSortable={isSortable}
|
||||||
>
|
>
|
||||||
<ConditionallyRender
|
{isSortable ? (
|
||||||
condition={isSortable}
|
|
||||||
show={
|
|
||||||
<Tooltip title={tooltipTitle} arrow>
|
<Tooltip title={tooltipTitle} arrow>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
isSorted={isSorted}
|
isSorted={isSorted}
|
||||||
@ -147,9 +144,9 @@ export const CellSortable: FC<ICellSortableProps> = ({
|
|||||||
</StyledVisibleAbsoluteLayer>
|
</StyledVisibleAbsoluteLayer>
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
}
|
) : (
|
||||||
elseShow={<div style={alignStyle}>{children}</div>}
|
<div style={alignStyle}>{children}</div>
|
||||||
/>
|
)}
|
||||||
</StyledTableCell>
|
</StyledTableCell>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user