diff --git a/app/admin/quests/dashboard/[questId]/page.tsx b/app/admin/quests/dashboard/[questId]/page.tsx index 8593af42..f5fcaa6d 100644 --- a/app/admin/quests/dashboard/[questId]/page.tsx +++ b/app/admin/quests/dashboard/[questId]/page.tsx @@ -229,7 +229,7 @@ export default function Page({ params }: QuestIdProps) { contract_calls: task.calls, }, }; - } else if(task.task_type === "custom_api"){ + } else if (task.task_type === "custom_api") { return { type: "CustomApi", data: { @@ -239,11 +239,10 @@ export default function Page({ params }: QuestIdProps) { api_href: task.href, api_url: task.api_url, api_cta: task.cta, - api_regex: task.regex - } - } + api_regex: task.regex, + }, + }; } - }); const res = await Promise.all(taskPromises); @@ -270,6 +269,9 @@ export default function Page({ params }: QuestIdProps) { await AdminService.updateBoost({ ...boostInput, hidden: !showBoost, + amount: Number(boostInput.amount), + num_of_winners: Number(boostInput.num_of_winners), + token_decimals: Number(boostInput.token_decimals), }); return; @@ -546,8 +548,7 @@ export default function Page({ params }: QuestIdProps) { cta: step.data.contract_cta, calls: JSON.parse(step.data.contract_calls), }); - } - else if(step.type === "CustomApi"){ + } else if (step.type === "CustomApi") { await AdminService.createCustomApi({ quest_id: questId.current, name: step.data.api_name, @@ -556,7 +557,7 @@ export default function Page({ params }: QuestIdProps) { regex: step.data.api_regex, href: step.data.api_href, cta: step.data.api_cta, - }) + }); } } catch (error) { showNotification(`Error adding ${step.type} task: ${error}`, "error"); @@ -666,7 +667,10 @@ export default function Page({ params }: QuestIdProps) { calls: JSON.parse(step.data.contract_calls), }); } catch (error) { - showNotification(`Error updating ${step.type} task: ${error}`, "error"); + showNotification( + `Error updating ${step.type} task: ${error}`, + "error" + ); } } else if (step.type === "CustomApi") { await AdminService.updateCustomApi({ @@ -817,7 +821,7 @@ export default function Page({ params }: QuestIdProps) { { }} + setShowDomainPopup={() => {}} hasRootDomain={false} rewardButtonTitle={questData.disabled ? "Enable" : "Disable"} onRewardButtonClick={async () => { diff --git a/components/admin/formSteps/RewardDetailsForm.tsx b/components/admin/formSteps/RewardDetailsForm.tsx index 61be1ce5..253004e9 100644 --- a/components/admin/formSteps/RewardDetailsForm.tsx +++ b/components/admin/formSteps/RewardDetailsForm.tsx @@ -54,18 +54,19 @@ const RewardDetailsForm: FunctionComponent = ({ const handleBoostTokenChange = useCallback( (event: SelectChangeEvent) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const tokenAddress = event.target.value; + const tokenName = + Object.keys(TOKEN_ADDRESS_MAP[network]).find( + (key) => TOKEN_ADDRESS_MAP[network][key] === tokenAddress + ) || ""; setBoostInput((prev: any) => ({ ...prev, - token: event.target.value, - // token decimals is a value which has different tokens which we support and use their decimals here + token: tokenAddress, token_decimals: - TOKEN_DECIMAL_MAP[ - event.target.value as keyof typeof TOKEN_DECIMAL_MAP - ], + TOKEN_DECIMAL_MAP[tokenName as keyof typeof TOKEN_DECIMAL_MAP], })); }, - [setBoostInput] + [setBoostInput, network] ); return ( @@ -142,7 +143,7 @@ const RewardDetailsForm: FunctionComponent = ({ handleChange={handleBoostTokenChange} options={Object.keys(TOKEN_ADDRESS_MAP[network]).map((eachItem) => { return { - value: eachItem, + value: TOKEN_ADDRESS_MAP[network][eachItem], label: eachItem, }; })} diff --git a/constants/common.ts b/constants/common.ts index 38b33159..7adf9c5b 100644 --- a/constants/common.ts +++ b/constants/common.ts @@ -32,7 +32,7 @@ export const TOP_50_TAB_STRING = "Top 50"; export const rankOrder = [1, 2, 3]; export const rankOrderMobile = [1, 2, 3]; -export const TOKEN_ADDRESS_MAP = { +export const TOKEN_ADDRESS_MAP: Record> = { MAINNET: { USDC: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", ETH: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", diff --git a/public/layerakira/favicon.ico b/public/layerakira/favicon.ico new file mode 100644 index 00000000..538cf325 Binary files /dev/null and b/public/layerakira/favicon.ico differ diff --git a/public/layerakira/raven.webp b/public/layerakira/raven.webp new file mode 100644 index 00000000..976ff14f Binary files /dev/null and b/public/layerakira/raven.webp differ