From 9f87642590d151962bb95e75839804d38871a08f Mon Sep 17 00:00:00 2001 From: 0xmegalodon Date: Tue, 16 Jan 2024 13:33:57 +0700 Subject: [PATCH 1/7] add manual check --- package.json | 2 + src/app/layout.tsx | 2 + src/components/ModalManage/ModalComponent.tsx | 117 +++++++++++++++++ src/components/ModalManage/index.tsx | 45 +++++++ src/components/ModalManage/styles.module.scss | 25 ++++ src/modules/Whitelist/steps/Step/index.tsx | 66 ++++++++-- .../Whitelist/steps/Step/styles.module.scss | 5 + .../Whitelist/steps/VerifyTwModal/index.tsx | 77 +++++++++++ .../steps/VerifyTwModal/styles.module.scss | 124 ++++++++++++++++++ src/modules/Whitelist/steps/index.tsx | 62 +++------ src/services/player-share.ts | 3 +- src/utils/format.ts | 14 ++ 12 files changed, 491 insertions(+), 51 deletions(-) create mode 100644 src/components/ModalManage/ModalComponent.tsx create mode 100644 src/components/ModalManage/index.tsx create mode 100644 src/components/ModalManage/styles.module.scss create mode 100644 src/modules/Whitelist/steps/VerifyTwModal/index.tsx create mode 100644 src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss diff --git a/package.json b/package.json index 4f812a247..5853f1833 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "clsx": "^2.1.0", "dayjs": "1.11.10", "ethers": "5.7.2", + "final-form": "^4.20.10", + "formik": "^2.4.5", "framer-motion": "^10.16.16", "gsap": "^3.12.4", "next": "14.0.4", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6e220da54..d9d99add5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -11,6 +11,7 @@ import StoreProvider from '@/Providers/StoreProvider'; import { XVerseProvider } from '@/Providers/xverse-context'; import { UnisatProvider } from '@/Providers/unisat-context'; import ToastOverlay from '@/components/ToastOverlay'; +import ModalManager from '@/components/ModalManage'; export const metadata: Metadata = MetadataConfig; export const viewport: Viewport = ViewportConfig; @@ -36,6 +37,7 @@ export default function RootLayout({ {children} + diff --git a/src/components/ModalManage/ModalComponent.tsx b/src/components/ModalManage/ModalComponent.tsx new file mode 100644 index 000000000..a8af2e2de --- /dev/null +++ b/src/components/ModalManage/ModalComponent.tsx @@ -0,0 +1,117 @@ +import { + Box, + Flex, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalHeader, + ModalOverlay, + ModalProps, +} from '@chakra-ui/react'; +import cx from 'classnames'; + +import styles from './styles.module.scss'; +import { ReactNode } from 'react'; +import { useDispatch } from 'react-redux'; +import { closeModal } from '@/stores/states/modal/reducer'; + +export interface ModalComponentProps { + id: string; + render: Function; + title?: string | ReactNode; + className?: string; + actions?: object; + modalProps?: ModalProps; + onClose?: Function; + theme?: 'light' | 'dark'; + contentPadding?: number; + hideCloseButton?: boolean; + size?: string; + disableBgClose?: boolean; +} + +const ModalComponent = (props: ModalComponentProps) => { + const { + id, + render, + title, + className, + actions, + modalProps, + onClose, + contentPadding, + hideCloseButton = false, + disableBgClose = false, + } = props; + + const dispatch = useDispatch(); + + const handleClose = () => { + dispatch(closeModal({ id })); + if (onClose) onClose(props); + }; + + return ( + + + + + {!!title && ( + + + {title} + + + )} + + + + + + + {render && render(actions)} + + + + ); +}; + +export default ModalComponent; diff --git a/src/components/ModalManage/index.tsx b/src/components/ModalManage/index.tsx new file mode 100644 index 000000000..0c897b011 --- /dev/null +++ b/src/components/ModalManage/index.tsx @@ -0,0 +1,45 @@ +'use client'; + +import last from 'lodash/last'; +import cx from 'classnames'; +import ModalComponent, { ModalComponentProps } from './ModalComponent'; +import styles from './styles.module.scss'; +import { closeModal, openModal } from '@/stores/states/modal/reducer'; +import { useDispatch, useSelector } from 'react-redux'; +import { modalSelector } from '@/stores/states/modal/selector'; + +const ModalManager = () => { + const modals: ModalComponentProps[] = useSelector(modalSelector) + .modals as unknown as ModalComponentProps[]; + const dispatch = useDispatch(); + + if (!modals.length) return null; + + const onBackdropClick = () => { + const id = last(modals)?.id || ''; + dispatch(closeModal({ id })); + }; + + return ( +
0 && styles.show)}> +
+ {modals.map(modal => ( + + ))} +
+ ); +}; + +export default ModalManager; diff --git a/src/components/ModalManage/styles.module.scss b/src/components/ModalManage/styles.module.scss new file mode 100644 index 000000000..cf0f603e2 --- /dev/null +++ b/src/components/ModalManage/styles.module.scss @@ -0,0 +1,25 @@ +.noPadding { + padding: 0; +} +.modalContent { + border: none; +} +.modalBody { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + &::-webkit-scrollbar { + display: none; + } +} +.modalDark { + background-color: var(--bs-gray-dark); + color: #fcfcfd; + button { + filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(10deg) + brightness(104%) contrast(102%); + } +} + +.modalButtonClose { + box-shadow: none !important; +} diff --git a/src/modules/Whitelist/steps/Step/index.tsx b/src/modules/Whitelist/steps/Step/index.tsx index 032eaa6be..08e98be2a 100644 --- a/src/modules/Whitelist/steps/Step/index.tsx +++ b/src/modules/Whitelist/steps/Step/index.tsx @@ -2,9 +2,12 @@ import s from './styles.module.scss'; import { Button, Flex, Text } from '@chakra-ui/react'; import px2rem from '@/utils/px2rem'; import cx from 'clsx'; -import React, { useMemo } from 'react'; -import AllowListStorage, { IStorageItem } from '@/utils/storage/allowlist.storage'; +import React, { useEffect, useMemo, useState } from 'react'; import HistoryMessage from '@/modules/Whitelist/HistoryMessage'; +import { useDispatch } from 'react-redux'; +import { openModal } from '@/stores/states/modal/reducer'; +import AuthenStorage from '@/utils/storage/authen.storage'; +import VerifyTwModal, { ReferralModalID } from '@/modules/Whitelist/steps/VerifyTwModal'; export enum MultiplierStep { authen, @@ -18,20 +21,45 @@ export default function ItemCommunity({ isLoading, isActive, isDone, - step + step, + secretCode }: { index: number; content: any; isLoading?: boolean; isActive?: boolean isDone?: boolean; - step?: MultiplierStep + step?: MultiplierStep; + secretCode?: string; }) { + const dispatch = useDispatch(); + const [showManualCheck, setShowManualCheck] = useState(false); + const token = AuthenStorage.getAuthenKey(); + + useEffect(() => { + if(!!token) { + setShowManualCheck(false); + } + }, [token]); const isRunning = useMemo(() => { return isActive; }, [isActive, index]); + const onClickEditRefCode = () => { + dispatch( + openModal({ + id: ReferralModalID, + title: `Enter twitter post link`, + className: s.modalContent, + // modalProps: { + // size: 'lg', + // }, + render: () => , + }), + ); + }; + return ( <>
@@ -69,11 +97,33 @@ export default function ItemCommunity({ { content?.actionText && ( - + { + step === MultiplierStep.authen && showManualCheck && ( + + Manual check + + ) } - }} isLoading={isLoading}>{content?.actionText} + ) } diff --git a/src/modules/Whitelist/steps/Step/styles.module.scss b/src/modules/Whitelist/steps/Step/styles.module.scss index 733d7ce34..a1ee935db 100644 --- a/src/modules/Whitelist/steps/Step/styles.module.scss +++ b/src/modules/Whitelist/steps/Step/styles.module.scss @@ -153,3 +153,8 @@ } } } + +.modalContent { + border-radius: 0px !important; + min-width: unset !important; +} diff --git a/src/modules/Whitelist/steps/VerifyTwModal/index.tsx b/src/modules/Whitelist/steps/VerifyTwModal/index.tsx new file mode 100644 index 000000000..96597b0c1 --- /dev/null +++ b/src/modules/Whitelist/steps/VerifyTwModal/index.tsx @@ -0,0 +1,77 @@ +import { getError } from '@/utils/error'; +import { Button } from '@chakra-ui/react'; +import { FormikProps, useFormik } from 'formik'; +import React, { useState } from 'react'; +import s from './styles.module.scss'; +import { generateTokenWithTwPost } from '@/services/player-share'; +import { toast } from 'react-hot-toast'; + +interface FormValues { + postUrl: string; +} + +export const ReferralModalID = 'ReferralModalID'; + +const VerifyTwModal = ({secretCode}: any) => { + const [isCreating, setIsCreating] = useState(false); + + const onSubmit = async (values: FormValues) => { + try { + console.log('values', values); + setIsCreating(true); + const result = await generateTokenWithTwPost(secretCode as string, formValues.postUrl); + } catch (error) { + const { message } = getError(error); + toast.error(message); + } finally { + setIsCreating(false); + } + }; + + const formik: FormikProps = useFormik({ + initialValues: { postUrl: '' } as FormValues, + onSubmit, + }); + + const formValues = React.useMemo(() => { + return formik.values; + }, [formik.values]); + + const onChangeText = (e: any) => { + formik.setValues((values: any) => ({ + ...values, + postUrl: e.target.value, + })); + }; + + console.log('formValues', formValues); + + return ( +
+
+
+
+ +
+ +
+
+
+ ); +}; + +export default VerifyTwModal; diff --git a/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss b/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss new file mode 100644 index 000000000..b11dfc7a8 --- /dev/null +++ b/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss @@ -0,0 +1,124 @@ +.container { + display: flex; + flex-direction: column; + align-items: center; + + .content { + display: flex; + flex-direction: column; + align-items: center; + + width: 100%; + } + + .title { + text-align: center; + font-size: 24px; + font-weight: 700; + + margin-top: 8px; + } + + .desc { + text-align: center; + font-size: 18px; + margin-top: 16px; + } + + .form { + width: 100%; + } + + .inputContainer { + border-radius: 0px; + background: rgba(255, 255, 255, 0.10); + border: 1px solid transparent; + display: flex; + padding: 12px; + align-items: center; + gap: 12px; + width: 100%; + margin-bottom: 16px; + } + + .input { + height: 100%; + overflow: hidden; + color: #FFF; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 140%; + background-color: transparent; + width: 100%; + + &:focus { + outline: none; + } + } + + .button { + height: 48px !important; + padding: 8px 60px !important; + border-radius: 4px !important; + background: linear-gradient(180deg, #7C3DFD 0%, #6633CE 100%) !important; + color: #fff !important; + width: 100% !important; + } + +} + +.grid { + display: flex; + flex-direction: column; + align-items: center; + + // display: grid; + // grid-template-columns: 1fr 1fr 1fr; + gap: 20px; + + // @include w-max(768px) { + // grid-template-columns: 1fr 1fr; + // } + + // @include w-max(468px) { + // grid-template-columns: 1fr; + // } + + .item { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + padding: 28px 0px; + background-color: #1C1C1C; + padding: 28px 32px; + background-color: #1C1C1C; + min-width: 380px; + width: fit-content; + + @include w-max(768px) { + min-width: 320px; + } + } + + .item_title { + text-align: center; + font-size: 16px; + margin-top: 8px; + } + + .item_desc { + text-align: center; + font-size: 28px; + margin-top: 12px; + font-weight: 800px !important; + line-height: 30px; + } + + .btn { + height: 16px; + opacity: 0.8; + cursor: pointer; + } +} diff --git a/src/modules/Whitelist/steps/index.tsx b/src/modules/Whitelist/steps/index.tsx index 62f02870f..c338a69c3 100644 --- a/src/modules/Whitelist/steps/index.tsx +++ b/src/modules/Whitelist/steps/index.tsx @@ -26,7 +26,8 @@ interface IItem { actionHandle: any, isActive?: boolean, isDone?: boolean, - step: MultiplierStep + step: MultiplierStep, + secretCode?: string } const Steps = () => { @@ -84,49 +85,24 @@ const Steps = () => { const handleVerifyTwitter = async (): Promise => { try { const result = await generateTokenWithTwPost(authenCode?.secret_code as string); - if (result) { - clearInterval(timer.current); - const twitterToken = AuthenStorage.getAuthenKey(); - if (!twitterToken || twitterToken !== result?.token) { - AuthenStorage.setAuthenKey(result?.token); - setBearerToken(result?.token); - } - setSubmitting(false); - dispatch(requestReload()); - // setHasLinkTwitter(true); - // setShowTrouble && setShowTrouble(false); - - // if (twProfile?.issued) { - // gaEventTracker( - // AlphaActions.PostTweetSignInSuccessTw, - // JSON.stringify({ - // info: { - // twitter_username: twProfile?.twitter_username, - // }, - // }), - // ); - // } else { - // gaEventTracker( - // AlphaActions.PostTweetSignUpSuccessTw, - // JSON.stringify({ - // info: { - // twitter_username: twProfile?.twitter_username, - // }, - // }), - // ); - // } - - // try { - // getReferralCode(); - // } catch (e) { - // console.log('getReferralCode', e); - // } - } + onVerifyTwSuccess(result); } catch (err) { console.log('handleVerifyTwitter', err); } }; + const onVerifyTwSuccess = (result: any) => { + if (result) { + clearInterval(timer.current); + const twitterToken = AuthenStorage.getAuthenKey(); + if (!twitterToken || twitterToken !== result?.token) { + AuthenStorage.setAuthenKey(result?.token); + setBearerToken(result?.token); + } + setSubmitting(false); + dispatch(requestReload()); + } + } const DATA_COMMUNITY = useMemo(() => { return ( @@ -138,7 +114,8 @@ const Steps = () => { actionHandle: handleShareTw, isActive: !token, isDone: !!token, - step: MultiplierStep.authen + step: MultiplierStep.authen, + secretCode: authenCode?.secret_code }, { title: 'Level up your multiplier', @@ -162,7 +139,7 @@ const Steps = () => { // }, ] ) - }, [token, needReload]); + }, [token, needReload, authenCode?.secret_code]); return ( @@ -172,10 +149,11 @@ const Steps = () => { key={index} index={index} content={item} - isLoading={index === 0 && submitting} + isLoading={item.step === MultiplierStep.authen && submitting} isActive={!!item.isActive} isDone={!!item.isDone} step={item.step} + secretCode={item?.secretCode} /> ); })} diff --git a/src/services/player-share.ts b/src/services/player-share.ts index 5239cf525..3b17459f8 100644 --- a/src/services/player-share.ts +++ b/src/services/player-share.ts @@ -18,10 +18,11 @@ export const generateToken = async (uuid: string | string[]): Promise => { return; }; -export const generateTokenWithTwPost = async (uuid: string): Promise => { +export const generateTokenWithTwPost = async (uuid: string, link?: string): Promise => { try { const res = await apiClient.post(`/bvm/generate-token-with-twitter-post`, { secret_code: uuid, + link: link }); return Object(camelCaseKeys(res)); } catch (error) { diff --git a/src/utils/format.ts b/src/utils/format.ts index 2cf74b3a3..a6b8b3532 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -160,3 +160,17 @@ export function formatString( export const zeroPad = (num: number, places: number) => String(num).padStart(places, '0'); + +export const formatMaxDecimals = (params: { value: any; maxDecimals?: number }) => { + const value = params.value; + const maxDecimals = params.maxDecimals !== undefined ? params.maxDecimals : 3; + + if ( + value && + value.toString().includes('.') && + value.toString().split('.')[1]?.length > maxDecimals + ) { + return undefined; + } + return value; +}; From 63812588eeb4a41d6892eb85dc7bc319d2703419 Mon Sep 17 00:00:00 2001 From: 0xmegalodon Date: Tue, 16 Jan 2024 13:59:18 +0700 Subject: [PATCH 2/7] test --- src/modules/Whitelist/steps/Step/index.tsx | 10 ++++++---- .../Whitelist/steps/VerifyTwModal/index.tsx | 14 ++++++++------ src/modules/Whitelist/steps/index.tsx | 5 ++++- src/services/player-share.ts | 3 ++- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/modules/Whitelist/steps/Step/index.tsx b/src/modules/Whitelist/steps/Step/index.tsx index 08e98be2a..a5cd2bc08 100644 --- a/src/modules/Whitelist/steps/Step/index.tsx +++ b/src/modules/Whitelist/steps/Step/index.tsx @@ -22,7 +22,8 @@ export default function ItemCommunity({ isActive, isDone, step, - secretCode + secretCode, + onSuccess }: { index: number; content: any; @@ -31,6 +32,7 @@ export default function ItemCommunity({ isDone?: boolean; step?: MultiplierStep; secretCode?: string; + onSuccess?: (_: any) => void; }) { const dispatch = useDispatch(); const [showManualCheck, setShowManualCheck] = useState(false); @@ -50,12 +52,12 @@ export default function ItemCommunity({ dispatch( openModal({ id: ReferralModalID, - title: `Enter twitter post link`, + title: `Missing from the leaderboard?`, className: s.modalContent, // modalProps: { // size: 'lg', // }, - render: () => , + render: () => , }), ); }; @@ -119,7 +121,7 @@ export default function ItemCommunity({ color={"#000000"} textDecoration={"underline"} onClick={onClickEditRefCode}> - Manual check + Missing from the leaderboard? ) } diff --git a/src/modules/Whitelist/steps/VerifyTwModal/index.tsx b/src/modules/Whitelist/steps/VerifyTwModal/index.tsx index 96597b0c1..4351d09be 100644 --- a/src/modules/Whitelist/steps/VerifyTwModal/index.tsx +++ b/src/modules/Whitelist/steps/VerifyTwModal/index.tsx @@ -5,6 +5,8 @@ import React, { useState } from 'react'; import s from './styles.module.scss'; import { generateTokenWithTwPost } from '@/services/player-share'; import { toast } from 'react-hot-toast'; +import { closeModal } from '@/stores/states/modal/reducer'; +import { useDispatch } from 'react-redux'; interface FormValues { postUrl: string; @@ -12,17 +14,18 @@ interface FormValues { export const ReferralModalID = 'ReferralModalID'; -const VerifyTwModal = ({secretCode}: any) => { +const VerifyTwModal = ({secretCode, onSuccess}: any) => { + const dispatch = useDispatch(); const [isCreating, setIsCreating] = useState(false); const onSubmit = async (values: FormValues) => { try { - console.log('values', values); setIsCreating(true); const result = await generateTokenWithTwPost(secretCode as string, formValues.postUrl); + onSuccess && onSuccess(result); + dispatch(closeModal({ id: ReferralModalID })); } catch (error) { - const { message } = getError(error); - toast.error(message); + toast.error('Can not verify the post.'); } finally { setIsCreating(false); } @@ -44,12 +47,11 @@ const VerifyTwModal = ({secretCode}: any) => { })); }; - console.log('formValues', formValues); - return (
+
Simply paste the URL of your tweet below to verify manually and we'll take care of the rest.
void; } const Steps = () => { @@ -115,7 +116,8 @@ const Steps = () => { isActive: !token, isDone: !!token, step: MultiplierStep.authen, - secretCode: authenCode?.secret_code + secretCode: authenCode?.secret_code, + onSuccess: onVerifyTwSuccess }, { title: 'Level up your multiplier', @@ -154,6 +156,7 @@ const Steps = () => { isDone={!!item.isDone} step={item.step} secretCode={item?.secretCode} + onSuccess={item?.onSuccess} /> ); })} diff --git a/src/services/player-share.ts b/src/services/player-share.ts index 3b17459f8..9d933df74 100644 --- a/src/services/player-share.ts +++ b/src/services/player-share.ts @@ -26,7 +26,8 @@ export const generateTokenWithTwPost = async (uuid: string, link?: string): Prom }); return Object(camelCaseKeys(res)); } catch (error) { - console.log(error); + throw error; + // console.log(error); } return; }; From 3189c14f2cf191fa5e282a74660ee7948e983c1e Mon Sep 17 00:00:00 2001 From: 0xmegalodon Date: Tue, 16 Jan 2024 14:41:13 +0700 Subject: [PATCH 3/7] test --- src/components/BaseModal/index.tsx | 3 +- src/modules/Whitelist/steps/Step/index.tsx | 22 ++----------- .../Whitelist/steps/VerifyTwModal/index.tsx | 4 +-- .../steps/VerifyTwModal/styles.module.scss | 31 +++++++++++++------ src/modules/Whitelist/steps/index.tsx | 30 +++++++++++++----- .../Whitelist/steps/styles.module.scss | 13 ++++++++ 6 files changed, 64 insertions(+), 39 deletions(-) diff --git a/src/components/BaseModal/index.tsx b/src/components/BaseModal/index.tsx index 48579b19a..1ee31dc11 100644 --- a/src/components/BaseModal/index.tsx +++ b/src/components/BaseModal/index.tsx @@ -21,6 +21,7 @@ const BaseModal = (props: PropsWithChildren): React.ReactNode = isShow, onHide, title, + className, children, description, headerClassName, @@ -34,7 +35,7 @@ const BaseModal = (props: PropsWithChildren): React.ReactNode = isCentered={true} > - + + }} + isLoading={isLoading} + > + {content?.actionText} + { step === MultiplierStep.authen && showManualCheck && ( - Missing from the leaderboard? + onClick={content?.handleShowManualPopup} + mt={1} + > + Missing from the Leaderboard? ) } diff --git a/src/modules/Whitelist/steps/index.tsx b/src/modules/Whitelist/steps/index.tsx index 878e17f0d..fdb8439ff 100644 --- a/src/modules/Whitelist/steps/index.tsx +++ b/src/modules/Whitelist/steps/index.tsx @@ -172,7 +172,6 @@ const Steps = () => { index={index} content={item} isLoading={item.step === MultiplierStep.authen && submitting} - handleShowManualPopup={item?.handleShowManualPopup} /> ); })} From 33d9196f6a263223b9c25301241fda92d4a1bc41 Mon Sep 17 00:00:00 2001 From: 0xmegalodon Date: Tue, 16 Jan 2024 15:01:46 +0700 Subject: [PATCH 5/7] test --- .../Whitelist/steps/VerifyTwModal/index.tsx | 59 +++++++++++-------- .../steps/VerifyTwModal/styles.module.scss | 14 +++++ src/modules/Whitelist/steps/index.tsx | 19 +++--- .../Whitelist/steps/styles.module.scss | 13 ---- 4 files changed, 60 insertions(+), 45 deletions(-) diff --git a/src/modules/Whitelist/steps/VerifyTwModal/index.tsx b/src/modules/Whitelist/steps/VerifyTwModal/index.tsx index 697d6765b..d15ba2916 100644 --- a/src/modules/Whitelist/steps/VerifyTwModal/index.tsx +++ b/src/modules/Whitelist/steps/VerifyTwModal/index.tsx @@ -7,6 +7,7 @@ import { generateTokenWithTwPost } from '@/services/player-share'; import { toast } from 'react-hot-toast'; import { closeModal } from '@/stores/states/modal/reducer'; import { useDispatch } from 'react-redux'; +import BaseModal from '@/components/BaseModal'; interface FormValues { postUrl: string; @@ -14,7 +15,7 @@ interface FormValues { export const ReferralModalID = 'ReferralModalID'; -const VerifyTwModal = ({secretCode, onSuccess}: any) => { +const VerifyTwModal = ({isShow, onHide, secretCode, onSuccess}: any) => { const dispatch = useDispatch(); const [isCreating, setIsCreating] = useState(false); @@ -48,31 +49,39 @@ const VerifyTwModal = ({secretCode, onSuccess}: any) => { }; return ( -
-
- -
Simply paste the URL of your tweet below to verify manually and we'll take care of the rest.
-
- -
- - + +
+
+
+
Simply paste the URL of your tweet below to verify manually and we'll take care of the rest.
+
+ +
+ +
+
-
+ ); }; diff --git a/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss b/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss index 8d53f734a..21e3eb75d 100644 --- a/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss +++ b/src/modules/Whitelist/steps/VerifyTwModal/styles.module.scss @@ -133,3 +133,17 @@ cursor: pointer; } } + +.modalManualHeader { + padding-bottom: 0 !important; +} + +.modalContent { + :global { + .chakra-modal__body { + padding-left: rem(24) !important; + padding-right: rem(24) !important; + } + } +} + diff --git a/src/modules/Whitelist/steps/index.tsx b/src/modules/Whitelist/steps/index.tsx index fdb8439ff..cd6fb8b93 100644 --- a/src/modules/Whitelist/steps/index.tsx +++ b/src/modules/Whitelist/steps/index.tsx @@ -176,17 +176,22 @@ const Steps = () => { ); })} - { setShowManualCheck(false); }} - title={"Missing from the Leaderboard?"} - headerClassName={s.modalManualHeader} - className={s.modalContent} - > - - + secretCode={authenCode?.secret_code} + onSuccess={onVerifyTwSuccess} + /> + { + setShowManualCheck(false); + }} + secretCode={authenCode?.secret_code} + onSuccess={onVerifyTwSuccess} + /> ); }; diff --git a/src/modules/Whitelist/steps/styles.module.scss b/src/modules/Whitelist/steps/styles.module.scss index 675227b62..e8f2464c0 100644 --- a/src/modules/Whitelist/steps/styles.module.scss +++ b/src/modules/Whitelist/steps/styles.module.scss @@ -7,16 +7,3 @@ // padding: 0 12px; //} } - -.modalManualHeader { - padding-bottom: 0 !important; -} - -.modalContent { - :global { - .chakra-modal__body { - padding-left: rem(24) !important; - padding-right: rem(24) !important; - } - } -} From 1e4e9ea61e03611862e638de8149d45bfa501124 Mon Sep 17 00:00:00 2001 From: 0xmegalodon Date: Tue, 16 Jan 2024 15:06:27 +0700 Subject: [PATCH 6/7] test --- src/modules/Whitelist/steps/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/Whitelist/steps/index.tsx b/src/modules/Whitelist/steps/index.tsx index d27ed0876..ed6120667 100644 --- a/src/modules/Whitelist/steps/index.tsx +++ b/src/modules/Whitelist/steps/index.tsx @@ -33,7 +33,6 @@ const Steps = () => { const { toggle: isShowConnect, onToggle: onToggleConnect } = useToggle(); const needReload = useAppSelector(commonSelector).needReload const user = useAppSelector(userSelector); - const user = useAppSelector(userSelector) const [showManualCheck, setShowManualCheck] = useState(false); const handleShareTw = async () => { From 6239c8996d4bcbb5987033d82b27151e515fe7f4 Mon Sep 17 00:00:00 2001 From: camewell <130561684+camewell071@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:11:27 +0700 Subject: [PATCH 7/7] chore: update code --- src/modules/Whitelist/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Whitelist/index.tsx b/src/modules/Whitelist/index.tsx index 1b29ca861..c9ba33693 100644 --- a/src/modules/Whitelist/index.tsx +++ b/src/modules/Whitelist/index.tsx @@ -15,7 +15,7 @@ const Whitelist = () => { React.useEffect(() => { const element = document.getElementById(CONTAINER_ID) if (height && element) { - element.style.paddingTop = `${height}px` + element.style.paddingTop = `${height + 32}px` } }, [height])