refactor: Umbenennung von latestDoc in long und latestDocLarge in large

This commit is contained in:
tekh 2025-07-09 16:26:34 +02:00
parent d5f38cff85
commit 7f01597ea1
2 changed files with 18 additions and 18 deletions

View File

@ -36,13 +36,13 @@ export type IDocItem = {
export function DocItem({
sx,
post,
latestDoc,
latestDocLarge,
long,
large,
...other
}: CardProps & {
post: IDocItem;
latestDoc: boolean;
latestDocLarge: boolean;
long: boolean;
large: boolean;
}) {
const renderAvatar = (
<Avatar
@ -53,7 +53,7 @@ export function DocItem({
zIndex: 9,
bottom: -24,
position: 'absolute',
...((latestDocLarge || latestDoc) && {
...((large || long) && {
top: 24,
}),
}}
@ -71,8 +71,8 @@ export function DocItem({
WebkitLineClamp: 2,
display: '-webkit-box',
WebkitBoxOrient: 'vertical',
...(latestDocLarge && { typography: 'h5', height: 60 }),
...((latestDocLarge || latestDoc) && {
...(large && { typography: 'h5', height: 60 }),
...((large || long) && {
color: 'common.white',
}),
}}
@ -101,7 +101,7 @@ export function DocItem({
key={_index}
sx={{
display: 'flex',
...((latestDocLarge || latestDoc) && {
...((large || long) && {
opacity: 0.64,
color: 'common.white',
}),
@ -136,7 +136,7 @@ export function DocItem({
sx={{
mb: 1,
color: 'text.disabled',
...((latestDocLarge || latestDoc) && {
...((large || long) && {
opacity: 0.48,
color: 'common.white',
}),
@ -157,7 +157,7 @@ export function DocItem({
bottom: -16,
position: 'absolute',
color: 'background.paper',
...((latestDocLarge || latestDoc) && { display: 'none' }),
...((large || long) && { display: 'none' }),
}}
/>
);
@ -168,7 +168,7 @@ export function DocItem({
sx={(theme) => ({
position: 'relative',
pt: 'calc(100% * 3 / 4)',
...((latestDocLarge || latestDoc) && {
...((large || long) && {
pt: 'calc(100% * 4 / 3)',
'&:after': {
top: 0,
@ -179,7 +179,7 @@ export function DocItem({
bgcolor: varAlpha(theme.palette.grey['900Channel'], 0.72),
},
}),
...(latestDocLarge && {
...(large && {
pt: {
xs: 'calc(100% * 4 / 3)',
sm: 'calc(100% * 3 / 4.66)',
@ -195,7 +195,7 @@ export function DocItem({
<Box
sx={(theme) => ({
p: theme.spacing(6, 3, 3, 3),
...((latestDocLarge || latestDoc) && {
...((large || long) && {
width: 1,
bottom: 0,
position: 'absolute',

View File

@ -146,19 +146,19 @@ export function DocSearchView({ posts }: Props) {
<Grid container spacing={3}>
{posts.map((post, index) => {
const latestDocLarge = index === 0;
const latestDoc = index === 1 || index === 2;
const large = false;
const long = false;
return (
<Grid
key={post.id}
size={{
xs: 12,
sm: latestDocLarge ? 12 : 6,
md: latestDocLarge ? 6 : 3,
sm: large ? 12 : 6,
md: large ? 6 : 3,
}}
>
<DocItem post={post} latestDoc={latestDoc} latestDocLarge={latestDocLarge} />
<DocItem post={post} long={long} large={large} />
</Grid>
);
})}