Skip to content

Commit 0fbef30

Browse files
committed
fix: frontend bugs
1 parent 311ba4f commit 0fbef30

6 files changed

Lines changed: 22 additions & 24 deletions

File tree

frontend/components/ErrorModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from "./ui/index.js"
22
import type { ModalProps } from "./ui/index.js"
3-
import React, { useState } from "react"
3+
import { useState } from "react"
44
import { ErrorWithTitle } from "../utils/errors.js"
55

66
export interface ErrorState {
@@ -45,7 +45,7 @@ export function useErrorModal() {
4545
<p>{errorState.content}</p>
4646
</ModalBody>
4747
<ModalFooter>
48-
<Button color="danger" variant="light" onPress={onClose}>
48+
<Button variant="solid" onPress={onClose}>
4949
Close
5050
</Button>
5151
</ModalFooter>

frontend/components/UploadedPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function UploadedPanel({
4747
<div className={"min-h-[5rem] w-full relative"}>
4848
<CircularProgress
4949
aria-label={"Loading..."}
50-
value={loadingProgress}
50+
value={loadingProgress ?? 50}
5151
className={"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}
5252
/>
5353
</div>

frontend/components/ui/CircularProgress.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,24 @@ export interface CircularProgressProps extends React.HTMLAttributes<HTMLDivEleme
88
export function CircularProgress({ value, label, className = "", ...rest }: CircularProgressProps) {
99
const radius = 20
1010
const circumference = 2 * Math.PI * radius
11-
const progress = value !== undefined ? ((100 - value) / 100) * circumference : 0
11+
const progress = value !== undefined ? ((100 - value) / 100) * circumference : circumference * 0.25
1212

1313
return (
1414
<div className={`inline-flex flex-col items-center gap-2 ${className}`} {...rest}>
1515
<svg width="48" height="48" viewBox="0 0 48 48" className="animate-spin">
1616
<circle cx="24" cy="24" r={radius} fill="none" stroke="currentColor" strokeWidth="4" opacity="0.25" />
17-
{value !== undefined && (
18-
<circle
19-
cx="24"
20-
cy="24"
21-
r={radius}
22-
fill="none"
23-
stroke="currentColor"
24-
strokeWidth="4"
25-
strokeDasharray={circumference}
26-
strokeDashoffset={progress}
27-
strokeLinecap="round"
28-
transform="rotate(-90 24 24)"
29-
/>
30-
)}
17+
<circle
18+
cx="24"
19+
cy="24"
20+
r={radius}
21+
fill="none"
22+
stroke="currentColor"
23+
strokeWidth="4"
24+
strokeDasharray={circumference}
25+
strokeDashoffset={progress}
26+
strokeLinecap="round"
27+
transform="rotate(-90 24 24)"
28+
/>
3129
</svg>
3230
{label && <span className="text-sm">{label}</span>}
3331
</div>

frontend/components/ui/Modal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function Modal({ isOpen, onClose, children, ...rest }: ModalProps) {
3030
export function ModalContent({ children, className = "", ...rest }: React.HTMLAttributes<HTMLDivElement>) {
3131
return (
3232
<div
33-
className={`bg-gray-900 border border-gray-800 rounded-xl shadow-xl max-w-md w-full mx-4 ${className}`}
33+
className={`bg-content1 border border-divider rounded-xl shadow-xl max-w-md w-full mx-4 ${className}`}
3434
onClick={(e) => e.stopPropagation()}
3535
{...rest}
3636
>
@@ -41,23 +41,23 @@ export function ModalContent({ children, className = "", ...rest }: React.HTMLAt
4141

4242
export function ModalHeader({ children, className = "", ...rest }: React.HTMLAttributes<HTMLDivElement>) {
4343
return (
44-
<div className={`px-6 py-4 border-b border-gray-800 ${className}`} {...rest}>
44+
<div className={`px-4 pt-4 pb-2 text-lg font-semibold ${className}`} {...rest}>
4545
{children}
4646
</div>
4747
)
4848
}
4949

5050
export function ModalBody({ children, className = "", ...rest }: React.HTMLAttributes<HTMLDivElement>) {
5151
return (
52-
<div className={`px-6 py-4 ${className}`} {...rest}>
52+
<div className={`px-4 py-2 text-sm text-default-500 ${className}`} {...rest}>
5353
{children}
5454
</div>
5555
)
5656
}
5757

5858
export function ModalFooter({ children, className = "", ...rest }: React.HTMLAttributes<HTMLDivElement>) {
5959
return (
60-
<div className={`px-6 py-4 border-t border-gray-800 flex justify-end gap-2 ${className}`} {...rest}>
60+
<div className={`px-4 pb-4 pt-4 flex justify-end gap-2 ${className}`} {...rest}>
6161
{children}
6262
</div>
6363
)

frontend/pages/DisplayPaste.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react"
1+
import { useEffect, useState } from "react"
22
import chardet from "chardet"
33
import { useErrorModal } from "../components/ErrorModal.js"
44
import { DisplayPasteView } from "./DisplayPasteView.js"

frontend/pages/DisplayPasteView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function DisplayPasteView(props: DisplayPasteViewProps) {
124124
<div className={showFileContent ? "" : "h-[10em]"}>
125125
{showFileContent ? (
126126
<>
127-
<div className="text-foreground-600 mb-2 text-small flex flex-row gap-2">
127+
<div className="text-gray-500 mb-2 text-sm flex flex-row gap-2">
128128
<span>{pasteFile?.name}</span>
129129
<span>{`(${formatSize(pasteFile.size)})`}</span>
130130
{forceShowBinary && (

0 commit comments

Comments
 (0)