diff --git a/package-lock.json b/package-lock.json index 50c1ac1..a7123bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "react-router-dom": "^6.8.0" }, "devDependencies": { + "@types/node": "^18.14.0", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@types/react-linkify": "^1.0.1", @@ -2427,9 +2428,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", - "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", + "version": "18.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.0.tgz", + "integrity": "sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A==", "dev": true }, "node_modules/@types/prop-types": { diff --git a/package.json b/package.json index 57f08d8..da4e349 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "react-router-dom": "^6.8.0" }, "devDependencies": { + "@types/node": "^18.14.0", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@types/react-linkify": "^1.0.1", diff --git a/src/App.tsx b/src/App.tsx index ff837e6..83fc0aa 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,12 @@ import { Routes, Route } from "react-router-dom"; -import Join from "./Join"; -import Layout from "./components/Layout"; +import Join from "@/routes/Join"; +import Layout from "@/components/Layout"; +import SecretWaitlistSkipper from "@/routes/SecretWaitlistSkipper"; +import Home from "@/routes/Home"; function App() { + let active = localStorage.getItem('active') || ""; return (
@@ -12,7 +15,8 @@ function App() { {/* } /> */} }> - } /> + : } /> + } />
diff --git a/src/Home.tsx b/src/Home.tsx deleted file mode 100644 index 94ff9f6..0000000 --- a/src/Home.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import Sheet from 'react-modal-sheet'; -import { useState } from 'react'; -import logo from './assets/mutiny-logo.svg'; -import mutiny_m from './assets/m.svg'; -import scan from './assets/scan.svg'; -import settings from './assets/settings.svg'; -import send from './assets/send.svg'; - - -function ActivityItem() { - return ( -
- logo -
-

Bitcoin Beefsteak

-

-1,441,851 SAT

-

Jul 24

-
-
SEND
-
- ) -} - -function App() { - const [isOpen, setOpen] = useState(false); - - return ( -
-
-
-
- logo -
-
-
- Balance -
-
-

- 69,420 SAT -

-
-
- - -
-
-
-
- Activity -
- - - - - - - - -
- {/* safety div */} -
-
- - -
- - setOpen(false)}> - - - -
-
- Activity -
- -

- It's a sheet! Like a modal, but a sheet. -

-
-
-
- - -
- - - - - - -
- ) -} - -export default App diff --git a/src/Receive.tsx b/src/Receive.tsx deleted file mode 100644 index 6d78ea7..0000000 --- a/src/Receive.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Link } from "react-router-dom"; -import { motion } from "framer-motion"; - -function Receive() { - const pageMotion = { - initial: { opacity: 0, x: 0 }, - animate: { opacity: 1, x: 50, transition: { duration: 2 } }, - exit: { opacity: 0, x: 0, transition: { duration: 2 } } - }; - - return ( -
- about page - Go to home page -
- ) -} - -export default Receive \ No newline at end of file diff --git a/src/components/Notes.tsx b/src/components/Notes.tsx index 6d6de65..5dd6310 100644 --- a/src/components/Notes.tsx +++ b/src/components/Notes.tsx @@ -18,9 +18,9 @@ function Note({ e }: { e: NostrEvent }) { } return ( -
- -
+
+ +
{/*

{JSON.stringify(e, null, 2)}

*/}

diff --git a/src/components/WaitlistAlreadyIn.tsx b/src/components/WaitlistAlreadyIn.tsx index 8dfa275..bccedfd 100644 --- a/src/components/WaitlistAlreadyIn.tsx +++ b/src/components/WaitlistAlreadyIn.tsx @@ -1,5 +1,6 @@ import Notes from "./Notes"; import { NostrProvider } from "nostr-react"; +import { useState } from "react"; const relayUrls = [ "wss://nostr.zebedee.cloud", @@ -12,18 +13,28 @@ const relayUrls = [ ] export function WaitlistAlreadyIn() { + const [skipCount, setSkipCount] = useState(0); + + function skipCounter() { + setSkipCount(skipCount + 1); + if (skipCount >= 6) { + window.location.href = "/secretwaitlistskipper"; + } + } + return ( -

+

You're on a list!

We'll message you when Mutiny Wallet is ready.

-
+

Recent Updates

+
); } diff --git a/src/components/WaitlistForm.tsx b/src/components/WaitlistForm.tsx index c8fde34..b1fc157 100644 --- a/src/components/WaitlistForm.tsx +++ b/src/components/WaitlistForm.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import button from "./button"; +import button from "@/styles/button"; const INPUT = "w-full mb-4 p-2 rounded-lg text-black" @@ -73,7 +73,7 @@ export default function WaitlistForm() { } return ( -
+

Join Waitlist

{/* HTML form with three inputs: nostr pubkey (text), email (text), and a textarea for comments */}

diff --git a/src/main.tsx b/src/main.tsx index 4723db4..3037eda 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,4 +1,3 @@ -import React from 'react' import ReactDOM from 'react-dom/client' import { BrowserRouter } from 'react-router-dom' import App from './App' diff --git a/src/routes/Home.tsx b/src/routes/Home.tsx new file mode 100644 index 0000000..14256d3 --- /dev/null +++ b/src/routes/Home.tsx @@ -0,0 +1,112 @@ +import Sheet from 'react-modal-sheet'; +import { useState } from 'react'; +import logo from '@/assets/mutiny-logo.svg'; +import mutiny_m from '@/assets/m.svg'; +import scan from '@/assets/scan.svg'; +import settings from '@/assets/settings.svg'; +import send from '@/assets/send.svg'; + +function ActivityItem() { + return ( +
+ logo +
+

Bitcoin Beefsteak

+

-1,441,851 SAT

+

Jul 24

+
+
SEND
+
+ ) +} + +function App() { + const [isOpen, setOpen] = useState(false); + + return ( + <> +
+
+ logo +
+
+
+ Balance +
+
+

+ 69,420 SAT +

+
+
+ + +
+
+
+
+ Activity +
+ + + + + + + + +
+ {/* safety div */} +
+
+ + + + setOpen(false)}> + + + +
+
+ Activity +
+ +

+ It's a sheet! Like a modal, but a sheet. +

+
+
+
+ + +
+ + + + + + + + ) +} + +export default App diff --git a/src/Join.tsx b/src/routes/Join.tsx similarity index 88% rename from src/Join.tsx rename to src/routes/Join.tsx index 7e848f3..7d41ed1 100644 --- a/src/Join.tsx +++ b/src/routes/Join.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import WaitlistForm from "./components/WaitlistForm"; -import { WaitlistAlreadyIn } from "./components/WaitlistAlreadyIn"; +import WaitlistForm from "@/components/WaitlistForm"; +import { WaitlistAlreadyIn } from "@/components/WaitlistAlreadyIn"; export default function Join() { // On load, check if the user is already on the waitlist diff --git a/src/routes/SecretWaitlistSkipper.tsx b/src/routes/SecretWaitlistSkipper.tsx new file mode 100644 index 0000000..daaf76b --- /dev/null +++ b/src/routes/SecretWaitlistSkipper.tsx @@ -0,0 +1,30 @@ +import button from "@/styles/button"; +import { useState } from "react"; + +export default function SecretWaitlistSkipper() { + const [active] = useState(localStorage.getItem('active') || ""); + + function toggleSkipWaitlist() { + // If active in localstorage is true, set to false, otherwie set to true + if (active === "true") { + localStorage.setItem("active", "false"); + } else { + localStorage.setItem("active", "true"); + } + + // Redirect to index + window.location.href = "/"; + } + return ( +
+
+ {active === "true" && + + } + {active !== "true" && + + } +
+
+ ) +} \ No newline at end of file diff --git a/src/components/button.ts b/src/styles/button.ts similarity index 100% rename from src/components/button.ts rename to src/styles/button.ts diff --git a/tsconfig.json b/tsconfig.json index 3d0a51a..7da4296 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,11 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react-jsx" + "jsx": "react-jsx", + "types": ["node"], + "paths": { + "@/*": ["./src/*"] + } }, "include": ["src"], "references": [{ "path": "./tsconfig.node.json" }] diff --git a/vite.config.ts b/vite.config.ts index 1afab1c..2cca48d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,8 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { VitePWA } from 'vite-plugin-pwa' +import * as path from 'path' + // https://vitejs.dev/config/ export default defineConfig({ @@ -29,4 +31,7 @@ export default defineConfig({ enabled: true } })], + resolve: { + alias: [{ find: '@', replacement: path.resolve(__dirname, './src') }] + } })