-
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.
Merge pull request #18 from Long6695/feat/artist-page
Feat/artist page
- Loading branch information
Showing
13 changed files
with
1,700 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
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.
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,12 @@ | ||
{ | ||
"git": { | ||
"tagName": "${version}", | ||
"commitMessage": "chore: Release ${version}" | ||
}, | ||
"npm": { | ||
"publish": true | ||
}, | ||
"github": { | ||
"release": true | ||
} | ||
} |
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,107 @@ | ||
import React from 'react' | ||
import UIButton from '../Button/UIButton' | ||
import { UIText } from '../Text/UIText' | ||
import { BiCopy } from 'react-icons/bi' | ||
import { BsPlus } from 'react-icons/bs' | ||
import { | ||
AiOutlineFacebook, | ||
AiOutlineYoutube, | ||
AiOutlineInstagram, | ||
} from 'react-icons/ai' | ||
import { RxDiscordLogo } from 'react-icons/rx' | ||
import { CiTwitter } from 'react-icons/ci' | ||
import { breakStringWith3Dots } from '@/utils/function' | ||
import { useMediaQuery } from '@/hooks/useMediaQuery' | ||
|
||
const ArtistInfo = (): JSX.Element => { | ||
const { isMobile } = useMediaQuery() | ||
const renderTotalSale = ({ | ||
qty, | ||
text, | ||
}: { | ||
qty: string | ||
text: string | ||
}): JSX.Element => { | ||
return ( | ||
<div className="flex flex-col"> | ||
<UIText | ||
text={qty} | ||
sizeMobile="h5" | ||
sizeTablet="h5" | ||
sizeDesktop="h4" | ||
font="space-mono" | ||
/> | ||
<UIText | ||
text={text} | ||
sizeMobile="default" | ||
sizeTablet="default" | ||
sizeDesktop="h5" | ||
/> | ||
</div> | ||
) | ||
} | ||
return ( | ||
<div className="container flex flex-col gap-5 mt-[120px]"> | ||
<div className="flex flex-col items-start gap-5 desktop:flex-row"> | ||
<UIText | ||
text="Animakid" | ||
sizeDesktop="h2" | ||
sizeTablet="h3" | ||
sizeMobile="h4" | ||
/> | ||
<div className="w-full flex flex-col gap-5 tablet:flex-row desktop:justify-end"> | ||
<UIButton fullWidth={isMobile} customIcon={<BiCopy />}> | ||
{breakStringWith3Dots('0xc0E3123saidA*a9sda89A*DTA*(TD8satd7as8')} | ||
</UIButton> | ||
<UIButton | ||
fullWidth={isMobile} | ||
variant="outlined" | ||
customIcon={<BsPlus />} | ||
> | ||
Follow | ||
</UIButton> | ||
</div> | ||
</div> | ||
<div className="w-full flex items-center gap-10 tablet:justify-start desktop:gap-20"> | ||
{renderTotalSale({ qty: '250k+', text: 'Volume' })} | ||
{renderTotalSale({ qty: '50+', text: 'NFTs Sold' })} | ||
{renderTotalSale({ qty: '3000+', text: 'Followers' })} | ||
</div> | ||
<div> | ||
<UIText | ||
text="Bio" | ||
sizeMobile="h5" | ||
sizeTablet="h5" | ||
sizeDesktop="h4" | ||
font="space-mono" | ||
color="gray" | ||
/> | ||
<UIText | ||
text="The internet's friendliest designer kid." | ||
sizeMobile="default" | ||
sizeTablet="default" | ||
sizeDesktop="h5" | ||
/> | ||
</div> | ||
<div> | ||
<UIText | ||
text="Links" | ||
sizeMobile="h5" | ||
sizeTablet="h5" | ||
sizeDesktop="h4" | ||
font="space-mono" | ||
color="gray" | ||
/> | ||
<div className="flex gap-2"> | ||
<AiOutlineFacebook /> | ||
<RxDiscordLogo /> | ||
<AiOutlineYoutube /> | ||
<CiTwitter /> | ||
<AiOutlineInstagram /> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ArtistInfo |
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,79 @@ | ||
import React, { useState } from 'react' | ||
import cn from 'classnames' | ||
import { UIText } from '../Text/UIText' | ||
|
||
const TABS = [ | ||
{ | ||
label: 'Created', | ||
value: 'created', | ||
quantity: 302, | ||
}, | ||
{ | ||
label: 'Owned', | ||
value: 'owned', | ||
quantity: 67, | ||
}, | ||
{ | ||
label: 'Collection', | ||
value: 'collection', | ||
quantity: 4, | ||
}, | ||
] | ||
|
||
const ArtistTabs = (): JSX.Element => { | ||
const [active, setActive] = useState('created') | ||
|
||
const renderQuantities = (tab: { | ||
value: string | ||
quantity: number | ||
}): JSX.Element => { | ||
return ( | ||
<div | ||
className={cn('min-w-[40px] text-white rounded-full ml-2', { | ||
'px-1': tab.quantity < 100, | ||
'px-2': tab.quantity > 100, | ||
'bg-black-secondary': active !== tab.value, | ||
'bg-gray': active === tab.value, | ||
})} | ||
> | ||
<UIText | ||
text={tab.quantity.toString()} | ||
font="space-mono" | ||
onlySize="default" | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div className="container text-center"> | ||
<ul className="flex justify-between"> | ||
{TABS.map((tab) => ( | ||
<li | ||
key={tab.value} | ||
onClick={() => { | ||
setActive(tab.value) | ||
}} | ||
className={cn( | ||
'w-full cursor-pointer flex justify-center items-center py-4', | ||
{ | ||
'border-b-2 border-gray text-white': tab.value === active, | ||
'text-gray': tab.value !== active, | ||
}, | ||
)} | ||
> | ||
<UIText | ||
text={tab.label} | ||
sizeDesktop="h5" | ||
sizeMobile="default" | ||
sizeTablet="default" | ||
/> | ||
{renderQuantities(tab)} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
) | ||
} | ||
|
||
export default ArtistTabs |
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,7 @@ | ||
import React from 'react' | ||
|
||
const Divider = (): JSX.Element => { | ||
return <div className="border-b-2 border-black-secondary mt-10" /> | ||
} | ||
|
||
export default Divider |
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,51 @@ | ||
import React from 'react' | ||
import Image from 'next/image' | ||
import ArtistInfo from '@/components/Artists/ArtistInfo' | ||
import { useMediaQuery } from '@/hooks/useMediaQuery' | ||
import cn from 'classnames' | ||
import ArtistTabs from '@/components/Artists/ArtistTabs' | ||
import DiscoverCard from '@/components/Home/Discover/DiscoverCard' | ||
import WrapperCards from '@/components/WrapperCards' | ||
import Divider from '@/components/Divider' | ||
|
||
const ArtistPage = (): JSX.Element => { | ||
const { isMobile } = useMediaQuery() | ||
|
||
const renderItems = (qty: number): React.ReactNode => { | ||
return Array.from({ length: qty }, (_, idx) => ( | ||
<DiscoverCard bg="bg-black" key={idx} /> | ||
)) | ||
} | ||
|
||
return ( | ||
<div className="flex flex-col"> | ||
<div className="relative w-full h-[320px]"> | ||
<Image priority fill src="/images/artist-bg.png" alt="artist" /> | ||
<div className="absolute container h-full flex items-end left-1/2 -translate-x-1/2"> | ||
<div | ||
className={cn('absolute -bottom-14', { | ||
'left-1/2 -translate-x-1/2': isMobile, | ||
})} | ||
> | ||
<Image | ||
src="/images/ava-artist-square.png" | ||
alt="artist" | ||
width={120} | ||
height={120} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
<ArtistInfo /> | ||
<Divider /> | ||
<ArtistTabs /> | ||
<div className="w-full bg-black-secondary"> | ||
<div className="container mb-10"> | ||
<WrapperCards>{renderItems(9)}</WrapperCards> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ArtistPage |
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,5 @@ | ||
export const breakStringWith3Dots = (text: string): string => { | ||
const get6CharsFirst = text.substring(0, 6) | ||
const get4CharsLast = text.substring(text.length - 4) | ||
return `${get6CharsFirst}...${get4CharsLast}` | ||
} |
Oops, something went wrong.