Skip to content

Commit

Permalink
update round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
imhson committed Oct 17, 2024
1 parent 4d80069 commit 34867b2
Show file tree
Hide file tree
Showing 9 changed files with 411 additions and 43 deletions.
1 change: 1 addition & 0 deletions public/locales/vn/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
"Login to continue": "Đăng nhập để tiếp tục",
"Like": "Thích",
"Unlike": "Bỏ thích",
"Liked": "Đã thích",
"Back to map": "Quay về",
"Submission Portal": "Cổng gửi bài thi",
"Round 1": "Vòng 1",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/pages/events/ava-2024/map/character/collected/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default function Event() {
</div>
<div className='flex gap-1.5 mt-4'>
<Button size='sm' color='neautral' className='!w-full' onClick={likeHandler}>
{t(isLiked ? 'Unlike' : 'Like')}
{t(isLiked ? 'Liked' : 'Like')}
</Button>
</div>
</div>
Expand Down Expand Up @@ -352,7 +352,7 @@ export default function Event() {
</div>
<div className='flex gap-1.5 mt-4'>
<Button size='sm' color='neautral' className='!w-full' onClick={likeHandler}>
{t(isLiked ? 'Unlike' : 'Like')}
{t(isLiked ? 'Liked' : 'Like')}
</Button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/events/ava-2024/map/character/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export default function Event() {
</Button>
)}
<Button size='sm' color='neautral' className='!w-full' onClick={likeHandler}>
{t(isLiked ? 'Unlike' : 'Like')}
{t(isLiked ? 'Liked' : 'Like')}
</Button>
</div>
</div>
Expand Down Expand Up @@ -571,7 +571,7 @@ export default function Event() {
</Button>
)}
<Button size='sm' color='neautral' className='!w-full' onClick={likeHandler}>
{t(isLiked ? 'Unlike' : 'Like')}
{t(isLiked ? 'Liked' : 'Like')}
</Button>
</div>
</div>
Expand Down
40 changes: 40 additions & 0 deletions src/pages/events/ava-2024/map/manga-room/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import HeadComponent from 'components/Head'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import Layout from 'components/Layout'
import PageContent from './page'
export default function Page(props) {
if (props.justHead || props.pageProps?.justHead) {
return <HeadComponent data={props.pageProps?.metadata || props.metadata} />
}
return (
<>
<HeadComponent data={props.pageProps?.metadata || props.metadata} />
<PageContent />
</>
)
}
Page.getLayout = function getLayout(page) {
return <Layout>{page}</Layout>
}
export const getServerSideProps = async (context) => {
const props = {
image:
context.locale == 'vn'
? 'https://punkga.me/assets/images/ava-thumb.png'
: 'https://punkga.me/assets/images/ava-thumb.png',
title:
context.locale == 'vn'
? `AVA Grand Contest 2024 - Find Your Artistic Voice`
: `AVA Grand Contest 2024 - Find Your Artistic Voice`,
description:
context.locale == 'vn'
? `Tham gia AVA Grand Contest 2024 trên PunkgaMe để chứng tỏ bản sắc nghệ thuật của riêng bạn và giành lấy phần thưởng lên tới 150 Triệu VNĐ!`
: `Join the AVA Grand Contest 2024 on Punkga Me to showcase your talent and win prizes up to 6,000 USD. Prove the power of true art in an AI-driven world!`,
}
return {
props: {
metadata: props,
...(await serverSideTranslations(context?.locale!, ['common'])),
},
}
}
328 changes: 328 additions & 0 deletions src/pages/events/ava-2024/map/manga-room/page.tsx

Large diffs are not rendered by default.

