Skip to content

Commit

Permalink
feat: support master password in desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
0xzio committed Mar 7, 2024
1 parent f29b328 commit 732f350
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 131 deletions.
1 change: 1 addition & 0 deletions apps/desktop/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NEXT_PUBLIC_NEXTAUTH_URL=http://localhost:3000
# NEXT_PUBLIC_NEXTAUTH_URL=https://app.penx.io

NEXT_PUBLIC_PLATFORM=DESKTOP

Expand Down
5 changes: 5 additions & 0 deletions apps/desktop/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ const nextConfig = {
'@octokit/openapi-types',
'@octokit/core',
'@octokit/app',
'@penx/abi',
'@penx/api',
'@penx/app',
'@penx/constants',
'@penx/db',
'@penx/math',
'@penx/catalogue',
'@penx/hooks',
'@penx/local-db',
'@penx/master-password',
'@penx/wagmi',
'@penx/editor',
'@penx/editor-queries',
'@penx/editor-shared',
Expand All @@ -22,6 +26,7 @@ const nextConfig = {
'@penx/editor-common',
'@penx/editor-composition',
'@penx/icons',
'@penx/google-translate',
'@penx/shared',
'@penx/model',
'@penx/context-menu',
Expand Down
17 changes: 15 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,41 @@
"start": "next start",
"tauri": "tauri",
"build:app": "tauri build",
"build:app:debug": "tauri build --debug",
"dev:app": "tauri dev",
"lint": "next lint"
},
"dependencies": {
"@octokit/auth-app": "^6.0.1",
"@octokit/oauth-app": "^6.0.0",
"@octokit/rest": "^20.0.2",
"@fower/atomic-props": "^2.0.0",
"@fower/react": "^2.0.0",
"@glideapps/glide-data-grid": "^6.0.3",
"@penx/api": "workspace:*",
"@penx/app": "workspace:*",
"@penx/constants": "workspace:*",
"@penx/local-db": "workspace:*",
"@penx/hooks": "workspace:*",
"@penx/icons": "workspace:*",
"@penx/local-db": "workspace:*",
"@penx/session": "workspace:*",
"@penx/abi": "workspace:*",
"@penx/widget": "workspace:*",
"@penx/encryption": "workspace:*",
"@penx/wagmi": "workspace:*",
"@penx/store": "workspace:*",
"@penx/trpc-client": "workspace:*",
"@tanstack/react-query": "^4.36.1",
"@tauri-apps/api": "^1.5.3",
"@web3modal/wagmi": "^4.0.13",
"idb-keyval": "^6.2.1",
"jotai": "^2.6.0",
"lucide-react": "^0.344.0",
"next": "13.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"uikit": "workspace:*"
"uikit": "workspace:*",
"wagmi": "^2.5.7"
},
"devDependencies": {
"@penx/tsconfig": "workspace:*",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import { FC, useState } from 'react'
import { Box } from '@fower/react'
import { useQuery } from '@tanstack/react-query'
import { set } from 'idb-keyval'
import { Button, Input, InputElement, InputGroup, Spinner, toast } from 'uikit'
import { Button, Input, InputGroup, Spinner, toast } from 'uikit'
import { MASTER_PASSWORD } from '@penx/constants'
import { db } from '@penx/local-db'
import { api, trpc } from '@penx/trpc-client'
import { api } from '@penx/trpc-client'

declare module '@fower/atomic-props' {
export interface AtomicProps {
shadowPopover?: boolean
}
}

interface Props {
refetch: any
Expand Down Expand Up @@ -54,15 +60,6 @@ export const MasterPasswordLogin: FC<Props> = ({ refetch }) => {
setValue(e.target.value)
}}
/>

{!isLoading && !isNewUser && (
<InputElement w-190>
<Button variant="light" size="lg" w-180 roundedFull column gap-2>
<Box textSM>Recover</Box>
<Box text-10>Recover from blockchain</Box>
</Button>
</InputElement>
)}
</InputGroup>

<Box toCenterY gap2 toCenterX>
Expand Down
114 changes: 0 additions & 114 deletions apps/desktop/src/components/MasterPasswordLogin/PasswordOnChain.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/desktop/src/pages/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function PageEditor() {
return (
<SessionProvider
value={{
data: { user, userId: user?.id, address: user.address },
data: { user, userId: user?.id, address: user?.address },
loading,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box } from '@fower/react'
import { Inter } from 'next/font/google'
import Head from 'next/head'
import { DesktopHome } from '@penx/app'
import { DesktopHome } from '~/components/DesktopHome'

const inter = Inter({ subsets: ['latin'] })

Expand Down
8 changes: 7 additions & 1 deletion apps/desktop/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"~/*": ["src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*d..ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": ["node_modules", "src-tauri"]
}
15 changes: 15 additions & 0 deletions apps/desktop/types/fower.d.ts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
composeAtom,
injectGlobalStyle,
setConfig,
setTheme,
} from '@fower/react'

declare module '@fower/atomic-props' {
export interface AtomicProps {
heading1?: boolean
heading2?: boolean

shadowPopover?: boolean
}
}
1 change: 0 additions & 1 deletion packages/app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export * from './Workbench/PageSettingsPopover'
export * from './Marketplace/Marketplace'
export * from './app-emitter'
export * from './NewTabApp'
export * from './DesktopHome'

export default EditorApp
36 changes: 36 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 732f350

Please sign in to comment.