Skip to content

Commit ec71886

Browse files
committed
Merge branch 'main' of github.com:icon-project/sodax-frontend into release/sdk
2 parents d80b5d4 + 433a6aa commit ec71886

File tree

75 files changed

+908
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+908
-267
lines changed

apps/web/app/(apps)/migrate/_components/success-dialog.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use client';
22

33
import Image from 'next/image';
4+
import Link from 'next/link';
45
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogClose } from '@/components/ui/dialog';
5-
import { XIcon } from 'lucide-react';
6-
6+
import { ExternalLinkIcon, XIcon } from 'lucide-react';
7+
import { DISCORD_ROUTE } from '@/constants/routes';
78
interface SuccessDialogProps {
89
open: boolean;
910
onOpenChange: (open: boolean) => void;
@@ -31,11 +32,15 @@ export function SuccessDialog({ open, onOpenChange }: SuccessDialogProps) {
3132
Your new assets are now in your wallet. Make sure you have native gas to transact with them.
3233
</p>
3334
</div>
34-
<div className="text-espresso font-['InterRegular'] font-medium leading-[1.4] text-(size:--body-comfortable)">
35+
<div className="text-espresso font-['InterRegular'] font-medium leading-[1.4] text-(size:--body-comfortable) flex flex-wrap items-center gap-1">
3536
Need help?{' '}
36-
<span className="underline hover:text-cherry-brighter transition-colors cursor-pointer hover:font-bold">
37-
Join our Discord
38-
</span>
37+
<Link
38+
href={DISCORD_ROUTE}
39+
target="_blank"
40+
className="inline-flex gap-1 items-center underline hover:text-cherry-brighter transition-colors cursor-pointer hover:font-bold"
41+
>
42+
Get support on Discord <ExternalLinkIcon className="w-4 h-4" />
43+
</Link>
3944
</div>
4045
</DialogContent>
4146
</Dialog>

apps/web/app/(apps)/partner-dashboard/utils/enrichBalancesWithUsdPrices.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// apps/web/app/(apps)/partner-dashboard/utils/enrichBalancesWithUsdPrices.ts
21
import { getAssetUsdPrice } from '@/lib/getAssetUsdPrice';
32
import type { PartnerFeeClaimAssetBalance } from '@sodax/sdk';
43

apps/web/app/(apps)/save/_components/asset-list/deposit-input-amount.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useRouter } from 'next/navigation';
1616
import AssetMetrics from './asset-metrics';
1717
import { useTokenSupplyBalances } from '@/hooks/useTokenSupplyBalances';
1818
import { useReservesUsdFormat } from '@sodax/dapp-kit';
19+
import { SWAP_ROUTE } from '@/constants/routes';
1920
interface DepositInputAmountProps {
2021
tokens: XToken[];
2122
onBack?: () => void;
@@ -230,7 +231,7 @@ export default function DepositInputAmount({ tokens, onBack, apy, deposits }: De
230231
<Button
231232
variant="cherry"
232233
className="w-27 mix-blend-multiply shadow-none"
233-
onMouseDown={() => router.push('/swap')}
234+
onMouseDown={() => router.push(SWAP_ROUTE)}
234235
>
235236
Get {selectedToken?.symbol}
236237
</Button>

apps/web/app/(apps)/save/_components/asset-list/no-results.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import CurrencyLogo from '@/components/shared/currency-logo';
88
import type { XToken } from '@sodax/types';
99
import { Twitter } from 'lucide-react';
1010
import { Button } from '@/components/ui/button';
11+
import { X_ROUTE } from '@/constants/routes';
1112
import { useSaveState } from '../../_stores/save-store-provider';
1213

1314
export default function NoResults() {
@@ -28,7 +29,7 @@ export default function NoResults() {
2829
}}
2930
transition={{ duration: 0.3, ease: 'easeOut' }}
3031
onClick={() => {
31-
window.open('https://x.com/gosodax', '_blank');
32+
window.open(X_ROUTE, '_blank');
3233
}}
3334
>
3435
<Item className="cursor-pointer py-5 px-0 w-full gap-(--layout-space-normal) border-none">

apps/web/app/(apps)/stake/_components/stake-input-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// apps/web/app/(apps)/stake/_components/stake-input-panel.tsx
21
import type React from 'react';
32
import { useEffect, useMemo, useState } from 'react';
43
import { useRouter } from 'next/navigation';
@@ -25,6 +24,7 @@ import { Loader2 } from 'lucide-react';
2524
import type { SpokeProvider } from '@sodax/sdk';
2625
import { parseUnits } from 'viem';
2726
import { ErrorDialog } from '@/components/shared/error-dialog';
27+
import { SWAP_ROUTE } from '@/constants/routes';
2828

2929
export function StakeInputPanel(): React.JSX.Element {
3030
const router = useRouter();
@@ -122,7 +122,7 @@ export function StakeInputPanel(): React.JSX.Element {
122122
};
123123

124124
const handleBuySoda = (): void => {
125-
router.push('/swap');
125+
router.push(SWAP_ROUTE);
126126
};
127127

128128
const handleStake = (): void => {

apps/web/app/(apps)/swap/_components/swap-confirm-dialog.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { getIntentRelayChainId, SONIC_MAINNET_CHAIN_ID } from '@sodax/types';
2525
import { getSwapTiming } from '@/lib/swap-timing';
2626
import { trackSwapCompleted } from '@/lib/analytics';
2727
import { useTokenPrice } from '@/hooks/useTokenPrice';
28+
import { DISCORD_ROUTE, X_ROUTE } from '@/constants/routes';
2829

2930
interface SwapConfirmDialogProps {
3031
open: boolean;
@@ -357,7 +358,7 @@ const SwapConfirmDialog: React.FC<SwapConfirmDialogProps> = ({
357358
<div className="text-clay-light text-(length:--body-comfortable) font-medium font-['InterRegular'] leading-tight text-center flex justify-center gap-1 items-center">
358359
Enjoying SODAX?
359360
<Link
360-
href="https://x.com/gosodax"
361+
href={X_ROUTE}
361362
target="_blank"
362363
className="flex gap-1 hover:font-bold text-clay items-center leading-[1.4]"
363364
>
@@ -368,7 +369,7 @@ const SwapConfirmDialog: React.FC<SwapConfirmDialogProps> = ({
368369
<div className="text-clay-light text-(length:--body-comfortable) font-medium font-['InterRegular'] leading-tight text-center flex justify-center gap-1 items-center">
369370
Need help?
370371
<Link
371-
href="https://discord.gg/xM2Nh4S6vN"
372+
href={DISCORD_ROUTE}
372373
target="_blank"
373374
className="flex gap-1 hover:font-bold text-clay items-center leading-[1.4]"
374375
>

apps/web/app/(apps)/swap/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { calculateMaxAvailableAmount, formatBalance } from '@/lib/utils';
2121
import { motion } from 'framer-motion';
2222
import { itemVariants, listVariants } from '@/constants/animation';
2323
import { getSwapTiming } from '@/lib/swap-timing';
24+
import { DISCORD_ROUTE } from '@/constants/routes';
2425

2526
export default function SwapPage() {
2627
const { inputToken, outputToken, inputAmount, isSwapAndSend, customDestinationAddress, slippageTolerance } =
@@ -259,7 +260,7 @@ export default function SwapPage() {
259260
<div className="mt-(--layout-space-comfortable) text-clay-light text-(length:--body-comfortable) font-medium font-['InterRegular'] leading-tight flex gap-1 items-center">
260261
Need help?
261262
<Link
262-
href="https://x.com/sodaxlabs"
263+
href={DISCORD_ROUTE}
263264
target="_blank"
264265
className="flex gap-1 hover:font-bold text-clay items-center leading-[1.4]"
265266
>

apps/web/app/cms/articles/[id]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { redirect } from "next/navigation";
2+
import { CMS_ARTICLES_ROUTE, CMS_LOGIN_ROUTE } from "@/constants/routes";
23
import { requirePermission } from "@/lib/auth-utils";
34
import { ArticleForm } from "@/components/cms/article-form";
45
import { getDb } from "@/lib/db";
@@ -21,11 +22,11 @@ export default async function EditArticlePage({ params }: PageProps) {
2122
const article = await collection.findOne({ _id: new ObjectId(id) });
2223

2324
if (!article) {
24-
redirect("/cms/articles");
25+
redirect(CMS_ARTICLES_ROUTE);
2526
}
2627

2728
return <ArticleForm article={article} />;
2829
} catch (error) {
29-
redirect("/cms/login");
30+
redirect(CMS_LOGIN_ROUTE);
3031
}
3132
}

apps/web/app/cms/articles/new/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { redirect } from "next/navigation";
2+
import { CMS_DASHBOARD_ROUTE } from "@/constants/routes";
23
import { requirePermission } from "@/lib/auth-utils";
34
import { ArticleForm } from "@/components/cms/article-form";
45

@@ -10,6 +11,6 @@ export default async function CreateArticlePage() {
1011
await requirePermission("articles");
1112
return <ArticleForm />;
1213
} catch (error) {
13-
redirect("/cms/dashboard");
14+
redirect(CMS_DASHBOARD_ROUTE);
1415
}
1516
}

apps/web/app/cms/articles/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { redirect } from "next/navigation";
2+
import { CMS_DASHBOARD_ROUTE } from "@/constants/routes";
23
import { requirePermission } from "@/lib/auth-utils";
34
import { ArticlesListView } from "@/components/cms/articles-list-view";
45

@@ -10,6 +11,6 @@ export default async function ArticlesManagementPage() {
1011
await requirePermission("articles");
1112
return <ArticlesListView />;
1213
} catch (error) {
13-
redirect("/cms/dashboard");
14+
redirect(CMS_DASHBOARD_ROUTE);
1415
}
1516
}

0 commit comments

Comments
 (0)