-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(research): author card component created
- Loading branch information
1 parent
b512321
commit 099a5ac
Showing
7 changed files
with
123 additions
and
55 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Author } from '@/types'; | ||
import { Card, theme, Typography, Space, Image, Grid } from 'antd'; | ||
import { EllipsisConfig } from 'antd/es/typography/Base'; | ||
|
||
const { useToken } = theme; | ||
const { Link: AntLink, Text, Paragraph } = Typography; | ||
const { useBreakpoint } = Grid; | ||
|
||
interface AuthorCardProps extends Author {} | ||
|
||
const AuthorCard: React.FC<AuthorCardProps> = ({ | ||
title, | ||
profilePicture, | ||
description, | ||
name, | ||
}) => { | ||
const { | ||
token: { fontSizeSM, fontSizeLG, colorBgLayout, fontSize }, | ||
} = useToken(); | ||
const { sm } = useBreakpoint(); | ||
return ( | ||
<Card | ||
style={{ | ||
width: '100%', | ||
}} | ||
bordered | ||
headStyle={{ | ||
backgroundColor: colorBgLayout, | ||
fontSize: fontSize, | ||
}} | ||
bodyStyle={{ | ||
padding: '16px 24px 16px 24px', | ||
}} | ||
title={name} | ||
> | ||
<Space direction="horizontal" size={24} align="start"> | ||
<Space direction="vertical" size={8}> | ||
<Paragraph | ||
type="secondary" | ||
ellipsis={ | ||
{ rows: 4, expandable: true, symbol: 'more' } as EllipsisConfig | ||
} | ||
style={{ | ||
fontSize: fontSizeLG, | ||
margin: 0, | ||
}} | ||
> | ||
{description} | ||
</Paragraph> | ||
</Space> | ||
{sm && ( | ||
<div | ||
style={{ | ||
width: 137, | ||
}} | ||
> | ||
<Image | ||
style={{ | ||
objectFit: 'cover', | ||
}} | ||
preview={false} | ||
src={profilePicture.url} | ||
alt={profilePicture.title ?? name} | ||
/> | ||
</div> | ||
)} | ||
</Space> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default AuthorCard; |
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 @@ | ||
export { default as AuthorCard } from './AuthorCard'; |
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
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