diff --git a/packages/frontend/src/pages/Token/Communities.tsx b/packages/frontend/src/pages/Token/Communities.tsx new file mode 100644 index 00000000..2ff04f33 --- /dev/null +++ b/packages/frontend/src/pages/Token/Communities.tsx @@ -0,0 +1,89 @@ +/* eslint-disable prettier/prettier */ +/* eslint-disable import/no-unused-modules */ +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 + + + + ) +} \ No newline at end of file diff --git a/packages/frontend/src/pages/Token/index.tsx b/packages/frontend/src/pages/Token/index.tsx index fc3dac98..26dd1450 100644 --- a/packages/frontend/src/pages/Token/index.tsx +++ b/packages/frontend/src/pages/Token/index.tsx @@ -119,3 +119,21 @@ export default function TokenPage() { ) } + + +import Communities from './Communities' + +- +- {/**Add token community import umder this components*/} +- +-77 {liquidityLockSafety !== Safety.SAFE && ( +-78 + + + )} + + + {/**Add token community details */} + + {onlyVisibleToYou} + 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', +})