Skip to content

Commit

Permalink
Merge branch 'main' of github.com:aura-nw/aura-punkga into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
imhson committed Aug 26, 2024
2 parents 11c9c11 + 1289b25 commit 89d9611
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
6 changes: 4 additions & 2 deletions src/components/Modal/ConnectWalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Connector[]>([])
Expand Down Expand Up @@ -96,7 +96,9 @@ export default function ConnectWalletModal() {
{
onSuccess: (data) => {
setLoading(false)
connectHandler(data)
if (data?.accounts[0] == account?.activeWalletAddress) {
connectHandler(data)
}
},

onError: (props) => {
Expand Down
30 changes: 21 additions & 9 deletions src/components/pages/event/kaia-island/Artwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -17,6 +22,16 @@ export default function Artworks() {
)
const [tab, setTab] = useState(1)
const [page, setPage] = useState(1)
const latestComic = useApi<IComic[]>(getLatestComic, true, [])
const [useableComic, setUseableComic] = useState<any>()
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])
Expand Down Expand Up @@ -76,7 +91,7 @@ export default function Artworks() {
Round 2
</div>
)}
{!!data?.round3?.length && (
{!!useableComic?.length && (
<div
onClick={() => setTab(3)}
className={`w-full cursor-pointer text-center max-w-[104px] py-1 px-2 ${
Expand Down Expand Up @@ -111,14 +126,11 @@ export default function Artworks() {
</>
) : (
<>
{data?.round3?.slice((page - 1) * 10, page * 10)?.map((artwork, index) => (
<Artwork
data={artwork}
index={data?.round3?.findIndex((a) => a.image == artwork.image)}
allArtworks={data?.round3}
key={artwork?.title + index}
/>
))}
{latestComic.loading
? Array.apply(null, Array(10)).map((d, index) => <DummyComic key={index} />)
: useableComic?.length
? useableComic.map((data, index) => <Comic2 key={index} {...data} />)
: null}
</>
)}
<div></div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/pages/event/wow-yourself/ComicList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export default function ComicList() {
const latestComic = useApi<IComic[]>(getLatestComic, true, [])
const [useableComic, setUseableComic] = useState<any>()
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])
Expand Down
2 changes: 1 addition & 1 deletion src/context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function ContextProvider({ children }: any) {
chainId: config.CHAIN_INFO.evmChainId,
},
{
onSuccess: signConnectMessage,
onSuccess: () => signConnectMessage(data),
onError: (error) => console.error(error),
}
)
Expand Down
4 changes: 2 additions & 2 deletions src/pages/collections/collection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ function Collection() {
return (
<div className='py-8 px-4 pk-container'>
<Image
src={locale == 'vn' ? BannerVN : Banner}
src={locale == 'vn' ? MBannerVN : MBanner}
alt=''
className='w-full aspect-[343/156] object-cover rounded-mlg overflow-hidden md:hidden'
/>
<Image
src={locale == 'vn' ? MBannerVN : MBanner}
src={locale == 'vn' ? BannerVN : Banner}
alt=''
className='w-full aspect-[1280/220] object-cover rounded-mlg overflow-hidden hidden md:block'
/>
Expand Down

0 comments on commit 89d9611

Please sign in to comment.