diff --git a/example/src/components/header.tsx b/example/src/components/header.tsx index 4065d67..83c8302 100644 --- a/example/src/components/header.tsx +++ b/example/src/components/header.tsx @@ -34,6 +34,10 @@ const Header = () => { title: 'Connect', href: '/connect', }, + { + title: 'Cashout', + href: '/cashout', + }, ]; const location = useLocation(); @@ -79,6 +83,11 @@ const Header = () => { Connect + + + Cashout + + diff --git a/example/src/main.tsx b/example/src/main.tsx index 73a6c82..6bacf97 100644 --- a/example/src/main.tsx +++ b/example/src/main.tsx @@ -11,6 +11,7 @@ import Layout from './components/layout'; import Kyc from './routes/kyc'; import Payout from './routes/payout'; import { NextUIProvider } from '@nextui-org/react'; +import Cashout from './routes/cashout'; const router = createHashRouter([ { @@ -37,6 +38,14 @@ const router = createHashRouter([ ), }, + { + path: '/cashout', + element: ( + + + + ), + }, { path: '/kyc', element: ( diff --git a/example/src/routes/cashout.tsx b/example/src/routes/cashout.tsx new file mode 100644 index 0000000..84ba8ba --- /dev/null +++ b/example/src/routes/cashout.tsx @@ -0,0 +1,51 @@ +import { useState } from 'react'; +import { NoRampCashout } from '../../../src'; +import ThemeSwitcher from '../components/ui/theme-switcher/theme-switcher'; + +const Cashout = () => { + const [theme, setTheme] = useState<'light' | 'dark'>('dark'); + + const handleThemeChange = (checked: boolean) => { + setTheme(checked ? 'dark' : 'light'); + }; + + return ( +
+
+
+

Cashout Widget

+ +
+ +
+
+ +
+ +
+ +
+

Usage

+

+ Sign up on{' '} + + app.noramp.io + {' '} + , create a Marketplace App and register sellers in order to get the + token. +

+
+            {`import { NoRampCashout } from 'norampkit';
+
+`}
+          
+
+
+
+ ); +}; + +export default Cashout; diff --git a/src/components/noramp-cashout/cashout.tsx b/src/components/noramp-cashout/cashout.tsx new file mode 100644 index 0000000..3ee94e1 --- /dev/null +++ b/src/components/noramp-cashout/cashout.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +import NoRampLogo from '../NoRampLogo'; + +type NoRampCashoutProps = { + token: string; + testnet?: boolean; + theme?: 'light' | 'dark' | null; + height?: string; + width?: string; +}; + +export const NoRampCashout = ({ + height = '440', + width = '440', +}: NoRampCashoutProps) => { + let src = `https://noramp-beam.vercel.app/`; + // let src = `http://localhost:3000`; + + const [openWidget, setOpenWidget] = React.useState(false); + + // const isPreview = token === 'preview'; + + // if (isPreview) { + // src += '&preview=true'; + // } + + if (openWidget) { + return ( +
+