From 15d4b4559bd78dd2919791a7a4ec971f8162cc64 Mon Sep 17 00:00:00 2001 From: imhson Date: Thu, 1 Aug 2024 11:55:21 +0700 Subject: [PATCH 1/5] update invent contest tag --- .../pages/event/kaia-island/Artwork.tsx | 29 +++++++++++++------ .../pages/event/wow-yourself/ComicList.tsx | 6 ++-- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/components/pages/event/kaia-island/Artwork.tsx b/src/components/pages/event/kaia-island/Artwork.tsx index bc1b838f..8a10a51d 100644 --- a/src/components/pages/event/kaia-island/Artwork.tsx +++ b/src/components/pages/event/kaia-island/Artwork.tsx @@ -9,6 +9,11 @@ import So from 'components/pages/event/kaia-island/assets/so.png' import LineFooter from 'components/pages/event/kaia-island/assets/Line.svg' import Pin from 'components/pages/event/kaia-island/assets/pin.svg' import NavButton from './assets/bt_left.svg' +import useApi from 'src/hooks/useApi' +import { IComic } from 'src/models/comic' +import { getLatestComic } from 'src/services' +import Comic2 from 'components/pages/homepage/comic2' +import DummyComic from 'components/DummyComponent/comic' export default function Artworks() { const { t } = useTranslation() const { data, isLoading } = useSWR( @@ -17,6 +22,15 @@ export default function Artworks() { ) const [tab, setTab] = useState(1) const [page, setPage] = useState(1) + const latestComic = useApi(getLatestComic, true, []) + const [useableComic, setUseableComic] = useState() + useEffect(() => { + const comic = latestComic.data?.filter( + (data: any) => + data.tags.some((lang: any) => lang.en.toLowerCase() === 'invent contest') + ) + setUseableComic(comic) + }, [latestComic.data]) useEffect(() => { setPage(1) }, [tab]) @@ -76,7 +90,7 @@ export default function Artworks() { Round 2 )} - {!!data?.round3?.length && ( + {!!useableComic?.length && (
setTab(3)} className={`w-full cursor-pointer text-center max-w-[104px] py-1 px-2 ${ @@ -111,14 +125,11 @@ export default function Artworks() { ) : ( <> - {data?.round3?.slice((page - 1) * 10, page * 10)?.map((artwork, index) => ( - a.image == artwork.image)} - allArtworks={data?.round3} - key={artwork?.title + index} - /> - ))} + {latestComic.loading + ? Array.apply(null, Array(10)).map((d, index) => ) + : useableComic?.length + ? useableComic.map((data, index) => ) + : null} )}
diff --git a/src/components/pages/event/wow-yourself/ComicList.tsx b/src/components/pages/event/wow-yourself/ComicList.tsx index 712489e8..b294d533 100644 --- a/src/components/pages/event/wow-yourself/ComicList.tsx +++ b/src/components/pages/event/wow-yourself/ComicList.tsx @@ -12,8 +12,10 @@ export default function ComicList() { const latestComic = useApi(getLatestComic, true, []) const [useableComic, setUseableComic] = useState() useEffect(() => { - const comic = latestComic.data?.filter((data: any) => - data.tags.some((lang: any) => lang.en.toLowerCase() === 'invent contest') + const comic = latestComic.data?.filter( + (data: any) => + data.tags.some((lang: any) => lang.en.toLowerCase() === 'invent contest') && + data.tags.some((lang: any) => lang.en.toLowerCase() === 'wow yourself') ) setUseableComic(comic) }, [latestComic.data]) From 53305bad26bf427fb01e3662c7d0f20a8da83a10 Mon Sep 17 00:00:00 2001 From: imhson Date: Thu, 1 Aug 2024 12:06:39 +0700 Subject: [PATCH 2/5] update invent contest tag --- src/components/pages/event/kaia-island/Artwork.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/pages/event/kaia-island/Artwork.tsx b/src/components/pages/event/kaia-island/Artwork.tsx index 8a10a51d..0e5cb8ee 100644 --- a/src/components/pages/event/kaia-island/Artwork.tsx +++ b/src/components/pages/event/kaia-island/Artwork.tsx @@ -27,7 +27,8 @@ export default function Artworks() { useEffect(() => { const comic = latestComic.data?.filter( (data: any) => - data.tags.some((lang: any) => lang.en.toLowerCase() === 'invent contest') + data.tags.some((lang: any) => lang.en.toLowerCase() === 'invent contest') && + data.tags.some((lang: any) => lang.en.toLowerCase() === 'kaia insland') ) setUseableComic(comic) }, [latestComic.data]) From 161d53528d9d3c94a72c317a0495c8a32ee94d31 Mon Sep 17 00:00:00 2001 From: imhson Date: Thu, 8 Aug 2024 15:13:43 +0700 Subject: [PATCH 3/5] fix image --- src/pages/collections/collection.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/collections/collection.tsx b/src/pages/collections/collection.tsx index b50be40d..c0567525 100644 --- a/src/pages/collections/collection.tsx +++ b/src/pages/collections/collection.tsx @@ -33,12 +33,12 @@ function Collection() { return (
From ab0c097dcbcc3dc81345e9c9c957f8726d2b62c9 Mon Sep 17 00:00:00 2001 From: imhson Date: Thu, 8 Aug 2024 17:31:56 +0700 Subject: [PATCH 4/5] fix bug --- src/components/Modal/ConnectWalletModal.tsx | 6 ++++-- src/context/index.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Modal/ConnectWalletModal.tsx b/src/components/Modal/ConnectWalletModal.tsx index 15070089..1cb4ade9 100644 --- a/src/components/Modal/ConnectWalletModal.tsx +++ b/src/components/Modal/ConnectWalletModal.tsx @@ -10,7 +10,7 @@ import { sepolia } from 'viem/chains' import { Connector, useConnect, useDisconnect } from 'wagmi' export default function ConnectWalletModal() { const { connectWalletOpen: show } = useContext(ModalContext) - const { connectHandler } = useContext(Context) + const { connectHandler, account } = useContext(Context) const { connectors, connectAsync: wagmiConnect } = useConnect() const { disconnect: wagmiDisconnect, disconnectAsync } = useDisconnect() const [installed, setInstalled] = useState([]) @@ -96,7 +96,9 @@ export default function ConnectWalletModal() { { onSuccess: (data) => { setLoading(false) - connectHandler(data) + if (data?.accounts[0] == account?.activeWalletAddress) { + connectHandler(data) + } }, onError: (props) => { diff --git a/src/context/index.tsx b/src/context/index.tsx index bb07f99f..5c1c3ca0 100644 --- a/src/context/index.tsx +++ b/src/context/index.tsx @@ -153,7 +153,7 @@ function ContextProvider({ children }: any) { chainId: config.CHAIN_INFO.evmChainId, }, { - onSuccess: signConnectMessage, + onSuccess: () => signConnectMessage(data), onError: (error) => console.error(error), } ) From 1289b251891beb91aee9ce6d3cfb11f81430a6c0 Mon Sep 17 00:00:00 2001 From: imhson Date: Tue, 13 Aug 2024 16:53:49 +0700 Subject: [PATCH 5/5] fix tag --- src/components/pages/event/kaia-island/Artwork.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pages/event/kaia-island/Artwork.tsx b/src/components/pages/event/kaia-island/Artwork.tsx index 0e5cb8ee..bc9988c3 100644 --- a/src/components/pages/event/kaia-island/Artwork.tsx +++ b/src/components/pages/event/kaia-island/Artwork.tsx @@ -28,7 +28,7 @@ export default function Artworks() { const comic = latestComic.data?.filter( (data: any) => data.tags.some((lang: any) => lang.en.toLowerCase() === 'invent contest') && - data.tags.some((lang: any) => lang.en.toLowerCase() === 'kaia insland') + data.tags.some((lang: any) => lang.en.toLowerCase() === 'kaia island') ) setUseableComic(comic) }, [latestComic.data])