> }
+}) => {
+ const handleChange = (newValue) => {
+ tabController.setActive(newValue)
+ }
+ return (
+
+ handleChange(0)} variant="text">
+ COIN
+
+ handleChange(1)} variant="text">
+ NFT
+
+
+ )
+}
+
+export default TxTab
+
+const Tabbutton = styled(Button)<{ activeIndex?: boolean }>`
+ color: white;
+ border: ${DEFAULT_BORDERS};
+ background-color: ${({ activeIndex }) => (activeIndex ? COLORS.MENU : 'transparent')};
+ height: 25px;
+ font-size: 0.8em;
+
+ ${({theme}) => `
+ ${theme.mediaQueries.sm} {
+ height: 50px;
+ }
+ `}
+ `
diff --git a/src/views/MarketplaceV2/Views/User/Usermain.tsx b/src/views/MarketplaceV2/Views/User/Usermain.tsx
new file mode 100644
index 0000000..7b57acd
--- /dev/null
+++ b/src/views/MarketplaceV2/Views/User/Usermain.tsx
@@ -0,0 +1,158 @@
+import React, { useState, useEffect } from 'react'
+import { Flex, IconButton } from '@metagg/mgg-uikit'
+import { Grid } from '@mui/material'
+import Iconloader from 'views/MarketplaceV2/components/Foundation/Iconloader'
+import MarketPlaceButton from 'views/MarketplaceV2/components/Foundation/Button'
+import BasicTooltip from 'views/MarketplaceV2/components/Foundation/Tooltip'
+import { H2, H3, H5, P, TextWrapper } from 'views/MarketplaceV2/components/Foundation/Text'
+import useMarketplaceV2 from 'hooks/useMarketplaceV2'
+import { MiniBox } from '../../components/Foundation/Box'
+import { FIELD_INFO } from './index.d'
+import { ActionDiv, Button, ContentWrapper, NavButton, NavDiv, StyledBox } from './styled'
+import Cointable from './Cointable'
+import Table from './Table'
+import TxTab from './TxTab'
+
+const UserMain = (props) => {
+ const {
+ controllers: { modal },
+ } = useMarketplaceV2()
+
+ const {
+ txHistory: { coin, nft },
+ activityHistory,
+ stats,
+ tabController: { active },
+ } = props
+ const txD = React.useMemo(() => (active === 0 ? coin : nft), [active, coin, nft])
+
+ const boxInfo = (name: string, tooltip: string) => {
+ return (
+
+ {name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ }
+
+ const renderInfo = () => {
+ return (
+
+
+
+
+ {Object.entries(stats.basicInfo).map((stat) => {
+ const field = FIELD_INFO[`${stat[0]}`]
+ const val = stat[1]
+ return (
+ <>
+
+ {field}
+
+
+ : {val}
+
+ >
+ )
+ })}
+
+
+
+
+
+
+
+
+
+
+
+ )
+ }
+
+ const renderPoint = () => {
+ return (
+
+ {boxInfo('point', 'Access point')}
+
+
+
+ 123456 MGG | 0.00
+
+
+
+
+
+
+
+ )
+ }
+
+ const renderCoin = () => (
+
+ {boxInfo('coin', 'Access coin')}
+
+
+
+
+
+
+ WITHDRAW
+
+
+
+
+
+ )
+
+ const renderActivityHistory = () => (
+
+
+ Activity History
+
+
+
+
+
+
+ )
+
+ const renderTxHistory = () => (
+
+
+ Transaction History
+
+
+
+
+
+
+
+ )
+
+ return (
+
+ {renderInfo()}
+ {renderPoint()}
+ {renderCoin()}
+ {renderActivityHistory()}
+ {renderTxHistory()}
+
+ )
+}
+
+export default UserMain
diff --git a/src/views/MarketplaceV2/Views/User/index.d.ts b/src/views/MarketplaceV2/Views/User/index.d.ts
index 6155a42..3595f07 100644
--- a/src/views/MarketplaceV2/Views/User/index.d.ts
+++ b/src/views/MarketplaceV2/Views/User/index.d.ts
@@ -1,5 +1,23 @@
+import { CardType } from "contexts/index.d";
+
export enum FIELD_INFO {
email = 'EMAIL ADDRESS',
wallet = 'WALLET ADDRESS',
credit = 'CREDIT CARD',
}
+
+export enum STATUS {
+ success = '#4cae43',
+ fail = '#b93a45'
+}
+
+
+export type TableProps = {
+ date: string;
+ status: string;
+ tx: string;
+ amount: string;
+ type: string
+}
+
+export type NftProps = CardType
\ No newline at end of file
diff --git a/src/views/MarketplaceV2/Views/User/index.tsx b/src/views/MarketplaceV2/Views/User/index.tsx
index 47dc113..cd58358 100644
--- a/src/views/MarketplaceV2/Views/User/index.tsx
+++ b/src/views/MarketplaceV2/Views/User/index.tsx
@@ -1,14 +1,13 @@
-import React, { useState, useEffect } from 'react'
-import { Flex, IconButton } from '@metagg/mgg-uikit'
+import React, { useState } from 'react'
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 Box, { MiniBox } from '../../components/Foundation/Box'
+import { TextWrapper } from 'views/MarketplaceV2/components/Foundation/Text'
import withGridLayout from './withGridLayout'
import Main from '../Main'
-import { FIELD_INFO } from './index.d'
-import { ContentWrapper } from './styled'
+import UserMain from './Usermain'
+import NftCollection from './NftCollection'
+
+// Tempdata collection
const tempStats = {
basicInfo: {
@@ -18,68 +17,73 @@ const tempStats = {
},
}
-const UserMain = (props) => {
- const renderInfo = () => {
- return (
-
-
-
-
- {Object.entries(tempStats.basicInfo).map((stat) => {
- const field = FIELD_INFO[`${stat[0]}`]
- const val = stat[1]
- return (
- <>
-
- {field}
-
-
- : {val}
-
- >
- )
- })}
-
-
-
-
-
-
-
-
-
-
-
- )
- }
-
- const renderPoint = () => {
- return (
-
-
- POINT
-
-
- )
- }
+const tempActivityData = [
+ {
+ date: '2023.07.27',
+ status: 'Success',
+ tx: 'Buy',
+ amount: '102.00',
+ type: 'Market Money',
+ },
+ {
+ date: '2023.07.27',
+ status: 'Fail',
+ tx: 'Buy',
+ amount: '102.00',
+ type: 'Market Money',
+ },
+]
- return (
-
- {renderInfo()}
- {renderPoint()}
-
- )
+const tempTx = {
+ coin: [
+ {
+ date: '2023.07.27',
+ status: 'Success',
+ tx: 'Buy',
+ amount: '102.00',
+ type: 'Market Money',
+ },
+ ],
+ nft: [
+ {
+ date: '2023.07.27',
+ status: 'Success',
+ tx: 'Buy',
+ amount: '102.00',
+ type: 'Market Money',
+ },
+ {
+ date: '2023.07.27',
+ status: 'Fail',
+ tx: 'Buy',
+ amount: '102.00',
+ type: 'Market Money',
+ },
+ ],
}
+// Tempdata collection -- end
+
const WrappedMain = withGridLayout(UserMain)
+const WrappedNftList = withGridLayout(NftCollection)
const User = () => {
+ const [active, setActive] = useState(0)
return (
-
+
+
@@ -95,6 +99,3 @@ const StyledDiv = styled.div`
margin: 15px 0;
padding: 15px 0px;
`
-const StyledBox = styled(Box).attrs({ className: 'secondary-drop-shadow' })`
- word-wrap: break-word;
-`
diff --git a/src/views/MarketplaceV2/Views/User/styled.tsx b/src/views/MarketplaceV2/Views/User/styled.tsx
index 0c96090..cff6d04 100644
--- a/src/views/MarketplaceV2/Views/User/styled.tsx
+++ b/src/views/MarketplaceV2/Views/User/styled.tsx
@@ -1,4 +1,8 @@
+import { Button as MGGButton, Flex } from '@metagg/mgg-uikit';
import styled from 'styled-components'
+import { DefaultButton } from 'views/MarketplaceV2/components/Foundation/Button/styled'
+import { COLORS } from 'views/MarketplaceV2/styles/constants';
+import Box from '../../components/Foundation/Box'
export const ContentWrapper = styled.div`
width: 100%;
@@ -7,6 +11,41 @@ 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};
+ `}
+`
+export const NavDiv = styled.div`
+
+`
+export const NavButton = styled(MGGButton)`
+ width: 60px;
+ height: 4vh;
+ border-radius: 0!important;
+ background-color: transparent;
+ // border: 1px solid ${COLORS.BORDER};
+`
+
+export const StyledBox = styled(Box).attrs({ className: 'secondary-drop-shadow' })<{ p?: string }>`
+ word-wrap: break-word;
+`
+
+export const ActionDiv = styled(Flex)`
+ height:4vh;
+ & > * {
+ height: 100%;
+ }
+`
\ No newline at end of file
diff --git a/src/views/MarketplaceV2/components/Card/styled.tsx b/src/views/MarketplaceV2/components/Card/styled.tsx
index 6d0e13f..8279fcc 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 = () => {
-
+
diff --git a/src/views/MarketplaceV2/components/Foundation/Accordion/index.tsx b/src/views/MarketplaceV2/components/Foundation/Accordion/index.tsx
index e02d144..77ac483 100644
--- a/src/views/MarketplaceV2/components/Foundation/Accordion/index.tsx
+++ b/src/views/MarketplaceV2/components/Foundation/Accordion/index.tsx
@@ -10,7 +10,7 @@ const Accordion: React.FC = ({ children, ...props }) => {
const { theme } = useTheme()
return (
-
+
}
aria-controls={`${name.toLowerCase()}-content`}
diff --git a/src/views/MarketplaceV2/components/Foundation/Box/index.tsx b/src/views/MarketplaceV2/components/Foundation/Box/index.tsx
index b96de28..e0af27d 100644
--- a/src/views/MarketplaceV2/components/Foundation/Box/index.tsx
+++ b/src/views/MarketplaceV2/components/Foundation/Box/index.tsx
@@ -13,7 +13,7 @@ const Box: React.FC> = ({ children, ...prop
export default Box
-const Container = styled.div`
+const Container = styled.div`
background: ${COLORS.CARD};
background: ${COLORS.GRADIENT_CARD};
padding: 2em;
@@ -21,6 +21,8 @@ const Container = styled.div`
display: flex;
justify-content: center;
width: 100%;
+ ${({ p, pt, pb, pl, pr }) => customSpacingProps({ p, pt, pb, pl, pr })}
+ ${({ m, mt, mb, ml, mr }) => customSpacingProps({ m, mt, mb, ml, mr })}
`
const Wrapper = styled.div`
width: 100%;
diff --git a/src/views/MarketplaceV2/components/Foundation/Button/index.d.ts b/src/views/MarketplaceV2/components/Foundation/Button/index.d.ts
index e7f3da2..9159acf 100644
--- a/src/views/MarketplaceV2/components/Foundation/Button/index.d.ts
+++ b/src/views/MarketplaceV2/components/Foundation/Button/index.d.ts
@@ -4,4 +4,7 @@ export interface Props extends React.HTMLProps {
iconType?: string
icon?: string
variant?: any
+ p?: string;
+ m?: string;
+ height?: string;
}
diff --git a/src/views/MarketplaceV2/components/Foundation/Button/index.tsx b/src/views/MarketplaceV2/components/Foundation/Button/index.tsx
index b78cd81..1f75aa1 100644
--- a/src/views/MarketplaceV2/components/Foundation/Button/index.tsx
+++ b/src/views/MarketplaceV2/components/Foundation/Button/index.tsx
@@ -6,9 +6,9 @@ import { StyledButton, StyledMiniBox } from './styled'
import { P, TextWrapper } from '../Text'
const MarketPlaceButton = (props: Props) => {
- const { title, iconType, icon, style, children, className, variant, onClick } = props
+ const { title, iconType, icon, style, children, className, variant, onClick, p, m, height } = props
return (
-
+
{children ?? (
diff --git a/src/views/MarketplaceV2/components/Foundation/Button/styled.ts b/src/views/MarketplaceV2/components/Foundation/Button/styled.ts
index 9d20d3c..c52e900 100644
--- a/src/views/MarketplaceV2/components/Foundation/Button/styled.ts
+++ b/src/views/MarketplaceV2/components/Foundation/Button/styled.ts
@@ -1,17 +1,29 @@
import styled from 'styled-components'
import { Button } from '@metagg/mgg-uikit'
+import { customSpacingProps } from 'views/MarketplaceV2/styles/constants'
+import { Margins, Paddings } from 'views/MarketplaceV2/styles/index.d'
import { MiniBox } from '../Box'
-export const StyledButton = styled(Button)`
+export const DefaultButton = styled(Button)`
+ font-family: 'One Splice' !important;
+ font-weight: 300;
+ ${({ p, pt, pb, pl, pr }) => customSpacingProps({ p, pt, pb, pl, pr })}
+ ${({ m, mt, mb, ml, mr }) => customSpacingProps({ m, mt, mb, ml, mr })}
+`
+
+export const StyledButton = styled(DefaultButton)<{height?: string}>`
color: ${({ theme }) => theme.colors.text};
- font-size: 1em;
+ // font-size: 1em;
margin: 0 5px;
padding: 0;
border-radius: 5px;
+ ${({height}) => height && `
+ height: ${height};
+ `}
`
export const StyledMiniBox = styled(MiniBox)`
height: 100%;
justify-content: flex-start;
- width: 100px;
+ // width: 100px;
`
diff --git a/src/views/MarketplaceV2/components/Foundation/Drawer/index.tsx b/src/views/MarketplaceV2/components/Foundation/Drawer/index.tsx
index 5ce6f77..c25002d 100644
--- a/src/views/MarketplaceV2/components/Foundation/Drawer/index.tsx
+++ b/src/views/MarketplaceV2/components/Foundation/Drawer/index.tsx
@@ -32,9 +32,17 @@ const StyledDiv = styled.div`
overflow-y: scroll;
${({ theme }) => `
${theme.mediaQueries.sm} {
+ width: 35vw;
+ }
+
+ ${theme.mediaQueries.md} {
width: 25vw;
}
`}
+ &::-webkit-scrollbar-track {
+ box-shadow: none;
+ border-radius: 0;
+ }
`
const MainContent = styled.div`
padding: 1.5em;
diff --git a/src/views/MarketplaceV2/components/Foundation/Tooltip/index.tsx b/src/views/MarketplaceV2/components/Foundation/Tooltip/index.tsx
new file mode 100644
index 0000000..daca7f8
--- /dev/null
+++ b/src/views/MarketplaceV2/components/Foundation/Tooltip/index.tsx
@@ -0,0 +1,12 @@
+import { Tooltip } from '@mui/material'
+import React from 'react'
+
+const BasicTooltip: React.FC<{title: string, children: any}> = ({title, children}) => {
+ return (
+
+ {children}
+
+ )
+}
+
+export default BasicTooltip
\ No newline at end of file
diff --git a/src/views/MarketplaceV2/components/Sidebar/styled.ts b/src/views/MarketplaceV2/components/Sidebar/styled.ts
index 7aabeb1..c3ff80f 100644
--- a/src/views/MarketplaceV2/components/Sidebar/styled.ts
+++ b/src/views/MarketplaceV2/components/Sidebar/styled.ts
@@ -2,6 +2,7 @@ import styled from 'styled-components'
import { COLORS, SETTINGS_SIDEBAR, breakpointMap } from 'views/MarketplaceV2/styles/constants'
import { CONTAINER_PROPS } from '../Foundation/layout'
+
export const StyledPanel = styled.div`
display: flex;
flex-direction: column;
@@ -38,7 +39,7 @@ export const BodyWrapper = styled.div`
export const Inner = styled.div`
flex-grow: 1;
- padding: 15px;
+ padding: 10px;
${({ theme }) => `
${theme.mediaQueries.sm} {
padding: 24px;
@@ -49,3 +50,4 @@ export const Inner = styled.div`
`}
`
+
diff --git a/src/views/MarketplaceV2/components/UserHighlight/index.tsx b/src/views/MarketplaceV2/components/UserHighlight/index.tsx
index 516b6b6..385007c 100644
--- a/src/views/MarketplaceV2/components/UserHighlight/index.tsx
+++ b/src/views/MarketplaceV2/components/UserHighlight/index.tsx
@@ -1,5 +1,5 @@
import React from 'react'
-import { IconButton } from '@metagg/mgg-uikit'
+import { IconButton, Flex } from '@metagg/mgg-uikit'
import { useLocation } from 'react-router-dom'
import useTheme from 'hooks/useTheme'
import useFirebaseAuth from 'hooks/useFirebaseAuth'
@@ -43,17 +43,15 @@ const UserHighlight = () => {
{/* revert this condition */}
{!user ? (
<>
-
- 123456789 MGG
-
modal.handleOpen('buy-token')}>
-
+ 123456789 MGG
+
-
+
>
diff --git a/src/views/MarketplaceV2/components/UserHighlight/styled.ts b/src/views/MarketplaceV2/components/UserHighlight/styled.ts
index a7c71ab..94ecd40 100644
--- a/src/views/MarketplaceV2/components/UserHighlight/styled.ts
+++ b/src/views/MarketplaceV2/components/UserHighlight/styled.ts
@@ -9,9 +9,9 @@ export const StyledDiv = styled.div`
display: flex;
align-items: center;
- & > * {
- height: 30px;
- }
+ // & > * {
+ // height: 30px;
+ // }
}
`
diff --git a/src/views/MarketplaceV2/styles/Marketplace.css b/src/views/MarketplaceV2/styles/Marketplace.css
index a8d3ca3..0b94951 100644
--- a/src/views/MarketplaceV2/styles/Marketplace.css
+++ b/src/views/MarketplaceV2/styles/Marketplace.css
@@ -77,6 +77,10 @@ button.option {
animation: tilt-n-move-shaking 0.25s infinite;
}
+.icon-button {
+ width: auto;
+}
+
.icon-button:hover {
background-color: transparent !important;
}