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 21, 2024
1 parent fd254d1 commit b3b3e10
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 34 deletions.
14 changes: 7 additions & 7 deletions public/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"REDIRECT_URL": "https://dev.punkga.me",
"REDIRECT_URL": "https://staging.punkga.me",
"CHAIN_ID": "aura_6321-3",
"CHAIN_INFO": {
"chainId": "aura_6321-3",
Expand All @@ -14,13 +14,13 @@
},
"explorer": "https://euphoria.aurascan.io"
},
"API_URL": "https://hasura.dev.punkga.me",
"AUTHORIZER_URL": "https://auth.dev.punkga.me",
"AUTHORIZER_CLIENT_ID": "abd40c73-3390-4613-bc44-b5bde4796d03",
"ADMIN_URL": "https://admin.dev.punkga.me",
"REST_API_URL": "https://api.dev.punkga.me",
"API_URL": "https://hasura.staging.punkga.me",
"AUTHORIZER_URL": "https://auth.staging.punkga.me",
"AUTHORIZER_CLIENT_ID": "06c9c437-15cd-4240-b435-5d16206b46c6",
"ADMIN_URL": "https://admin.staging.punkga.me",
"REST_API_URL": "https://api.staging.punkga.me",
"IN_MAINTENANCE_MODE": false,
"GTM_ID": "GTM-PF4MH72V",
"GTM_ID": "GTM-MMT4K22K",
"SEEKHYPE_URL": "https://staging.seekhype.io/",
"WALLET_CONNECT_PROJECT_ID": "ec40291093ad80fa0def54b1fb44c8ef"
}
8 changes: 7 additions & 1 deletion public/locales/vn/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
"Enter a driver link": "Nhập link driver",
"+ Add second language": "+ Thêm ngôn ngữ thứ 2",
"Secondary language": "Ngôn ngữ thứ 2",
"IP ID info (maximum 5)": "Thông tin IP (tối đa 5)",
"IP ID info (maximum 8)": "Thông tin IP (tối đa 8)",
"Your IP used in this manga": "IP của bạn được sử dụng trong truyện",
"Select maximum 1 IP (optional)": "Chọn tối đa 1 IP (không bắt buộc)",
"Other’s IP used in this manga": "IP của thí sinh khác được sử dụng trong truyện",
Expand All @@ -448,6 +448,12 @@
"Pen name": "Nghệ danh",
"Enter your artist name": "Nhập nghệ danh của bạn",
"Tell something about yourself": "Mô tả về bản thân",
"Please fill your information": "Vui lòng điền đầy đủ thông tin",
"Your pen name has been already taken": "Nghệ danh của bạn đã được sử dụng",
"Update successfully, you are a Punkga Creator now": "Cập nhật thành công, bạn đã trở thành nhà sáng tạo nội dung của Punkga",
"Submit manga successfully. Your manga need to be approved by admin. This process may take upto 24 hours after you submitted": "Gửi tác phẩm thành công. Tác phẩm của bạn cần được phê duyệt bởi quản trị viên. Quá trình này có thể mất tới 24 giờ từ lúc bạn gửi tác phẩm",
"Some field is missing. Please check again": "Một số trường thông tin bị thiếu. Vui lòng kiểm tra lại",
"You don't own any IP": "Bạn không sở hữu IP nào",
".": "",
"": ""
}
2 changes: 1 addition & 1 deletion src/pages/events/ava-2024/map/manga-room/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function Page() {
}
}, [data?.data?.data?.story_manga])
const mangas = data?.data?.data?.story_manga
const count = Math.ceil((data?.data?.data?.story_manga_aggregate?.aggregate?.count || 1) / 6)
const count = Math.ceil((data?.data?.data?.story_manga_aggregate?.aggregate?.count || 1) / 9)
return (
<>
<div
Expand Down
100 changes: 77 additions & 23 deletions src/pages/events/ava-2024/map/submit-portal/round2Submission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function Round2Submission() {
(!data.secondaryLanguage.title || !data.secondaryLanguage.description || !data.secondaryLanguage.link)) ||
!data.selectedCollectedCharacter.length
) {
toast('Some field is missing. Please check again', {
toast(t('Some field is missing. Please check again'), {
type: 'error',
})
return
Expand Down Expand Up @@ -138,7 +138,9 @@ export default function Round2Submission() {
} else {
await mutate('get-submissions')
toast(
'Submit manga successfully. Your manga need to be approved by admin. This process may take upto 24 hours after you submitted',
t(
'Submit manga successfully. Your manga need to be approved by admin. This process may take upto 24 hours after you submitted'
),
{
type: 'success',
}
Expand All @@ -155,7 +157,7 @@ export default function Round2Submission() {
const submitCreatorInformationHandler = async (data) => {
try {
if (!data.avatar || !data.pen_name || !data.bio) {
toast('Please fill your information', {
toast(t('Please fill your information'), {
type: 'error',
})
} else {
Expand All @@ -169,7 +171,7 @@ export default function Round2Submission() {
if (res.data.errors?.[0]?.message) {
toast(
res.data.errors?.[0]?.message.includes('creators_pen_name_key')
? 'Your pen name has been already taken.'
? t('Your pen name has been already taken')
: res.data.errors?.[0]?.message,
{
type: 'error',
Expand All @@ -178,8 +180,8 @@ export default function Round2Submission() {
setLoading(false)
} else {
await getProfile()
window.scrollTo(0,0)
toast('Update successfully, you are a Punkga Creator now', {
window.scrollTo(0, 0)
toast(t('Update successfully, you are a Punkga Creator now'), {
type: 'success',
})
setLoading(false)
Expand Down Expand Up @@ -573,7 +575,7 @@ export default function Round2Submission() {
</div>
<div className='w-full max-w-[1500px] mt-8'>
<div className='rounded-md border-[3px] border-neutral-black bg-neautral-950 p-4 md:p-6'>
<div className='text-lg font-semibold'>{t('IP ID info (maximum 5)')}</div>
<div className='text-lg font-semibold'>{t('IP ID info (maximum 8)')}</div>
<div className='mt-6 space-y-8'>
<Controller
name='selectedsUserCharacter'
Expand All @@ -584,11 +586,17 @@ export default function Round2Submission() {
<div className='text-sm font-medium'>{t('Your IP used in this manga')}</div>
<div className='text-xs text-text-quatenary'>{t('Select maximum 1 IP (optional)')}</div>
</div>
<div className='grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-8'>
{availableCharacters?.user_ip?.map((data, index) => (
<Character data={data} key={index} {...field} max={1} />
))}
</div>
{availableCharacters?.user_ip.length ? (
<div className='grid bg-[#0B0B0B] rounded-lg p-6 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-8'>
{availableCharacters?.user_ip?.map((data, index) => (
<Character data={data} key={index} {...field} max={1} />
))}
</div>
) : (
<div className='w-full text-center bg-[#0B0B0B] rounded-lg p-8 text-gray-400'>
{t(`You don't own any IP`)}
</div>
)}
</div>
)}
/>
Expand All @@ -603,11 +611,47 @@ export default function Round2Submission() {
</div>
<div className='text-xs text-text-quatenary'>{t('Select maximum 3 IPs (required)')}</div>
</div>
<div className='grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-8'>
{availableCharacters?.collected?.map((data, index) => (
<Character data={data} key={index} {...field} max={3} />
))}
</div>
{availableCharacters?.collected.length ? (
<div className='grid bg-[#0B0B0B] rounded-lg p-6 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-8'>
{availableCharacters?.collected?.map((data, index) => (
<Character
data={data}
key={index}
{...field}
max={
5 -
(form.watch('selectedsUserCharacter').length +
form.watch('selectedDefaultCharacter').length) >
3
? 3
: 5 -
(form.watch('selectedsUserCharacter').length +
form.watch('selectedDefaultCharacter').length)
}
/>
))}
</div>
) : (
<div className='w-full text-center bg-[#0B0B0B] rounded-lg p-8 text-gray-400'>
{locale == 'en' ? (
<span>
You didn't collect any IP. Go to{' '}
<Link href={`/events/ava-2024/map/character`} className='text-blue-400'>
Character
</Link>{' '}
to collect IP
</span>
) : (
<span>
Bạn chưa thu thập IP nào. Truy cập trang{' '}
<Link href={`/events/ava-2024/map/character`} className='text-blue-400'>
Nhân vật
</Link>{' '}
để thu thập IP
</span>
)}
</div>
)}
</div>
)}
/>
Expand All @@ -618,11 +662,19 @@ export default function Round2Submission() {
<div className='space-y-8'>
<div>
<div className='text-sm font-medium'>{t('Punkga default IP')}</div>
<div className='text-xs text-text-quatenary'>{t('Select maximum 1 IP (optional)')}</div>
</div>
<div className='grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-8'>
<div className='grid bg-[#0B0B0B] rounded-lg p-6 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-8'>
{availableCharacters?.default?.map((data, index) => (
<Character data={data} key={index} {...field} max={1} />
<Character
data={data}
key={index}
{...field}
max={
5 -
(form.watch('selectedsUserCharacter').length +
form.watch('selectedCollectedCharacter').length)
}
/>
))}
</div>
</div>
Expand Down Expand Up @@ -651,7 +703,9 @@ const Character = ({ data, value, onChange, max }) => {
onChange(value.filter((d) => d != data.id))
} else {
if (value.length >= max) {
onChange([...value.slice(1), data.id])
if (max != 0) {
onChange([...value.slice(1), data.id])
}
} else {
onChange(value?.length ? [...value, data.id] : [data.id])
}
Expand All @@ -661,8 +715,8 @@ const Character = ({ data, value, onChange, max }) => {
<div className='space-y-4 cursor-pointer' onClick={handler}>
<Checkbox checked={selected} />
<div
className={`rounded-xl border-[3px] ${
selected ? 'border-border-brand-hover' : 'border-[#191919]'
className={`rounded-xl bg-[#191919] border-[3px] ${
selected ? 'border-border-brand-hover' : 'border-[#3D3D3D]'
} relative py-4 px-1`}>
<Image
alt=''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function SubmissionTable() {
</div>
<div className='mt-6 p-6 rounded-[10px] bg-black overflow-auto w-full'>
{submissions?.length ? (
<div className='w-full min-w-[7 00px]'>
<div className='w-full min-w-[700px]'>
<div className='grid w-full grid-cols-[8%_1fr_15%_20%_25%] text-sm font-semibold border-b border-white'>
<div className='px-2 py-4'>{t('No')}</div>
<div className='p-4'>{t('Name')}</div>
Expand Down
2 changes: 1 addition & 1 deletion src/services/eventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const eventService = {
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=6&offset=${(page - 1) * 6}`
`${getConfig().REST_API_URL}/story-event/manga?limit=9&offset=${(page - 1) * 9}`
),
},
}

0 comments on commit b3b3e10

Please sign in to comment.