Skip to content

Commit 7c808fe

Browse files
committed
Style adjustment
1 parent 8800d2a commit 7c808fe

7 files changed

Lines changed: 30 additions & 38 deletions

File tree

backend/frontend/src/components/ImageThumbnail.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { Anchor } from '@mantine/core'
22

3-
export function ImageThumbnail({
4-
type, group, name, hardware, timestamp, stopPropagation = false,
5-
}: {
3+
interface Props {
64
type: string
75
group: string
86
name: string
97
hardware: string
108
timestamp?: string
119
stopPropagation?: boolean
12-
}) {
10+
};
11+
12+
export function ImageThumbnail({
13+
type, group, name, hardware, timestamp, stopPropagation = false,
14+
}: Props) {
1315
const timePart = timestamp ? `/${timestamp}` : ''
1416
return (
1517
<Anchor

backend/frontend/src/components/SortableHeader.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { Table } from '@mantine/core'
22
import { SortColumn } from '../types'
33

4-
export function SortableHeader({
5-
sortKey,
6-
label,
7-
onSort,
8-
}: {
4+
interface Props {
95
sortKey: SortColumn
106
label: string
117
onSort: (col: SortColumn) => void
12-
}) {
8+
};
9+
10+
export function SortableHeader({ sortKey, label, onSort }: Props) {
1311
return (
1412
<Table.Th style={{ cursor: 'pointer' }} onClick={() => onSort(sortKey)}>
1513
{label}

backend/frontend/src/components/TestHistory.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import { TestRecord, TestData } from '../types'
33
import { diffDisplay, diffStyle, timingDisplay } from '../utils'
44
import { ImageThumbnail } from './ImageThumbnail'
55

6-
export function TestHistory({
7-
record,
8-
onUpdateReference,
9-
}: {
6+
interface Props {
107
record: TestRecord
118
onUpdateReference: (record: TestRecord) => void
12-
}) {
9+
};
10+
11+
export function TestHistory({ record, onUpdateReference }: Props) {
1312
const testData = [...record.data].reverse()
1413

1514
return (
@@ -32,28 +31,26 @@ export function TestHistory({
3231
{testData.map((d: TestData, i: number) => (
3332
<Table.Tr key={d.timeStamp}>
3433
<Table.Td>
35-
<Text size="xs" c="dimmed">{new Date(d.timeStamp).toUTCString()}</Text>
34+
<Text size="sm" c="dimmed">{new Date(d.timeStamp).toUTCString()}</Text>
3635
</Table.Td>
3736
<Table.Td>
38-
<Box px={4} style={{ borderRadius: 4, display: 'inline-block', ...diffStyle(d.pixelError) }}>
39-
<Text size="sm">{diffDisplay(d.pixelError)}</Text>
37+
<Box px={4} style={{ borderRadius: 4, display: 'inline-block', width: 70, textAlign: 'center', ...diffStyle(d.pixelError) }}>
38+
<Text>{diffDisplay(d.pixelError)}</Text>
4039
</Box>
4140
</Table.Td>
4241
<Table.Td>
4342
<Anchor
44-
size="xs"
4543
href={`https://github.com/OpenSpace/OpenSpace/commit/${d.commitHash}`}
4644
target="_blank"
4745
>
4846
{d.commitHash.substring(0, 8)}
4947
</Anchor>
5048
</Table.Td>
5149
<Table.Td>
52-
<Text size="sm">{timingDisplay(d.timing)}</Text>
50+
<Text>{timingDisplay(d.timing)}</Text>
5351
</Table.Td>
5452
<Table.Td>
5553
<Anchor
56-
size="xs"
5754
href={`/api/result/log/${record.group}/${record.name}/${record.hardware}/${d.timeStamp}`}
5855
target="_blank"
5956
>
@@ -74,7 +71,7 @@ export function TestHistory({
7471
</Table.Td>
7572
<Table.Td>
7673
{i === 0 && (
77-
<Button size="xs" variant="default" onClick={() => onUpdateReference(record)}>
74+
<Button variant="default" onClick={() => onUpdateReference(record)}>
7875
Upgrade Candidate to Reference
7976
</Button>
8077
)}

backend/frontend/src/components/TestRow.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@ import { TestRecord } from '../types'
33
import { diffDisplay, diffStyle, timingDisplay } from '../utils'
44
import { ImageThumbnail } from './ImageThumbnail'
55

6-
export function TestRow({
7-
record,
8-
onOpen,
9-
}: {
6+
interface Props {
107
record: TestRecord
118
onOpen: (record: TestRecord) => void
12-
}) {
9+
};
10+
11+
export function TestRow({ record, onOpen }: Props) {
1312
const latestData = record.data[record.data.length - 1]
1413
if (!latestData) return null
1514

1615
return (
1716
<Table.Tr style={{ cursor: 'pointer' }} onClick={() => onOpen(record)}>
18-
<Table.Td>
17+
<Table.Td style={{ width: 90 }}>
1918
<Box
2019
px={6}
2120
py={2}

backend/frontend/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ createRoot(document.getElementById('root')!).render(
1010
<MantineProvider defaultColorScheme="dark">
1111
<App />
1212
</MantineProvider>
13-
</StrictMode>,
13+
</StrictMode>
1414
)

backend/frontend/src/pages/Compare.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@ import { diffDisplay, diffStyle } from '../utils'
88

99
type ImageType = 'reference' | 'candidate'
1010

11-
function CompareCell({
12-
type,
13-
group,
14-
name,
15-
hardware1,
16-
hardware2,
17-
}: {
11+
interface Props {
1812
type: string
1913
group: string
2014
name: string
2115
hardware1: string
2216
hardware2: string
23-
}) {
17+
};
18+
19+
function CompareCell({ type, group, name, hardware1, hardware2, }: Props) {
2420
const [pixelError, setPixelError] = useState<number | null>(null)
2521
const compareUrl = `/api/compare/${type}/${group}/${name}/${hardware1}/${hardware2}`
2622

backend/frontend/src/pages/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function Home() {
7070
<Box>
7171
{/* Header */}
7272
<Box py="md" style={{ textAlign: 'center', backgroundColor: 'var(--mantine-color-dark-7)' }}>
73-
<Title order={1} style={{ fontVariant: 'small-caps' }}>
73+
<Title order={1} style={{ fontVariant: 'small-caps', fontFamily: 'Roboto, sans-serif' }}>
7474
<Link to="/" style={{ textDecoration: 'none', color: 'white' }}>
7575
OpenSpace Image Testing
7676
</Link>

0 commit comments

Comments
 (0)