Skip to content

Commit

Permalink
feat: move pow option to wot page
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyTseng committed Oct 14, 2024
1 parent 5af3a6a commit 141cf41
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const navItems = [
href: '/data'
},
{
title: 'WoT',
href: '/wot'
title: 'WoT & PoW',
href: '/wotandpow'
},
{
title: 'Rules',
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Logs from '@renderer/pages/logs'
import Rules from '@renderer/pages/rules'
import EditRule from '@renderer/pages/rules/edit'
import Settings from '@renderer/pages/settings'
import Wot from '@renderer/pages/wot'
import WotAndPow from '@renderer/pages/wotAndPow'
import React from 'react'
import ReactDOM from 'react-dom/client'
import { createHashRouter, RouterProvider } from 'react-router-dom'
Expand All @@ -19,7 +19,7 @@ export const router = createHashRouter([
children: [
{ index: true, element: <Home /> },
{ path: '/data', element: <Data /> },
{ path: '/wot', element: <Wot /> },
{ path: '/wotandpow', element: <WotAndPow /> },
{ path: '/rules', element: <Rules /> },
{ path: '/rules/create', element: <EditRule /> },
{ path: '/rules/:id/edit', element: <EditRule /> },
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import AutoLaunchOption from './components/AutoLaunchOption'
import DefaultFilterLimitOption from './components/DefaultFilterLimitOption'
import JoinTrayHubOption from './components/JoinTrayHubOption'
import MaxPayloadOption from './components/MaxPayloadOption'
import PowDifficultyOption from './components/PowDifficultyOption'
import TrayIconColorOption from './components/TrayIconColorOption'

export default function Settings() {
Expand All @@ -14,7 +13,6 @@ export default function Settings() {
<TrayIconColorOption />
<MaxPayloadOption />
<DefaultFilterLimitOption />
<PowDifficultyOption />
<JoinTrayHubOption />
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default function PowOption() {
return (
<div className="flex justify-between items-center">
<div>
<div>Pow difficulty</div>
<div>Difficulty</div>
<div className="text-sm text-muted-foreground">
The minimum pow difficulty for accepting events
The minimum pow difficulty for accepting events. 0 means disabled.
</div>
</div>
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useToast } from '@renderer/components/ui/use-toast'
import dayjs from 'dayjs'
import { CircleHelp } from 'lucide-react'
import { useEffect, useState } from 'react'
import PowOption from './components/PowOption'

const NPUB_REGEX = /^npub1[0-9a-z]{58}$/

Expand Down Expand Up @@ -140,8 +141,9 @@ export default function Wot() {

return (
<div className="space-y-2">
<div className="font-bold text-xl">WoT</div>
<div className="flex items-center justify-between">
<div>Enable WoT</div>
<div>Enable</div>
<Switch checked={enabled} onClick={() => handleEnableToggle(!enabled)} disabled={loading} />
</div>
<div className="flex items-center justify-between">
Expand Down Expand Up @@ -201,15 +203,14 @@ export default function Wot() {
Refresh
</Button>
</div>
<div className="text-muted-foreground text-sm pb-8">
<div className="text-muted-foreground text-sm">
<div>
The most recent refresh of the WoT was at{' '}
{lastRefreshedAt ? dayjs(lastRefreshedAt).format('YYYY-MM-DD HH:mm:ss') : ''}
</div>
<div>There are {trustedPubkeyCount} users in the WoT</div>
</div>
<Separator />
<div className="flex items-center justify-between pt-8">
<div className="flex items-center justify-between pb-8">
<div>Check if a pubkey is in the WoT</div>
<div className="flex items-center gap-2">
<Input
Expand All @@ -223,6 +224,13 @@ export default function Wot() {
</Button>
</div>
</div>
<div className="flex gap-2 items-center justify-between">
<Separator className="w-5/12" />
<div className="text-muted-foreground">or</div>
<Separator className="w-5/12" />
</div>
<div className="font-bold text-xl pt-8">PoW</div>
<PowOption />
</div>
)
}

0 comments on commit 141cf41

Please sign in to comment.