diff --git a/packages/core/src/utils/contract.ts b/packages/core/src/utils/contract.ts index 57244a23..494d47cb 100644 --- a/packages/core/src/utils/contract.ts +++ b/packages/core/src/utils/contract.ts @@ -1,4 +1,4 @@ -import { Call, CallData, constants, hash, ProviderInterface, selector } from 'starknet' +import { Call, CallData, constants, hash, ProviderInterface } from 'starknet' import { Entrypoint, MULTICALL_ADDRESSES } from '../constants' diff --git a/packages/frontend/src/pages/Token/Communities.tsx b/packages/frontend/src/pages/Token/Communities.tsx new file mode 100644 index 00000000..d7a3d644 --- /dev/null +++ b/packages/frontend/src/pages/Token/Communities.tsx @@ -0,0 +1,83 @@ +import { zodResolver } from '@hookform/resolvers/zod' +import { useCallback } from 'react' +import { useForm } from 'react-hook-form' +import { PrimaryButton } from 'src/components/Button' +import Input from 'src/components/Input' +import Box from 'src/theme/components/Box' +import { Column } from 'src/theme/components/Flex' +import * as Text from 'src/theme/components/Text' +import { z } from 'zod' + +import * as styles from './style.css' + +// zod schemes +const schema = z.object({ + website: z.string().url().optional(), + telegram: z.string().regex(/^https?:\/\/(t\.me|telegram\.me)\/[a-zA-Z0-9_]{5,}$/), + twitter: z.string().regex(/^https?:\/\/(twitter\.com|x\.com)\/[a-zA-Z0-9_]{1,15}$/), + discord: z.string().regex(/^https?:\/\/(discord\.gg|discord\.com\/invite)\/[a-zA-Z0-9-]+$/), +}) + +export default function Communities() { + const { + register, + handleSubmit, + setValue, + formState: { errors }, + } = useForm>({ + resolver: zodResolver(schema), + }) + + const setCommunities = useCallback(async (data: z.infer) => { + console.log('data: ', data) + }, []) + + return ( + + Website and Communities + + + Website + + + + + {errors.website?.message ? {errors.website.message} : null} + + + + + Telegram + + + + + {errors.telegram?.message ? {errors.telegram.message} : null} + + + + + Twitter / X + + + + + {errors.twitter?.message ? {errors.twitter.message} : null} + + + + + Discord + + + + + {errors.discord?.message ? {errors.discord.message} : null} + + + + Submit + + + ) +} diff --git a/packages/frontend/src/pages/Token/LaunchForm/Confirm/template.tsx b/packages/frontend/src/pages/Token/LaunchForm/Confirm/template.tsx index cae1d588..1a0c1582 100644 --- a/packages/frontend/src/pages/Token/LaunchForm/Confirm/template.tsx +++ b/packages/frontend/src/pages/Token/LaunchForm/Confirm/template.tsx @@ -112,8 +112,8 @@ export default function LaunchTemplate({ liquidityPrice, teamAllocationPrice, pr loading ? 'Loading...' : hasEnoughQuoteTokenBalance - ? `Launch on ${amm}` - : `Insufficient ${quoteToken.symbol} balance` + ? `Launch on ${amm}` + : `Insufficient ${quoteToken.symbol} balance` } onNext={next} disableNext={loading || !hasEnoughQuoteTokenBalance} diff --git a/packages/frontend/src/pages/Token/index.tsx b/packages/frontend/src/pages/Token/index.tsx index fc3dac98..17452f95 100644 --- a/packages/frontend/src/pages/Token/index.tsx +++ b/packages/frontend/src/pages/Token/index.tsx @@ -12,6 +12,7 @@ import * as Text from 'src/theme/components/Text' import { vars } from 'src/theme/css/sprinkles.css' import CollectFees from './CollectFees' +import Communities from './Communities' import IncreaseLiquidityLock from './IncreaseLiquidityLock' import AMMForm from './LaunchForm/AMM' import ConfirmForm from './LaunchForm/Confirm' @@ -79,6 +80,12 @@ export default function TokenPage() { {onlyVisibleToYou} )} + + + {/**Add token community details */} + + {onlyVisibleToYou} + ) } else if (memecoin.isOwner) { diff --git a/packages/frontend/src/pages/Token/style.css.ts b/packages/frontend/src/pages/Token/style.css.ts index 9531a545..075a5515 100644 --- a/packages/frontend/src/pages/Token/style.css.ts +++ b/packages/frontend/src/pages/Token/style.css.ts @@ -58,3 +58,8 @@ export const dropdownRow = style([ }, }), ]) + +export const inputLabel = sprinkles({ + marginLeft: '8', + fontWeight: 'medium', +}) diff --git a/packages/tg-bot/src/utils/constants.ts b/packages/tg-bot/src/utils/constants.ts index 043d4fea..914446dd 100644 --- a/packages/tg-bot/src/utils/constants.ts +++ b/packages/tg-bot/src/utils/constants.ts @@ -1 +1 @@ -export const PERCENTAGE_INPUT_PRECISION = 2 +export const PERCENTAGE_INPUT_PRECISION = 2