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/components/pages/event/kaia-island/Artwork.tsx b/src/components/pages/event/kaia-island/Artwork.tsx index bc1b838f..bc9988c3 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,16 @@ 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') && + data.tags.some((lang: any) => lang.en.toLowerCase() === 'kaia island') + ) + setUseableComic(comic) + }, [latestComic.data]) useEffect(() => { setPage(1) }, [tab]) @@ -76,7 +91,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 +126,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 d0f6c8f3..050fb496 100644 --- a/src/components/pages/event/wow-yourself/ComicList.tsx +++ b/src/components/pages/event/wow-yourself/ComicList.tsx @@ -11,8 +11,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]) diff --git a/src/context/index.tsx b/src/context/index.tsx index 56f3e539..ab4fc764 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), } ) 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 (