From e72ce5376cb4ce943f027b939c8a57dc75a503e1 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 26 Oct 2025 14:24:48 +0100 Subject: [PATCH] Remove unused pages --- web/pages/admin/test-user.tsx | 118 ---------------------------------- web/pages/opinion-scale.tsx | 10 --- 2 files changed, 128 deletions(-) delete mode 100644 web/pages/admin/test-user.tsx delete mode 100644 web/pages/opinion-scale.tsx diff --git a/web/pages/admin/test-user.tsx b/web/pages/admin/test-user.tsx deleted file mode 100644 index 54895b80..00000000 --- a/web/pages/admin/test-user.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import { useEffect, useState } from 'react' -import { Button } from 'web/components/buttons/button' -import { Col } from 'web/components/layout/col' -import { Row } from 'web/components/layout/row' -import { Title } from 'web/components/widgets/title' -import { useRedirectIfSignedIn } from 'web/hooks/use-redirect-if-signed-in' -import { - getAuth, - createUserWithEmailAndPassword, - signInWithEmailAndPassword, -} from 'firebase/auth' -import { randomString } from 'common/util/random' -import { ExpandingInput } from 'web/components/widgets/expanding-input' -import { usePersistentLocalState } from 'web/hooks/use-persistent-local-state' -import { getCookie } from 'web/lib/util/cookie' -import { Input } from 'web/components/widgets/input' - -export default function TestUser() { - useRedirectIfSignedIn('/') - - const [email, setEmail] = useState('') - const [password, setPassword] = useState('') - const [createUserKey, setCreateUserKey] = usePersistentLocalState( - '', - 'TEST_CREATE_USER_KEY' - ) - - useEffect(() => { - setEmail('testNewUser+' + randomString() + '@gmail.com') - setPassword(randomString()) - const key = 'TEST_CREATE_USER_KEY' - const cookie = getCookie(key) - if (cookie) setCreateUserKey(cookie.replace(/"/g, '')) - }, []) - - const [submitting, setSubmitting] = useState(false) - const [signingIn, setSigningIn] = useState(false) - - const create = () => { - setSubmitting(true) - const auth = getAuth() - createUserWithEmailAndPassword(auth, email, password) - .then((userCredential) => { - setSubmitting(false) - console.debug('SUCCESS creating firebase user', userCredential) - }) - .catch((error) => { - setSubmitting(false) - const errorCode = error.code - const errorMessage = error.message - console.error('ERROR creating firebase user', errorCode, errorMessage) - }) - } - const login = () => { - setSigningIn(true) - const auth = getAuth() - signInWithEmailAndPassword(auth, email, password) - .then((userCredential) => { - setSubmitting(false) - console.debug('SUCCESS logging in firebase user', userCredential) - }) - .catch((error) => { - setSigningIn(false) - const errorCode = error.code - const errorMessage = error.message - console.error('ERROR logging in firebase user', errorCode, errorMessage) - }) - } - - return ( - - Test New User Creation - - Set TEST_CREATE_USER_KEY to{' '} - - the proper value - {' '} - - setCreateUserKey(e.target.value)} - className={'w-80'} - rows={5} - /> - Email - {email} - Password - {password} - - - - Email - setEmail(e.target.value || '')} - /> - Password - setPassword(e.target.value || '')} - /> - - - - - ) -} diff --git a/web/pages/opinion-scale.tsx b/web/pages/opinion-scale.tsx deleted file mode 100644 index dc8cc907..00000000 --- a/web/pages/opinion-scale.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { QuestionsForm } from 'web/components/questions-form' -import { Col } from 'web/components/layout/col' - -export default function OpinionScalePage() { - return ( - - - - ) -}