-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Card] Fix CardOverflow in nested cards (#39668)
- Loading branch information
1 parent
191c3d8
commit e74a4f5
Showing
4 changed files
with
161 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import * as React from 'react'; | ||
import Card from '@mui/joy/Card'; | ||
import CardContent from '@mui/joy/CardContent'; | ||
import Divider from '@mui/joy/Divider'; | ||
import CardOverflow from '@mui/joy/CardOverflow'; | ||
import Typography from '@mui/joy/Typography'; | ||
import BallotIcon from '@mui/icons-material/Ballot'; | ||
import CommentOutlinedIcon from '@mui/icons-material/CommentOutlined'; | ||
import InboxOutlinedIcon from '@mui/icons-material/InboxOutlined'; | ||
import { AspectRatio } from '@mui/joy'; | ||
|
||
export default function NestedCard() { | ||
return ( | ||
<Card sx={{ borderRadius: 0, width: 300, maxWidth: '100%' }}> | ||
<CardContent> | ||
<Typography level="body-xs">IN DESIGN</Typography> | ||
<Typography level="title-lg">AFSL Web App</Typography> | ||
</CardContent> | ||
<Card | ||
orientation="horizontal" | ||
size="sm" | ||
sx={{ bgcolor: 'background.surface', borderRadius: 0, mb: 1 }} | ||
> | ||
<CardOverflow> | ||
<AspectRatio | ||
ratio="1" | ||
sx={{ minWidth: 70, '& img[data-first-child]': { p: 1.5 } }} | ||
> | ||
<img src="https://uilogos.co/img/logomark/lighting.png" alt="" /> | ||
</AspectRatio> | ||
</CardOverflow> | ||
<CardContent> | ||
<Typography level="title-md">Sub project</Typography> | ||
<Typography level="body-sm">Next review in 17 days</Typography> | ||
</CardContent> | ||
</Card> | ||
<CardOverflow | ||
variant="soft" | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: 1, | ||
justifyContent: 'space-around', | ||
py: 1, | ||
borderTop: '1px solid', | ||
borderColor: 'divider', | ||
}} | ||
> | ||
<Typography startDecorator={<BallotIcon color="danger" />} level="title-sm"> | ||
13 | ||
</Typography> | ||
<Divider orientation="vertical" /> | ||
<Typography startDecorator={<CommentOutlinedIcon />} level="title-sm"> | ||
9 | ||
</Typography> | ||
<Divider orientation="vertical" /> | ||
<Typography startDecorator={<InboxOutlinedIcon />} level="title-sm"> | ||
32 | ||
</Typography> | ||
</CardOverflow> | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import * as React from 'react'; | ||
import Card from '@mui/joy/Card'; | ||
import CardContent from '@mui/joy/CardContent'; | ||
import Divider from '@mui/joy/Divider'; | ||
import CardOverflow from '@mui/joy/CardOverflow'; | ||
import Typography from '@mui/joy/Typography'; | ||
import BallotIcon from '@mui/icons-material/Ballot'; | ||
import CommentOutlinedIcon from '@mui/icons-material/CommentOutlined'; | ||
import InboxOutlinedIcon from '@mui/icons-material/InboxOutlined'; | ||
import { AspectRatio } from '@mui/joy'; | ||
|
||
export default function NestedCard() { | ||
return ( | ||
<Card sx={{ borderRadius: 0, width: 300, maxWidth: '100%' }}> | ||
<CardContent> | ||
<Typography level="body-xs">IN DESIGN</Typography> | ||
<Typography level="title-lg">AFSL Web App</Typography> | ||
</CardContent> | ||
<Card | ||
orientation="horizontal" | ||
size="sm" | ||
sx={{ bgcolor: 'background.surface', borderRadius: 0, mb: 1 }} | ||
> | ||
<CardOverflow> | ||
<AspectRatio | ||
ratio="1" | ||
sx={{ minWidth: 70, '& img[data-first-child]': { p: 1.5 } }} | ||
> | ||
<img src="https://uilogos.co/img/logomark/lighting.png" alt="" /> | ||
</AspectRatio> | ||
</CardOverflow> | ||
<CardContent> | ||
<Typography level="title-md">Sub project</Typography> | ||
<Typography level="body-sm">Next review in 17 days</Typography> | ||
</CardContent> | ||
</Card> | ||
<CardOverflow | ||
variant="soft" | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: 1, | ||
justifyContent: 'space-around', | ||
py: 1, | ||
borderTop: '1px solid', | ||
borderColor: 'divider', | ||
}} | ||
> | ||
<Typography startDecorator={<BallotIcon color="danger" />} level="title-sm"> | ||
13 | ||
</Typography> | ||
<Divider orientation="vertical" /> | ||
<Typography startDecorator={<CommentOutlinedIcon />} level="title-sm"> | ||
9 | ||
</Typography> | ||
<Divider orientation="vertical" /> | ||
<Typography startDecorator={<InboxOutlinedIcon />} level="title-sm"> | ||
32 | ||
</Typography> | ||
</CardOverflow> | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters