-
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.
- Loading branch information
Showing
29 changed files
with
303 additions
and
42 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
2 changes: 1 addition & 1 deletion
2
src/pages/book/components/BookContent/components/BookDescription/index.tsx
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
87 changes: 87 additions & 0 deletions
87
src/pages/book/components/BookContent/components/OwnerCard/index.tsx
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,87 @@ | ||
import { Avatar, Card, Typography, Button, Image, Divider } from "antd"; | ||
import { EnvironmentOutlined } from "@ant-design/icons"; | ||
import styles from "./styles.module.scss"; | ||
import { OwnerCardProps } from "../../../../../../types/user"; | ||
import { getMembershipTime } from "../../../../../../utils/date"; | ||
import { ExchangeInfoIcon } from "./svg-icons"; | ||
|
||
const { Text } = Typography; | ||
|
||
const mockOwnerData: OwnerCardProps = { | ||
name: "Евгения", | ||
avatar: "/mocks/mockAvatar.png", | ||
registrationDate: new Date("2023-08-09"), | ||
booksGiven: 17, | ||
booksExchanged: 21, | ||
gender: "female", | ||
location: "Санкт-Петербург, Озерки", | ||
isMessageAvailable: true, | ||
}; | ||
|
||
export const OwnerCard = () => { | ||
const { | ||
name, | ||
avatar, | ||
gender, | ||
location, | ||
isMessageAvailable, | ||
booksGiven, | ||
booksExchanged, | ||
} = mockOwnerData; | ||
|
||
const membershipTime = getMembershipTime(mockOwnerData.registrationDate); | ||
|
||
return ( | ||
<Card className={styles.card}> | ||
<div className={styles.header}> | ||
<Avatar size={50} src={avatar} /> | ||
<div className={styles.userInfo}> | ||
<Text className={styles.name}>{name}</Text> | ||
<Text className={styles.membershipTime}>{membershipTime}</Text> | ||
</div> | ||
</div> | ||
|
||
<div className={`${styles.detailsRow} ${styles.statsRow}`}> | ||
<div className={styles.iconWrapper}> | ||
<Image | ||
src="/statsIcon.png" | ||
preview={false} | ||
width={24} | ||
height={24} | ||
className={styles.statsIcon} | ||
/> | ||
</div> | ||
<Text className={styles.statsText}> | ||
Отдано {booksGiven} книг • Обменяно {booksExchanged} | ||
</Text> | ||
</div> | ||
|
||
<div className={styles.detailsRow}> | ||
<div className={styles.iconWrapper}> | ||
<ExchangeInfoIcon className={styles.exchangeInfoIcon} /> | ||
</div> | ||
<Text className={styles.exchangeInfoText}> | ||
{name} {gender === "female" ? "готова" : "готов"} обменять книгу на | ||
любую интересную | ||
</Text> | ||
</div> | ||
|
||
<div className={styles.detailsRow}> | ||
<div className={styles.iconWrapper}> | ||
<EnvironmentOutlined className={styles.locationIcon} /> | ||
</div> | ||
<Text className={styles.location}>{location}</Text> | ||
</div> | ||
|
||
<Divider className={styles.divider} /> | ||
|
||
<Button | ||
type="primary" | ||
className={styles.messageButton} | ||
disabled={!isMessageAvailable} | ||
> | ||
Написать | ||
</Button> | ||
</Card> | ||
); | ||
}; |
128 changes: 128 additions & 0 deletions
128
src/pages/book/components/BookContent/components/OwnerCard/styles.module.scss
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,128 @@ | ||
.card { | ||
width: 315px; | ||
border: 1px solid rgba(158, 158, 158, 0.2); | ||
box-shadow: 0px 0px 12px 5px rgba(66, 66, 66, 0.05); | ||
border-radius: 15px; | ||
padding: 15px; | ||
|
||
:global(.ant-card-body) { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 12px; | ||
|
||
&::before, | ||
&::after { | ||
display: none; | ||
} | ||
} | ||
} | ||
|
||
.header { | ||
display: flex; | ||
gap: 14px; | ||
} | ||
|
||
.userInfo { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: 2px; | ||
} | ||
|
||
.name { | ||
font-family: "Onest-Medium", sans-serif; | ||
font-size: 16px; | ||
line-height: 18px; | ||
font-weight: 500; | ||
color: var(--ant-color-text); | ||
} | ||
|
||
.membershipTime { | ||
font-family: "Onest-Regular", sans-serif; | ||
font-size: 14px; | ||
line-height: 16px; | ||
color: var(--ant-color-text-placeholder); | ||
} | ||
|
||
.detailsRow { | ||
display: flex; | ||
gap: 8px; | ||
|
||
.iconWrapper { | ||
display: flex; | ||
width: 24px; | ||
flex-shrink: 0; | ||
} | ||
} | ||
|
||
.statsRow { | ||
padding-bottom: 3px; | ||
align-items: flex-end; | ||
} | ||
|
||
.statsIcon { | ||
display: block; | ||
} | ||
|
||
.statsText { | ||
font-family: "Onest-Medium", sans-serif; | ||
font-size: 16px; | ||
line-height: 18px; | ||
font-weight: 500; | ||
color: var(--ant-color-text); | ||
} | ||
|
||
.exchangeInfoText { | ||
font-family: "Onest-Regular", sans-serif; | ||
font-size: 16px; | ||
line-height: 19px; | ||
color: var(--ant-color-text-placeholder); | ||
} | ||
|
||
.locationIcon { | ||
font-size: 18px; | ||
color: var(--ant-color-text-quaternary); | ||
} | ||
|
||
.location { | ||
font-family: "Onest-Regular", sans-serif; | ||
font-size: 14px; | ||
line-height: 18px; | ||
color: var(--ant-color-text-placeholder); | ||
} | ||
|
||
.divider { | ||
height: 1px; | ||
background-color: var(--ant-color-border-bg); | ||
width: 100%; | ||
|
||
&:global(.ant-divider-horizontal) { | ||
margin: 2px 0; | ||
} | ||
} | ||
|
||
.messageButton { | ||
width: 100%; | ||
height: 42px; | ||
border-radius: 9px; | ||
font-family: "Onest-Medium", sans-serif; | ||
font-weight: 500; | ||
font-size: 16px; | ||
line-height: 20px; | ||
|
||
&:global(.ant-btn-variant-solid:hover) { | ||
&:hover { | ||
background-color: var(--ant-geekblue-6); //В фигме #355FFF | ||
} | ||
} | ||
|
||
&:global(.ant-btn-variant-solid:disabled) { | ||
color: var(--ant-color-bg-base); | ||
background-color: var(--ant-color-primary-text-hover); //В фигме #5A9CFF | ||
|
||
&:hover { | ||
color: var(--ant-color-bg-base); | ||
background-color: var(--ant-color-primary-text-hover); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/pages/book/components/BookContent/components/OwnerCard/svg-icons.tsx
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,25 @@ | ||
export const ExchangeInfoIcon = ({ className }: { className?: string }) => ( | ||
<svg | ||
width="18" | ||
height="18" | ||
viewBox="0 0 18 18" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<path | ||
d="M3 12.75L15 12.75M15 12.75L12.75 15M15 12.75L12.75 10.5" | ||
stroke="#909090" | ||
strokeWidth="1.125" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
<path | ||
d="M15 5.25L3 5.25M3 5.25L5.25 7.5M3 5.25L5.25 3" | ||
stroke="#909090" | ||
strokeWidth="1.125" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
/> | ||
</svg> | ||
); |
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
File renamed without changes.
Oops, something went wrong.