62 changes: 27 additions & 35 deletions src/pages/events/ava-2024/map/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export default function Event() {
const [active, setActive] = useState(0)
const [characterRoomStep, setCharacterRoomStep] = useState<number>(-1)
const [characterDone, setCharacterDone, removeCharacterDone] = useLocalStorage<boolean>('character-done', false)
const [mangaRoomStep, setMangaRoomStep] = useState<number>(-1)
const [mangaDone, setMangaDone, removeMangaDone] = useLocalStorage<boolean>('manga-done', false)
const [mangaRoomStep, setMangaRoomStep] = useState<number>(-1)
const [artRoomStep, setArtRoomStep] = useState<number>(-1)
const [artDone, setArtDone, removeArtDone] = useLocalStorage<boolean>('art-done', false)
const [campainRoomStep, setCampainRoomStep] = useState<number>(-1)
Expand Down Expand Up @@ -298,11 +298,15 @@ export default function Event() {
<Button
onClick={() => {
if (active == 3) {
// currentSetStep.current = setMangaRoomStep
// setMangaRoomStep(0)
// setArtRoomStep(-1)
// setCampainRoomStep(-1)
// setCharacterRoomStep(-1)
currentSetStep.current = setMangaRoomStep
if (!characterDone) {
setMangaRoomStep(0)
setArtRoomStep(-1)
setCampainRoomStep(-1)
setCharacterRoomStep(-1)
} else {
router.push(`/events/ava-2024/map/manga-room`)
}
} else {
setActive(3)
}
Expand All @@ -311,21 +315,10 @@ export default function Event() {
<>
<Image src={Room3} alt='' className='w-full h-full' />
<div className='font-jaro absolute whitespace-nowrap top-[40%] left-1/2 -translate-y-1/2 -translate-x-1/2 border border-white bg-black px-2 rounded-md text-white flex items-center gap-1 lg:gap-2 text-sm lg:text-2xl'>
<svg
xmlns='http://www.w3.org/2000/svg'
width='20'
height='22'
viewBox='0 0 20 22'
fill='none'
className='w-4 h-4'>
<path
fill-rule='evenodd'
clip-rule='evenodd'
d='M3.25 9.33501V7.15663C3.25 3.20413 6.27208 0 10 0C13.7279 0 16.75 3.20413 16.75 7.15663V9.33501C17.8648 9.42328 18.5907 9.64612 19.1213 10.2087C20 11.1403 20 12.6397 20 15.6386C20 18.6374 20 20.1368 19.1213 21.0684C18.2426 22 16.8284 22 14 22H6C3.17157 22 1.75736 22 0.87868 21.0684C0 20.1368 0 18.6374 0 15.6386C0 12.6397 0 11.1403 0.87868 10.2087C1.40931 9.64612 2.13525 9.42328 3.25 9.33501ZM4.75 7.15663C4.75 4.08246 7.10051 1.59036 10 1.59036C12.8995 1.59036 15.25 4.08246 15.25 7.15663V9.2809C14.867 9.27711 14.4515 9.27711 14 9.27711H6C5.54849 9.27711 5.13301 9.27711 4.75 9.2809V7.15663ZM12 15.6386C12 16.8097 11.1046 17.759 10 17.759C8.89543 17.759 8 16.8097 8 15.6386C8 14.4674 8.89543 13.5181 10 13.5181C11.1046 13.5181 12 14.4674 12 15.6386Z'
fill='white'
/>
<svg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12' fill='none'>
<path d='M10 6L0.25 11.6292L0.250001 0.370834L10 6Z' fill='white' />
</svg>
{t('Unlock on round 2')}
{t('Manga room')}
</div>
</>
</Button>
Expand Down Expand Up @@ -448,26 +441,25 @@ export default function Event() {
</>
</Button>
<Button
// onClick={() => {
// currentSetStep.current = setMangaRoomStep
// setMangaRoomStep(0)
// setArtRoomStep(-1)
// setCampainRoomStep(-1)
// setCharacterRoomStep(-1)
// }}
onClick={() => {
if (!mangaDone) {
currentSetStep.current = setMangaRoomStep
setMangaRoomStep(0)
setArtRoomStep(-1)
setCampainRoomStep(-1)
setCharacterRoomStep(-1)
} else {
router.push(`/events/ava-2024/map/manga-room`)
}
}}
className='absolute top-[.77%] -right-[.2%] w-[30.45%] opacity-0 hover:opacity-100'>
<>
<Image src={Room3} alt='' className='w-full h-full' />
<div className='font-jaro absolute whitespace-nowrap top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 border border-white bg-black px-2 rounded-md text-white flex items-center gap-1 lg:gap-2 text-sm lg:text-2xl'>
<svg xmlns='http://www.w3.org/2000/svg' width='20' height='22' viewBox='0 0 20 22' fill='none'>
<path
fill-rule='evenodd'
clip-rule='evenodd'
d='M3.25 9.33501V7.15663C3.25 3.20413 6.27208 0 10 0C13.7279 0 16.75 3.20413 16.75 7.15663V9.33501C17.8648 9.42328 18.5907 9.64612 19.1213 10.2087C20 11.1403 20 12.6397 20 15.6386C20 18.6374 20 20.1368 19.1213 21.0684C18.2426 22 16.8284 22 14 22H6C3.17157 22 1.75736 22 0.87868 21.0684C0 20.1368 0 18.6374 0 15.6386C0 12.6397 0 11.1403 0.87868 10.2087C1.40931 9.64612 2.13525 9.42328 3.25 9.33501ZM4.75 7.15663C4.75 4.08246 7.10051 1.59036 10 1.59036C12.8995 1.59036 15.25 4.08246 15.25 7.15663V9.2809C14.867 9.27711 14.4515 9.27711 14 9.27711H6C5.54849 9.27711 5.13301 9.27711 4.75 9.2809V7.15663ZM12 15.6386C12 16.8097 11.1046 17.759 10 17.759C8.89543 17.759 8 16.8097 8 15.6386C8 14.4674 8.89543 13.5181 10 13.5181C11.1046 13.5181 12 14.4674 12 15.6386Z'
fill='white'
/>
<svg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12' fill='none'>
<path d='M10 6L0.25 11.6292L0.250001 0.370834L10 6Z' fill='white' />
</svg>
{t('Unlock on round 2')}
{t('Manga room')}
</div>
</>
</Button>
Expand Down
11 changes: 7 additions & 4 deletions src/pages/events/ava-2024/map/submit-portal/round2Submission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,23 @@ export default function Round2Submission() {
language_id: data.mainLanguage.language_id,
is_main_language: true,
description: data.mainLanguage.description,
image_url: data.mainLanguage.link,
},
{
title: data.mainLanguage.title,
language_id: data.mainLanguage.language_id,
title: data.secondaryLanguage.title,
language_id: data.secondaryLanguage.language_id,
is_main_language: false,
description: data.mainLanguage.description,
description: data.secondaryLanguage.description,
image_url: data.secondaryLanguage.link,
},
]
: [
: [
{
title: data.mainLanguage.title,
language_id: data.mainLanguage.language_id,
is_main_language: true,
description: data.mainLanguage.description,
image_url: data.mainLanguage.link,
},
]
)
Expand Down
4 changes: 4 additions & 0 deletions src/services/eventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ export const eventService = {
getSubmissions: async () => await privateAxios.get(`${getConfig().REST_API_URL}/story-event/submission`),
submitManga: async (payload) =>
await privateAxios.post(`${getConfig().REST_API_URL}/story-event/submission/manga`, payload),
getManga: async (page) =>
await privateAxios.get(
`${getConfig().REST_API_URL}/story-event/manga?limit=20&offset=${(page - 1) * 20}`
),
},
}

0 comments on commit 34867b2

Please sign in to comment.