From bedd8c95df4bd37cb826ab9eef8e5f94973c53d3 Mon Sep 17 00:00:00 2001 From: kojiadrianojr Date: Mon, 23 Oct 2023 19:04:06 +0800 Subject: [PATCH 1/5] WIP: User page --- src/views/MarketplaceV2/Views/User/index.tsx | 65 ++++++++++++++++--- src/views/MarketplaceV2/Views/User/styled.tsx | 17 ++++- .../MarketplaceV2/components/Card/styled.tsx | 4 +- .../components/Filters/index.tsx | 2 +- .../components/Foundation/Accordion/index.tsx | 2 +- .../components/Foundation/Box/index.tsx | 4 +- .../components/Foundation/Button/index.d.ts | 2 + .../components/Foundation/Button/index.tsx | 4 +- .../components/Foundation/Button/styled.ts | 10 ++- .../components/Foundation/Drawer/index.tsx | 8 +++ .../components/UserHighlight/index.tsx | 6 +- .../components/UserHighlight/styled.ts | 6 +- .../MarketplaceV2/styles/Marketplace.css | 4 ++ 13 files changed, 108 insertions(+), 26 deletions(-) diff --git a/src/views/MarketplaceV2/Views/User/index.tsx b/src/views/MarketplaceV2/Views/User/index.tsx index 47dc113..344fccc 100644 --- a/src/views/MarketplaceV2/Views/User/index.tsx +++ b/src/views/MarketplaceV2/Views/User/index.tsx @@ -3,12 +3,13 @@ import { Flex, IconButton } from '@metagg/mgg-uikit' import styled from 'styled-components' import { Grid } from '@mui/material' import Iconloader from 'views/MarketplaceV2/components/Foundation/Iconloader' -import { H2, H5, P, TextWrapper } from 'views/MarketplaceV2/components/Foundation/Text' +import MarketPlaceButton from 'views/MarketplaceV2/components/Foundation/Button' +import { H2, H3, H5, P, TextWrapper } from 'views/MarketplaceV2/components/Foundation/Text' import Box, { MiniBox } from '../../components/Foundation/Box' import withGridLayout from './withGridLayout' import Main from '../Main' import { FIELD_INFO } from './index.d' -import { ContentWrapper } from './styled' +import { Button, ContentWrapper } from './styled' const tempStats = { basicInfo: { @@ -21,7 +22,7 @@ const tempStats = { const UserMain = (props) => { const renderInfo = () => { return ( - + @@ -31,10 +32,10 @@ const UserMain = (props) => { return ( <> -
{field}
+
{field}
-

: {val}

+

: {val}

) @@ -53,20 +54,64 @@ const UserMain = (props) => { ) } - const renderPoint = () => { + const boxInfo = (name: string) => { return ( - - -

POINT

+ +

{name}

+ + + + + + + + + + + +
+ ) + } + + const renderPoint = () => { + return ( + + {boxInfo('point')} + + + +

123456 MGG | 0.00

+
+
+ + + +
) } + const renderCoin = () => ( + + {boxInfo('coin')} + test + + + +

WITHDRAW

+
+
+ +
+
+ ) + return ( {renderInfo()} {renderPoint()} + {renderCoin()} ) } @@ -95,6 +140,6 @@ const StyledDiv = styled.div` margin: 15px 0; padding: 15px 0px; ` -const StyledBox = styled(Box).attrs({ className: 'secondary-drop-shadow' })` +const StyledBox = styled(Box).attrs({ className: 'secondary-drop-shadow' })<{ p?: string }>` word-wrap: break-word; ` diff --git a/src/views/MarketplaceV2/Views/User/styled.tsx b/src/views/MarketplaceV2/Views/User/styled.tsx index 0c96090..a292ecf 100644 --- a/src/views/MarketplaceV2/Views/User/styled.tsx +++ b/src/views/MarketplaceV2/Views/User/styled.tsx @@ -1,4 +1,5 @@ import styled from 'styled-components' +import { DefaultButton } from 'views/MarketplaceV2/components/Foundation/Button/styled' export const ContentWrapper = styled.div` width: 100%; @@ -7,6 +8,20 @@ export const ContentWrapper = styled.div` align-items: center; flex-direction: column; & > * { - margin: 2em 0px; + margin: 1em 0px; } ` +export const Button = styled(DefaultButton)<{ w?: string; h?: string }>` + width: 100%; + font-size: 1.2em; + font-weight: 300; + padding: 0px; + ${({ w }) => + w && + ` + width: ${w}; + `} + ${({ h }) => ` + height: ${h}; + `} +` diff --git a/src/views/MarketplaceV2/components/Card/styled.tsx b/src/views/MarketplaceV2/components/Card/styled.tsx index bec54a4..d66bd8e 100644 --- a/src/views/MarketplaceV2/components/Card/styled.tsx +++ b/src/views/MarketplaceV2/components/Card/styled.tsx @@ -1,9 +1,9 @@ import React from 'react' import styled from 'styled-components' -import { Button as MGGButton } from '@metagg/mgg-uikit' import { COLORS, DEFAULT_BORDERS } from 'views/MarketplaceV2/styles/constants' import { TextWrapper } from '../Foundation/Text' import { backgroundProp } from '../Foundation/layout' +import { DefaultButton } from '../Foundation/Button/styled' export const CardContainer = styled.div` cursor: pointer; @@ -74,7 +74,7 @@ export const Details = styled.div` z-index: 2; ` -export const Button = styled(MGGButton)` +export const Button = styled(DefaultButton)` border-radius: 5px; width: 30%; ` diff --git a/src/views/MarketplaceV2/components/Filters/index.tsx b/src/views/MarketplaceV2/components/Filters/index.tsx index 3ddf5ea..af377cf 100644 --- a/src/views/MarketplaceV2/components/Filters/index.tsx +++ b/src/views/MarketplaceV2/components/Filters/index.tsx @@ -21,7 +21,7 @@ const Filters = () => { -