mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Merge pull request #929 from Unleash/fix/sortable-cell-style
fix: users table sort header styles
This commit is contained in:
		
						commit
						34c4747cd4
					
				@ -2,13 +2,10 @@ import { makeStyles } from '@material-ui/core/styles';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export const useStyles = makeStyles(theme => ({
 | 
					export const useStyles = makeStyles(theme => ({
 | 
				
			||||||
    tableCellHeaderSortable: {
 | 
					    tableCellHeaderSortable: {
 | 
				
			||||||
 | 
					        padding: 0,
 | 
				
			||||||
 | 
					        position: 'relative',
 | 
				
			||||||
        cursor: 'pointer',
 | 
					        cursor: 'pointer',
 | 
				
			||||||
        '&:hover': {
 | 
					        overflow: 'hidden',
 | 
				
			||||||
            backgroundColor: theme.v2.palette.grey[40],
 | 
					 | 
				
			||||||
            '& > svg': {
 | 
					 | 
				
			||||||
                color: theme.v2.palette.grey[90],
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        '& > svg': {
 | 
					        '& > svg': {
 | 
				
			||||||
            fontSize: theme.v2.fontSizes.headerIcon,
 | 
					            fontSize: theme.v2.fontSizes.headerIcon,
 | 
				
			||||||
            verticalAlign: 'middle',
 | 
					            verticalAlign: 'middle',
 | 
				
			||||||
@ -24,8 +21,22 @@ export const useStyles = makeStyles(theme => ({
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    sortButton: {
 | 
					    sortButton: {
 | 
				
			||||||
        all: 'unset',
 | 
					        all: 'unset',
 | 
				
			||||||
 | 
					        padding: theme.spacing(2),
 | 
				
			||||||
 | 
					        width: '100%',
 | 
				
			||||||
        '&:focus-visible, &:active': {
 | 
					        '&:focus-visible, &:active': {
 | 
				
			||||||
            outline: 'revert',
 | 
					            outline: 'revert',
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        display: 'flex',
 | 
				
			||||||
 | 
					        alignItems: 'center',
 | 
				
			||||||
 | 
					        '&:hover': {
 | 
				
			||||||
 | 
					            backgroundColor: theme.v2.palette.grey[40],
 | 
				
			||||||
 | 
					            '& > svg': {
 | 
				
			||||||
 | 
					                color: theme.v2.palette.grey[90],
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    icon: {
 | 
				
			||||||
 | 
					        marginLeft: theme.spacing(0.5),
 | 
				
			||||||
 | 
					        fontSize: theme.v2.fontSizes.headerIcon,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
}));
 | 
					}));
 | 
				
			||||||
 | 
				
			|||||||
@ -60,18 +60,33 @@ export const TableCellSortable = ({
 | 
				
			|||||||
        <TableCell aria-sort={ariaSort} className={cellClassName}>
 | 
					        <TableCell aria-sort={ariaSort} className={cellClassName}>
 | 
				
			||||||
            <button className={styles.sortButton} onClick={onSortClick}>
 | 
					            <button className={styles.sortButton} onClick={onSortClick}>
 | 
				
			||||||
                {children}
 | 
					                {children}
 | 
				
			||||||
            </button>
 | 
					 | 
				
			||||||
                <ConditionallyRender
 | 
					                <ConditionallyRender
 | 
				
			||||||
                    condition={sort.type === name}
 | 
					                    condition={sort.type === name}
 | 
				
			||||||
                    show={
 | 
					                    show={
 | 
				
			||||||
                        <ConditionallyRender
 | 
					                        <ConditionallyRender
 | 
				
			||||||
                            condition={Boolean(sort.desc)}
 | 
					                            condition={Boolean(sort.desc)}
 | 
				
			||||||
                        show={<KeyboardArrowDown />}
 | 
					                            show={
 | 
				
			||||||
                        elseShow={<KeyboardArrowUp />}
 | 
					                                <KeyboardArrowDown
 | 
				
			||||||
 | 
					                                    className={styles.icon}
 | 
				
			||||||
 | 
					                                    fontSize="inherit"
 | 
				
			||||||
                                />
 | 
					                                />
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                elseShow={<UnfoldMoreOutlined />}
 | 
					                            elseShow={
 | 
				
			||||||
 | 
					                                <KeyboardArrowUp
 | 
				
			||||||
 | 
					                                    className={styles.icon}
 | 
				
			||||||
 | 
					                                    fontSize="inherit"
 | 
				
			||||||
                                />
 | 
					                                />
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        />
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    elseShow={
 | 
				
			||||||
 | 
					                        <UnfoldMoreOutlined
 | 
				
			||||||
 | 
					                            className={styles.icon}
 | 
				
			||||||
 | 
					                            fontSize="inherit"
 | 
				
			||||||
 | 
					                        />
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
 | 
					            </button>
 | 
				
			||||||
        </TableCell>
 | 
					        </TableCell>
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user