chore: convert verify to sign
This commit is contained in:
parent
f4877b55dd
commit
75bc984a8b
@ -20,11 +20,11 @@ import {
|
||||
} from '@mui/material'
|
||||
import { MuiFileInput } from 'mui-file-input'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Link, useNavigate } from 'react-router-dom'
|
||||
import { Link } from 'react-router-dom'
|
||||
import placeholderAvatar from '../../assets/images/nostr-logo.jpg'
|
||||
import { LoadingSpinner } from '../../components/LoadingSpinner'
|
||||
import { MetadataController, NostrController } from '../../controllers'
|
||||
import { appPrivateRoutes, getProfileRoute } from '../../routes'
|
||||
import { getProfileRoute } from '../../routes'
|
||||
import { ProfileMetadata, User, UserRole } from '../../types'
|
||||
import {
|
||||
encryptArrayBuffer,
|
||||
@ -45,7 +45,6 @@ import { useSelector } from 'react-redux'
|
||||
import { State } from '../../store/rootReducer'
|
||||
|
||||
export const CreatePage = () => {
|
||||
const navigate = useNavigate()
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [loadingSpinnerDesc, setLoadingSpinnerDesc] = useState('')
|
||||
|
||||
@ -350,11 +349,7 @@ export const CreatePage = () => {
|
||||
}
|
||||
setIsLoading(false)
|
||||
|
||||
navigate(
|
||||
`${appPrivateRoutes.verify}?file=${encodeURIComponent(
|
||||
fileUrl
|
||||
)}&key=${encodeURIComponent(encryptionKey)}`
|
||||
)
|
||||
// todo: navigate to verify
|
||||
}
|
||||
|
||||
if (authUrl) {
|
||||
|
@ -15,10 +15,10 @@ export const HomePage = () => {
|
||||
Create
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => navigate(appPrivateRoutes.verify)}
|
||||
onClick={() => navigate(appPrivateRoutes.sign)}
|
||||
variant='contained'
|
||||
>
|
||||
Verify
|
||||
Sign
|
||||
</Button>
|
||||
</Box>
|
||||
)
|
||||
|
@ -50,7 +50,7 @@ enum SignedStatus {
|
||||
User_Is_Not_Next_Signer
|
||||
}
|
||||
|
||||
export const VerifyPage = () => {
|
||||
export const SignPage = () => {
|
||||
const [searchParams] = useSearchParams()
|
||||
|
||||
const [displayInput, setDisplayInput] = useState(false)
|
@ -4,12 +4,12 @@ import { LandingPage } from '../pages/landing/LandingPage'
|
||||
import { Login } from '../pages/login'
|
||||
import { ProfilePage } from '../pages/profile'
|
||||
import { hexToNpub } from '../utils'
|
||||
import { VerifyPage } from '../pages/verify'
|
||||
import { SignPage } from '../pages/sign'
|
||||
|
||||
export const appPrivateRoutes = {
|
||||
homePage: '/',
|
||||
create: '/create',
|
||||
verify: '/verify'
|
||||
sign: '/sign'
|
||||
}
|
||||
|
||||
export const appPublicRoutes = {
|
||||
@ -49,7 +49,7 @@ export const privateRoutes = [
|
||||
element: <CreatePage />
|
||||
},
|
||||
{
|
||||
path: appPrivateRoutes.verify,
|
||||
element: <VerifyPage />
|
||||
path: appPrivateRoutes.sign,
|
||||
element: <SignPage />
|
||||
}
|
||||
]
|
||||
|
@ -76,7 +76,7 @@ export const sendDM = async (
|
||||
: 'You have received a signed document.'
|
||||
|
||||
const decryptionUrl = `${window.location.origin}/#${
|
||||
appPrivateRoutes.verify
|
||||
appPrivateRoutes.sign
|
||||
}?file=${encodeURIComponent(fileUrl)}&key=${encodeURIComponent(
|
||||
encryptionKey
|
||||
)}`
|
||||
@ -166,7 +166,9 @@ export const sendDM = async (
|
||||
toast.error('An error occurred while publishing DM')
|
||||
|
||||
errResults.forEach((errResult: any) => {
|
||||
toast.error(`Publishing to ${errResult.relay} caused the following error: ${errResult.error}`)
|
||||
toast.error(
|
||||
`Publishing to ${errResult.relay} caused the following error: ${errResult.error}`
|
||||
)
|
||||
})
|
||||
|
||||
return null
|
||||
|
Loading…
Reference in New Issue
Block a user