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,
|
||||
} from 'react';
|
||||
import { Tooltip } from '@mui/material';
|
||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
import { AnnouncerContext } from 'component/common/Announcer/AnnouncerContext/AnnouncerContext';
|
||||
import {
|
||||
StyledButton,
|
||||
@ -114,42 +113,40 @@ export const CellSortable: FC<ICellSortableProps> = ({
|
||||
isFlexGrow={isFlexGrow}
|
||||
isSortable={isSortable}
|
||||
>
|
||||
<ConditionallyRender
|
||||
condition={isSortable}
|
||||
show={
|
||||
<Tooltip title={tooltipTitle} arrow>
|
||||
<StyledButton
|
||||
isSorted={isSorted}
|
||||
type='button'
|
||||
onClick={onSortClick}
|
||||
{isSortable ? (
|
||||
<Tooltip title={tooltipTitle} arrow>
|
||||
<StyledButton
|
||||
isSorted={isSorted}
|
||||
type='button'
|
||||
onClick={onSortClick}
|
||||
>
|
||||
<StyledHiddenMeasurementLayer
|
||||
style={alignStyle}
|
||||
aria-hidden
|
||||
>
|
||||
<StyledHiddenMeasurementLayer
|
||||
style={alignStyle}
|
||||
aria-hidden
|
||||
>
|
||||
<StyledLabel tabIndex={-1} data-text={children}>
|
||||
{children}
|
||||
</StyledLabel>
|
||||
<SortArrow
|
||||
isSorted={isSorted}
|
||||
isDesc={isDescending}
|
||||
/>
|
||||
</StyledHiddenMeasurementLayer>
|
||||
<StyledVisibleAbsoluteLayer style={alignStyle}>
|
||||
<span ref={ref} tabIndex={-1}>
|
||||
<span>{children}</span>
|
||||
</span>
|
||||
<SortArrow
|
||||
isSorted={isSorted}
|
||||
isDesc={isDescending}
|
||||
className='sort-arrow'
|
||||
/>
|
||||
</StyledVisibleAbsoluteLayer>
|
||||
</StyledButton>
|
||||
</Tooltip>
|
||||
}
|
||||
elseShow={<div style={alignStyle}>{children}</div>}
|
||||
/>
|
||||
<StyledLabel tabIndex={-1} data-text={children}>
|
||||
{children}
|
||||
</StyledLabel>
|
||||
<SortArrow
|
||||
isSorted={isSorted}
|
||||
isDesc={isDescending}
|
||||
/>
|
||||
</StyledHiddenMeasurementLayer>
|
||||
<StyledVisibleAbsoluteLayer style={alignStyle}>
|
||||
<span ref={ref} tabIndex={-1}>
|
||||
<span>{children}</span>
|
||||
</span>
|
||||
<SortArrow
|
||||
isSorted={isSorted}
|
||||
isDesc={isDescending}
|
||||
className='sort-arrow'
|
||||
/>
|
||||
</StyledVisibleAbsoluteLayer>
|
||||
</StyledButton>
|
||||
</Tooltip>
|
||||
) : (
|
||||
<div style={alignStyle}>{children}</div>
|
||||
)}
|
||||
</StyledTableCell>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user