From 5c7430001b5372aa3f78c5a67b0d9c502910e06a Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 11 Dec 2023 15:08:47 +0100 Subject: [PATCH 1/2] feat: final tweaks --- packages/core/src/bridge.ts | 2 +- .../react/src/components/AboutWorldID.tsx | 10 +-- .../src/components/IDKitWidget/BaseWidget.tsx | 20 ++---- .../react/src/components/SignInButton.tsx | 54 --------------- .../src/components/SignInWithWorldID.tsx | 68 ------------------- packages/react/src/index.ts | 6 +- packages/react/src/store/idkit.ts | 4 -- packages/react/src/types/config.ts | 2 - 8 files changed, 12 insertions(+), 154 deletions(-) delete mode 100644 packages/react/src/components/SignInButton.tsx delete mode 100644 packages/react/src/components/SignInWithWorldID.tsx diff --git a/packages/core/src/bridge.ts b/packages/core/src/bridge.ts index 75e97007..9fff2265 100644 --- a/packages/core/src/bridge.ts +++ b/packages/core/src/bridge.ts @@ -1,10 +1,10 @@ import { create } from 'zustand' import { VerificationState } from '@/types/bridge' +import { type IDKitConfig } from '@/types/config' import type { ISuccessResult } from '@/types/result' import type { CredentialType } from '@/types/config' import { encodeAction, generateSignal } from '@/lib/hashing' import { AppErrorCodes, ResponseStatus } from '@/types/bridge' -import { VerificationLevel, type IDKitConfig } from '@/types/config' import { decryptResponse, encryptRequest, exportKey, generateKey } from '@/lib/crypto' import { DEFAULT_VERIFICATION_LEVEL, diff --git a/packages/react/src/components/AboutWorldID.tsx b/packages/react/src/components/AboutWorldID.tsx index 8caca4be..c563a861 100644 --- a/packages/react/src/components/AboutWorldID.tsx +++ b/packages/react/src/components/AboutWorldID.tsx @@ -11,7 +11,7 @@ type Props = { const AboutWorldID: FC = ({ className }) => { return (
-

{__('What is World ID?')}

+

{__('What is World ID?')}

{__('With Worldcoin and World ID sign in seamlessly and prove you are a unique human.')}

@@ -31,12 +31,12 @@ type FeatureHighlightProps = PropsWithChildren<{ const FeatureHighlight: FC = ({ icon: Icon, title, children }) => (
-
- +
+
-

{title}

-
{children}
+

{title}

+
{children}
) diff --git a/packages/react/src/components/IDKitWidget/BaseWidget.tsx b/packages/react/src/components/IDKitWidget/BaseWidget.tsx index 61a664e7..77f4865c 100644 --- a/packages/react/src/components/IDKitWidget/BaseWidget.tsx +++ b/packages/react/src/components/IDKitWidget/BaseWidget.tsx @@ -23,9 +23,8 @@ import { AnimatePresence, motion } from 'framer-motion' import ArrowLongLeftIcon from '../Icons/ArrowLongLeftIcon' import HostAppVerificationState from './States/HostAppVerificationState' -const getParams = ({ open, processing, onOpenChange, stage, setStage, theme, computed, setOptions }: IDKitStore) => ({ +const getParams = ({ open, processing, onOpenChange, stage, setStage, computed, setOptions }: IDKitStore) => ({ stage, - theme, setStage, processing, setOptions, @@ -35,18 +34,10 @@ const getParams = ({ open, processing, onOpenChange, stage, setStage, theme, com }) const IDKitWidget: FC = ({ children, ...config }) => { - const { - isOpen, - onOpenChange, - processing, - stage, - setStage, - canGoBack, - setOptions, - theme: _theme, - } = useIDKitStore(getParams, shallow) const media = useMedia() + const { isOpen, onOpenChange, stage, setStage, canGoBack, setOptions } = useIDKitStore(getParams, shallow) + useEffect(() => { setOptions(config, ConfigSource.PROPS) }, [config, setOptions]) @@ -77,10 +68,7 @@ const IDKitWidget: FC = ({ children, ...config }) => { {isOpen && ( -