diff --git a/public/devConfig.json b/public/devConfig.json index 9e90b7df..ea4807c5 100644 --- a/public/devConfig.json +++ b/public/devConfig.json @@ -1,5 +1,5 @@ { - "REDIRECT_URL": "https://dev.punkga.me", + "REDIRECT_URL": "https://app.dev.punkga.me", "CHAIN_ID": "aura_6321-3", "CHAIN_INFO": { "chainId": "aura_6321-3", diff --git a/public/mainConfig.json b/public/mainConfig.json index b6c3d45a..6d7556b1 100644 --- a/public/mainConfig.json +++ b/public/mainConfig.json @@ -1,5 +1,5 @@ { - "REDIRECT_URL": "https://punkga.me", + "REDIRECT_URL": "https://app.punkga.me", "CHAIN_ID": "aura_6322-2", "CHAIN_INFO": { "chainId": "aura_6322-2", diff --git a/public/stagingConfig.json b/public/stagingConfig.json index 19f45c61..898c624b 100644 --- a/public/stagingConfig.json +++ b/public/stagingConfig.json @@ -1,5 +1,5 @@ { - "REDIRECT_URL": "https://staging.punkga.me", + "REDIRECT_URL": "https://app.staging.punkga.me", "CHAIN_ID": "aura_6321-3", "CHAIN_INFO": { "chainId": "aura_6321-3", diff --git a/src/components/Header/components/Drawer.tsx b/src/components/Header/components/Drawer.tsx index b15c979c..c41fa453 100644 --- a/src/components/Header/components/Drawer.tsx +++ b/src/components/Header/components/Drawer.tsx @@ -23,6 +23,7 @@ import { useAccount, useBalance, useChainId, useSwitchChain } from 'wagmi' export default function Drawer({ openNavigation, setOpenNavigation }) { const config = getConfig() + const [showActivities, setShowActivities] = useState(false) const { t } = useTranslation() const router = useRouter() const { setMigrateWalletOpen } = useContext(ModalContext) @@ -61,7 +62,7 @@ export default function Drawer({ openNavigation, setOpenNavigation }) { <>
@@ -71,6 +72,7 @@ export default function Drawer({ openNavigation, setOpenNavigation }) { className='w-6 h-6 mt-2 relative' onClick={() => { setOpenNavigation(false) + setShowActivities(false) }}> @@ -78,240 +80,307 @@ export default function Drawer({ openNavigation, setOpenNavigation }) {
- {account?.verified && account?.name && ( + {showActivities ? ( <> -
-
-
{account?.name}
-
- dream-point - {formatNumber(+(+dpBalance?.data?.formatted || 0).toFixed(2))} {dpBalance?.data?.symbol || 'AURA'} -
+
+
setShowActivities(false)}> + + + + Activity
-
- Connected chain: {chainId == config.CHAIN_INFO.evmChainId ? 'Aura' : 'Story'} •{' '} - { - switchChain({ - chainId: chainId == config.CHAIN_INFO.evmChainId ? storyChain.id : config.CHAIN_INFO.evmChainId, - }) - }}> - {chainId == config.CHAIN_INFO.evmChainId ? 'Switch to Story' : 'Switch to Aura'} - -
- {account.noncustodialWalletAddress && ( -
-
setShowWalletDetail(!showWalletDetail)}> - - - - {t('My wallet')} -
- {showWalletDetail && ( -
-
-
{`${t('Wallet')}`}
-
-
{`${shorten( - account?.activeWalletAddress, - 8, - 8 - )}`}
-
- +
+ {account?.activities?.map((act, index) => { + if (act.type == 'SUBMIT_ARTWORK') + return ( +
+ +
+
Submit
+
+
+ {act.story_artwork.name} +
+
+{formatNumber(act.amount)}DP
- - {t('Copied')} -
-
{`${t('Balance')}`}
-
-
- {hideBalance - ? '********' - : `${(+walletBalance?.data?.formatted || 0).toFixed(2)} ${ - walletBalance?.data?.symbol || 'AURA' - }`} -
- - { -
- {hideBalance ? ( - setHideBalance(false)} - className='w-[18px] h-[18px] cursor-pointer' - /> - ) : ( - setHideBalance(true)} - className='w-[18px] h-[18px] cursor-pointer' - /> - )} +
+ ) + return null + })} +
+
+ + ) : ( + <> + {account?.verified && account?.name && ( + <> +
+
+
{account?.name}
+
+
+ dream-point + {formatNumber(+(+dpBalance?.data?.formatted || 0).toFixed(2))}{' '} + {dpBalance?.data?.symbol || 'AURA'} +
+
setShowActivities(true)}> + Activity + + + +
+
+
+
+ Connected chain: {chainId == config.CHAIN_INFO.evmChainId ? 'Aura' : 'Story'} •{' '} + { + switchChain({ + chainId: + chainId == config.CHAIN_INFO.evmChainId ? storyChain.id : config.CHAIN_INFO.evmChainId, + }) + }}> + {chainId == config.CHAIN_INFO.evmChainId ? 'Switch to Story' : 'Switch to Aura'} + +
+ {account.noncustodialWalletAddress && ( +
+
setShowWalletDetail(!showWalletDetail)}> + + + + {t('My wallet')} +
+ {showWalletDetail && ( +
+
+
{`${t('Wallet')}`}
+
+
{`${shorten( + account?.activeWalletAddress, + 8, + 8 + )}`}
+
+
- } - -
- {!account?.noncustodialWalletAddress ? ( - <> - - - ) : null} - {(address != account?.activeWalletAddress || !isConnected) && - account?.noncustodialWalletAddress && ( -
- - - - Wallet not connected + + {t('Copied')} +
- )} -
+
{`${t('Balance')}`}
+
+
+ {hideBalance + ? '********' + : `${(+walletBalance?.data?.formatted || 0).toFixed(2)} ${ + walletBalance?.data?.symbol || 'AURA' + }`} +
+ + { +
+ {hideBalance ? ( + setHideBalance(false)} + className='w-[18px] h-[18px] cursor-pointer' + /> + ) : ( + setHideBalance(true)} + className='w-[18px] h-[18px] cursor-pointer' + /> + )} +
+ } +
+
+ {!account?.noncustodialWalletAddress ? ( + <> + + + ) : null} + {(address != account?.activeWalletAddress || !isConnected) && + account?.noncustodialWalletAddress && ( +
+ + + + Wallet not connected +
+ )} +
+
+ )}
)} -
- )} +
{ + setOpenNavigation(false) + router.push('/profile') + }}> + + {t('My profile')} +
+
+ + )} +
{ setOpenNavigation(false) - router.push('/profile') + router.push('/characters') }}> - - {t('My profile')} + + {t('Characters')}
-
- - )} -
-
{ - setOpenNavigation(false) - router.push('/characters') - }}> - - {t('Characters')} -
-
{ - setOpenNavigation(false) - router.push('/campaigns') - }}> - - {t('Campaign')} -
-
{ - setOpenNavigation(false) - router.push('/events') - }}> - - - - {t('Event')} -
-
{ - setOpenNavigation(false) - router.push('/collections') - }}> - - - - - {t('Collection')} -
-
{ - setOpenNavigation(false) - router.push('/about-us') - }}> - - {t('About Us')} -
-
-
-
- -
{t('Language')}
+
{ + setOpenNavigation(false) + router.push('/campaigns') + }}> + + {t('Campaign')} +
+
{ + setOpenNavigation(false) + router.push('/events') + }}> + + + + {t('Event')} +
+
{ + setOpenNavigation(false) + router.push('/collections') + }}> + + + + + {t('Collection')} +
+
{ + setOpenNavigation(false) + router.push('/about-us') + }}> + + {t('About Us')}
+
+
+
+ +
{t('Language')}
+
-
- {locale == 'en' ? ( -
EN
- ) : ( -
VN
- )} +
+ {locale == 'en' ? ( +
EN
+ ) : ( +
VN
+ )} +
+
+ {account && ( +
{ + setOpenNavigation(false) + logout() + }}> + + {t('Log out')} +
+ )}
-
- {account && ( -
{ - setOpenNavigation(false) - logout() - }}> - - {t('Log out')} -
- )} -
+ + )}
) diff --git a/src/components/Header/components/UserDropdown.tsx b/src/components/Header/components/UserDropdown.tsx index 1af19780..a45352b4 100644 --- a/src/components/Header/components/UserDropdown.tsx +++ b/src/components/Header/components/UserDropdown.tsx @@ -17,6 +17,7 @@ export default function UserDropdown() { const config = getConfig() const { t } = useTranslation() const router = useRouter() + const [showActivities, setShowActivities] = useState(false) const { setMigrateWalletOpen } = useContext(ModalContext) const [isCopied, setIsCopied] = useState(false) const [showWalletDetail, setShowWalletDetail] = useState(false) @@ -66,180 +67,256 @@ export default function UserDropdown() {
-
-
{account?.name}
-
- dream-point - {formatNumber(+(+dpBalance?.data?.formatted || 0).toFixed(2))} {dpBalance?.data?.symbol || 'AURA'} -
-
-
- Connected chain: {chainId == config.CHAIN_INFO.evmChainId ? 'Aura' : 'Story'} •{' '} - { - switchChain({ - chainId: chainId == config.CHAIN_INFO.evmChainId ? storyChain.id : config.CHAIN_INFO.evmChainId, - }) - }}> - {chainId == config.CHAIN_INFO.evmChainId ? 'Switch to Story' : 'Switch to Aura'} - -
-
- {account.noncustodialWalletAddress && ( -
setShowWalletDetail(!showWalletDetail)} - className='flex items-center justify-between py-[18px] cursor-pointer'> -
- + {showActivities ? ( + <> +
+
setShowActivities(false)}> + - {t('My wallet')} + Activity +
+
+ {account?.activities?.map((act, index) => { + if (act.type == 'SUBMIT_ARTWORK') + return ( +
+ +
+
Submit
+
+
+ {act.story_artwork.name} +
+
+{formatNumber(act.amount)}DP
+
+
+
+ ) + return null + })}
- - -
- )} - {showWalletDetail && ( -
-
-
{`${t('Wallet')}`}
-
-
{`${shorten( - account?.activeWalletAddress, - 8, - 8 - )}`}
-
- + + ) : ( + <> +
+
{account?.name}
+
+
+ dream-point + {formatNumber(+(+dpBalance?.data?.formatted || 0).toFixed(2))} {dpBalance?.data?.symbol || 'AURA'} +
+
setShowActivities(true)}> + Activity + + + +
+
+
+
+ Connected chain: {chainId == config.CHAIN_INFO.evmChainId ? 'Aura' : 'Story'} •{' '} + { + switchChain({ + chainId: chainId == config.CHAIN_INFO.evmChainId ? storyChain.id : config.CHAIN_INFO.evmChainId, + }) + }}> + {chainId == config.CHAIN_INFO.evmChainId ? 'Switch to Story' : 'Switch to Aura'} + +
+
+ {account.noncustodialWalletAddress && ( +
setShowWalletDetail(!showWalletDetail)} + className='flex items-center justify-between py-[18px] cursor-pointer'> +
+ + {t('My wallet')}
- - {t('Copied')} - + + +
-
{`${t('Balance')}`}
-
-
- {hideBalance - ? '********' - : `${formatNumber(+(+walletBalance?.data?.formatted || 0).toFixed(2))} ${ - walletBalance?.data?.symbol || 'AURA' - }`} -
- - { -
- {hideBalance ? ( - - - - ) : ( + )} + {showWalletDetail && ( +
+
+
{`${t('Wallet')}`}
+
+
{`${shorten( + account?.activeWalletAddress, + 8, + 8 + )}`}
+
+ + + +
+ + {t('Copied')} + +
+
{`${t('Balance')}`}
+
+
+ {hideBalance + ? '********' + : `${formatNumber(+(+walletBalance?.data?.formatted || 0).toFixed(2))} ${ + walletBalance?.data?.symbol || 'AURA' + }`} +
+ + { +
+ {hideBalance ? ( + + + + ) : ( + + + + )} +
+ } +
+
+ {!account?.noncustodialWalletAddress ? ( + <> + + + ) : null} + {(address != account?.activeWalletAddress || !isConnected) && + account?.noncustodialWalletAddress && ( +
+ xmlns='http://www.w3.org/2000/svg'> - )} -
- } - -
- {!account?.noncustodialWalletAddress ? ( - <> - - - ) : null} - {(address != account?.activeWalletAddress || !isConnected) && account?.noncustodialWalletAddress && ( -
- - - - Wallet not connected + Wallet not connected +
+ )}
- )} +
+ )} +
router.push('/profile')} + className='py-[18px] cursor-pointer flex items-center gap-3'> + + + + {t('My profile')}
-
- )} -
router.push('/profile')} className='py-[18px] cursor-pointer flex items-center gap-3'> - - - - {t('My profile')} -
-
- - - +
+ + + - {t('Log out')} -
-
+ {t('Log out')} +
+
+ + )}
diff --git a/src/components/pages/homepage/manga.tsx b/src/components/pages/homepage/manga.tsx index 78844a5b..c5c708d7 100644 --- a/src/components/pages/homepage/manga.tsx +++ b/src/components/pages/homepage/manga.tsx @@ -21,6 +21,7 @@ export default function Manga(props: IComic) { setLineClamp(res > 3 ? 3 : res) } }, []) + console.log(props) return ( { - removeCookie('token', { path: '/', domain: '.punkga.me' }) - removeCookie('token', { path: '/', domain: '.staging.punkga.me' }) - removeCookie('token', { path: '/', domain: '.dev.punkga.me' }) + removeCookie('token', { path: '/', domain: '.app.punkga.me' }) + removeCookie('token', { path: '/', domain: '.app.staging.punkga.me' }) + removeCookie('token', { path: '/', domain: '.app.dev.punkga.me' }) } if (isSettingUp) { diff --git a/src/models/user.ts b/src/models/user.ts index 0a9eecfe..6030df69 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -40,4 +40,5 @@ export interface IUser { quests: any rank: number activeWalletAddress: string + activities: any[] } diff --git a/src/pages/events/your-city/submit/page.tsx b/src/pages/events/your-city/submit/page.tsx index 2547df93..08cd3ef0 100644 --- a/src/pages/events/your-city/submit/page.tsx +++ b/src/pages/events/your-city/submit/page.tsx @@ -42,7 +42,7 @@ function PageContent() { }) const [IPList, setIPList] = useState([]) useEffect(() => { - if (moment().tz('Asia/Ho_Chi_Minh').isAfter(moment.tz('2025-01-01', 'Asia/Ho_Chi_Minh'))) { + if (moment().tz('Asia/Ho_Chi_Minh').isAfter(moment.tz('2025-01-15', 'Asia/Ho_Chi_Minh'))) { replace('/events/your-city') } }, []) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a1c47367..db5a8c8b 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -147,7 +147,6 @@ function Home() { }) : latestComic.data?.length ? latestComic.data - .filter((data: any) => data.tags.every((lang: any) => lang.en.toLowerCase() != 'invent contest')) .filter((data) => statusFilter.length && !statusFilter.some((s) => s.key == 'All status') ? statusFilter.some((filter) => data.status.text == filter?.key)