Skip to content

Commit

Permalink
chore: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
TwilightLogic committed Jun 6, 2024
1 parent bf6e850 commit e9be6b8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
19 changes: 8 additions & 11 deletions infra/rooch-portal/src/components/session-key-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ interface SessionKeyModalProps {
}

export const SessionKeyModal: React.FC<SessionKeyModalProps> = ({
isOpen,
scopes,
onAuthorize,
error,
}) => {
isOpen,
scopes,
onAuthorize,
error,
}) => {
const [loading, setLoading] = useState(false)

const onAuthorizeWrapper = async () => {
Expand All @@ -36,13 +36,10 @@ export const SessionKeyModal: React.FC<SessionKeyModalProps> = ({
<div className="bg-white dark:bg-zinc-800 p-4 rounded-lg shadow-lg max-w-sm w-full relative">
<h2 className="text-lg font-bold mb-4">Session Authorize</h2>
<p className="text-sm text-muted-foreground mb-2">
The current session does not exist or has expired. Please authorize the creation of a new session.
The current session does not exist or has expired. Please authorize the creation of a new
session.
</p>
{error && (
<div className="bg-red-100 text-red-700 p-3 rounded mb-4 text-sm">
{error}
</div>
)}
{error && <div className="bg-red-100 text-red-700 p-3 rounded mb-4 text-sm">{error}</div>}
<div className="bg-zinc-700 p-4 rounded-lg">
{/* SCOPE */}
<div className="flex flex-col items-start justify-start text-gray-300 text-sm overflow-auto">
Expand Down
6 changes: 4 additions & 2 deletions infra/rooch-portal/src/guard/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const SessionGuard = (props: SessionGuardProps) => {

setOpen(
sessionKey === null &&
navItems().find((item) => s.pathname.startsWith(item.path) && item.auth) !== undefined,
navItems().find((item) => s.pathname.startsWith(item.path) && item.auth) !== undefined,
)
}, [isConnected, s, sessionKey])

Expand All @@ -52,7 +52,9 @@ export const SessionGuard = (props: SessionGuardProps) => {
})

if (result === null) {
setError('Authorization failed due to insufficient gas fees. Please ensure you have enough gas fees.')
setError(
'Authorization failed due to insufficient gas fees. Please ensure you have enough gas fees.',
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Copy, ChevronDown, ChevronUp, Check, AlertCircle } from 'lucide-react'

import { formatTimestamp } from '@/utils/format.ts'

import {SessionInfoResult} from '@roochnetwork/rooch-sdk';
import { SessionInfoResult } from '@roochnetwork/rooch-sdk'

interface ExpandableRowProps {
session: SessionInfoResult
Expand All @@ -45,7 +45,7 @@ export const ManageSessions: React.FC = () => {
data: sessionKeys,
isLoading,
isError,
refetch
refetch,
} = useRoochClientQuery('querySessionKeys', {
address: sessionKey?.getAddress() || '',
})
Expand Down Expand Up @@ -148,8 +148,12 @@ const ExpandableRow: React.FC<ExpandableRowProps> = ({ session, remove }) => {
)}
</div>
</TableCell>
<TableCell className="text-muted-foreground">{formatTimestamp(session.createTime)}</TableCell>
<TableCell className="text-muted-foreground">{formatTimestamp(session.lastActiveTime)}</TableCell>
<TableCell className="text-muted-foreground">
{formatTimestamp(session.createTime)}
</TableCell>
<TableCell className="text-muted-foreground">
{formatTimestamp(session.lastActiveTime)}
</TableCell>
<TableCell className="text-muted-foreground">{session.maxInactiveInterval}</TableCell>
<TableCell className="text-center">
<Button
Expand All @@ -158,9 +162,7 @@ const ExpandableRow: React.FC<ExpandableRowProps> = ({ session, remove }) => {
onClick={() => remove(session.authenticationKey)}
className="text-red-500 dark:text-red-400 dark:hover:text-red-300 hover:text-red-600"
>
{
session.lastActiveTime > new Date().getSeconds() ? 'Disconnect' : 'Expired (Clear)'
}
{session.lastActiveTime > new Date().getSeconds() ? 'Disconnect' : 'Expired (Clear)'}
</Button>
</TableCell>
</TableRow>
Expand Down

0 comments on commit e9be6b8

Please sign in to comment.