Skip to content

Commit c606d3e

Browse files
authored
feat(verification): temporary and persisted details on borrower info
2 parents 6800475 + dfb30d4 commit c606d3e

11 files changed

Lines changed: 541 additions & 8 deletions

File tree

src/components/ParametersItem/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as React from "react"
22

3-
import { Box, Tooltip, Typography } from "@mui/material"
3+
import { Box, SvgIcon, Tooltip, Typography } from "@mui/material"
44

5+
import CheckIcon from "@/assets/icons/check_icon.svg"
56
import { LinkGroup } from "@/components/LinkComponent"
67
import { TooltipButton } from "@/components/TooltipButton"
78
import { useMobileResolution } from "@/hooks/useMobileResolution"
@@ -24,6 +25,7 @@ export const ParametersItem = ({
2425
alarmState,
2526
copy,
2627
link,
28+
verified,
2729
}: ParametersItemProps) => {
2830
const isMobile = useMobileResolution()
2931

@@ -73,6 +75,17 @@ export const ParametersItem = ({
7375
)}
7476

7577
<LinkGroup linkValue={link} copyValue={copy} />
78+
79+
{verified && (
80+
<SvgIcon
81+
sx={{
82+
fontSize: "14px",
83+
"& path": { fill: "#1B9B16" },
84+
}}
85+
>
86+
<CheckIcon />
87+
</SvgIcon>
88+
)}
7689
</Box>
7790
</Box>
7891
)

src/components/ParametersItem/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export type ParametersItemProps = {
99
alarmState?: boolean
1010
copy?: string
1111
link?: string
12+
verified?: boolean
1213
}

src/components/Profile/ProfilePage/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ProfilePageProps } from "./interface"
1818
import { PageContentContainer, MobileContentContainer } from "./style"
1919
import { OverallBlock } from "../components/OverallBlock"
2020
import { ToUStatusBlock } from "../components/ToUStatusBlock"
21+
import { BorrowerProfileVerificationDisclosure } from "../components/VerificationDisclosure"
2122

