Update list group headers styling
This commit is contained in:
@@ -7,20 +7,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography, { TypographyProps } from '@mui/material/Typography';
|
||||||
|
|
||||||
export const StyledGroupHeader = styled(Typography, { shouldForwardProp: (prop) => prop !== 'isFirstItem' })<{
|
export const StyledGroupHeader = styled(Typography, { shouldForwardProp: (prop) => prop !== 'isFirstItem' })<
|
||||||
isFirstItem: boolean;
|
{
|
||||||
}>(({ theme, isFirstItem }) => ({
|
isFirstItem: boolean;
|
||||||
paddingLeft: '24px',
|
} & TypographyProps
|
||||||
|
>(({ theme, isFirstItem }) => ({
|
||||||
|
paddingLeft: theme.spacing(3),
|
||||||
// 16px - 10px (bottom padding of the group items)
|
// 16px - 10px (bottom padding of the group items)
|
||||||
paddingTop: '6px',
|
paddingTop: theme.spacing(0.75),
|
||||||
paddingBottom: '16px',
|
paddingBottom: theme.spacing(2),
|
||||||
fontWeight: 700,
|
fontWeight: 'bold',
|
||||||
textTransform: 'uppercase',
|
|
||||||
backgroundColor: theme.palette.background.default,
|
backgroundColor: theme.palette.background.default,
|
||||||
[theme.breakpoints.down('sm')]: {
|
[theme.breakpoints.down('sm')]: {
|
||||||
// 16px - 8px (margin of header)
|
// 16px - 8px (margin of header)
|
||||||
paddingTop: isFirstItem ? '8px' : '6px',
|
paddingTop: isFirstItem ? theme.spacing(1) : theme.spacing(0.75),
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ export function Extensions({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
|||||||
const [groupName] = filteredGroupedExtensions[index];
|
const [groupName] = filteredGroupedExtensions[index];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledGroupHeader key={groupName} variant="h4" isFirstItem={index === 0}>
|
<StyledGroupHeader key={groupName} variant="h5" component="h2" isFirstItem={index === 0}>
|
||||||
{translateExtensionLanguage(groupName)}
|
{translateExtensionLanguage(groupName)}
|
||||||
</StyledGroupHeader>
|
</StyledGroupHeader>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -140,11 +140,12 @@ export function Sources() {
|
|||||||
<Fragment key={lang}>
|
<Fragment key={lang}>
|
||||||
<Typography
|
<Typography
|
||||||
key={lang}
|
key={lang}
|
||||||
variant="h4"
|
variant="h5"
|
||||||
style={{
|
component="h2"
|
||||||
paddingLeft: '24px',
|
sx={{
|
||||||
paddingTop: '6px',
|
paddingLeft: 3,
|
||||||
paddingBottom: '16px',
|
paddingTop: 1,
|
||||||
|
paddingBottom: 2,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export const Updates: React.FC = () => {
|
|||||||
endReached={loadMore}
|
endReached={loadMore}
|
||||||
groupCounts={groupCounts}
|
groupCounts={groupCounts}
|
||||||
groupContent={(index) => (
|
groupContent={(index) => (
|
||||||
<StyledGroupHeader variant="h5" isFirstItem={index === 0}>
|
<StyledGroupHeader variant="h5" component="h2" isFirstItem={index === 0}>
|
||||||
{groupedUpdates[index][0]}
|
{groupedUpdates[index][0]}
|
||||||
</StyledGroupHeader>
|
</StyledGroupHeader>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user