2223
export const ProfilePage = ({ type, profileAddress }: ProfilePageProps) => {
2324
const { data: profileData, isLoading: isProfileLoading } =
@@ -53,11 +54,11 @@ export const ProfilePage = ({ type, profileAddress }: ProfilePageProps) => {
5354
if (isLoading)
5455
return <ProfilePageSkeleton isExternal={isExternal} isMobile={isMobile} />
5556

56-
console.log(accountName)
57-
5857
if (isMobile)
5958
return (
6059
<Box sx={MobileContentContainer}>
60+
<BorrowerProfileVerificationDisclosure showNote={false} />
61+
6162
<MobileNamePageBlockWrapper
6263
section={section}
6364
setSection={setSection}
@@ -79,6 +80,10 @@ export const ProfilePage = ({ type, profileAddress }: ProfilePageProps) => {
7980
{section === "info" && (
8081
<>
8182
<OverallBlock {...profileData} marketsAmount={marketsAmount} />
83+
<BorrowerProfileVerificationDisclosure
84+
variant="inline"
85+
showModal={false}
86+
/>
8287
<ToUStatusBlock
8388
address={profileAddress}
8489
status={touStatus}
@@ -105,7 +110,11 @@ export const ProfilePage = ({ type, profileAddress }: ProfilePageProps) => {
105110

106111
<Divider sx={{ marginY: "32px" }} />
107112

108-
<OverallBlock {...profileData} marketsAmount={marketsAmount} isPage />
113+
<Box sx={{ position: "relative" }}>
114+
<OverallBlock {...profileData} marketsAmount={marketsAmount} isPage />
115+
116+
<BorrowerProfileVerificationDisclosure />
117+
</Box>
109118

110119
<Divider sx={{ marginY: "32px" }} />
111120

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1+
import type { SxProps, Theme } from "@mui/material"
2+
13
import { pageCalcHeights } from "@/utils/constants"
24

5+
import { BORROWER_PROFILE_VERIFICATION_GUTTER } from "../components/VerificationDisclosure/style"
6+
37
export const MobileContentContainer = {
48
height: "100%",
59
display: "flex",
610
flexDirection: "column",
711
}
812

9-
export const PageContentContainer = {
13+
export const PageContentContainer: SxProps<Theme> = (theme) => ({
1014
width: "100%",
1115
height: `calc(100vh - ${pageCalcHeights.page})`,
12-
padding: "44px 27.48% 44px 44px",
16+
padding: `44px ${BORROWER_PROFILE_VERIFICATION_GUTTER} 44px 44px`,
1317
overflow: "scroll",
14-
}
18+
[theme.breakpoints.down("lg")]: {
19+
paddingRight: "44px",
20+
},
21+
})

src/components/Profile/ProfileSection/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useGetBorrowerProfile } from "@/app/[locale]/borrower/profile/hooks/use
66
import { ProfileSectionNameBlock } from "./components/ProfileSectionNameBlock"
77
import { ProfileSectionProps } from "./interface"
88
import { OverallBlock } from "../components/OverallBlock"
9+
import { BorrowerProfileVerificationDisclosure } from "../components/VerificationDisclosure"
910

1011
export const ProfileSection = ({
1112
profileAddress,
@@ -32,6 +33,8 @@ export const ProfileSection = ({
3233
marketsAmount={marketsAmount}
3334
externalChainId={externalChainId}
3435
/>
36+
37+
<BorrowerProfileVerificationDisclosure variant="market" />
3538
</>
3639
)
3740
}

src/components/Profile/components/OverallBlock/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ const makeInformationItem = (
2727
tooltipText?: string
2828
link?: string
2929
copy?: string
30+
verified?: boolean
3031
},
3132
): ProfileItem => ({
3233
title,
3334
value,
3435
tooltipText: opts?.tooltipText,
3536
link: opts?.link,
3637
copy: opts?.copy,
38+
verified: opts?.verified,
3739
})
3840

3941
export const OverallBlock = ({
@@ -72,27 +74,33 @@ export const OverallBlock = ({
7274
const normalizedDefaults = defaults !== undefined ? String(defaults) : "0"
7375

7476
const profileInfo: ProfileItem[] = [
75-
makeInformationItem(t("borrowerProfile.profile.overallInfo.name"), name),
77+
makeInformationItem(t("borrowerProfile.profile.overallInfo.name"), name, {
78+
verified: true,
79+
}),
7680
makeInformationItem(t("borrowerProfile.profile.overallInfo.alias"), alias),
7781
makeInformationItem(
7882
t("borrowerProfile.profile.overallInfo.address"),
7983
address ? trimAddress(address) : undefined,
8084
{
8185
link: address ? getAddressUrl(address) : undefined,
8286
copy: address,
87+
verified: true,
8388
},
8489
),
8590
makeInformationItem(
8691
t("borrowerProfile.profile.overallInfo.headquarters"),
8792
jurisdictionText,
93+
{ verified: true },
8894
),
8995
makeInformationItem(
9096
t("borrowerProfile.profile.overallInfo.entityKind"),
9197
entityKindText,
98+
{ verified: true },
9299
),
93100
makeInformationItem(
94101
t("borrowerProfile.profile.overallInfo.founded"),
95102
founded,
103+
{ verified: true },
96104
),
97105
makeInformationItem(
98106
t("borrowerProfile.profile.overallInfo.markets"),
@@ -138,6 +146,7 @@ export const OverallBlock = ({
138146
tooltipText={item.tooltipText}
139147
link={item.link}
140148
copy={item.copy}
149+
verified={item.verified}
141150
/>
142151

143152
{index < existingData.length - 1 && (
@@ -165,6 +174,7 @@ export const OverallBlock = ({
165174
tooltipText={item.tooltipText}
166175
link={item.link}
167176
copy={item.copy}
177+
verified={item.verified}
168178
/>
169179
<Divider sx={InfoDivider} />
170180
</Box>
@@ -180,6 +190,7 @@ export const OverallBlock = ({
180190
tooltipText={item.tooltipText}
181191
link={item.link}
182192
copy={item.copy}
193+
verified={item.verified}
183194
/>
184195
<Divider sx={InfoDivider} />
185196
</Box>

src/components/Profile/components/OverallBlock/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export type ProfileItem = {
1313
tooltipText?: string
1414
link?: string
1515
copy?: string
16+
verified?: boolean
1617
}

0 commit comments

Comments
 (0)