Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 24920ee

Browse files
authored
Merge pull request #33 from tinybirdco/feat/tremor-2.0.0
Migrate tremor to v2
2 parents b028c38 + 363508d commit 24920ee

File tree

9 files changed

+424
-248
lines changed

9 files changed

+424
-248
lines changed

dashboard/components/AnomalyDetection/AnomalyDetection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function AnomalyDetection() {
3535
<BarChart
3636
data={ipsWithMostCallsData ?? []}
3737
categories={['total']}
38-
dataKey="ip_address"
38+
index="ip_address"
3939
colors={['blue']}
4040
/>
4141
)}
@@ -49,7 +49,7 @@ export default function AnomalyDetection() {
4949
<BarChart
5050
data={ipsExceedingAvgCallsPerMinuteData ?? []}
5151
categories={['total']}
52-
dataKey="ip_address"
52+
index="ip_address"
5353
colors={['blue']}
5454
/>
5555
)}

dashboard/components/BasicStats/BasicStats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function BasicStatsContent() {
2323
<AreaChart
2424
data={functionCallsData ?? []}
2525
categories={['info', 'warn', 'error']}
26-
dataKey="hour"
26+
index="hour"
2727
colors={['blue', 'amber', 'red']}
2828
/>
2929
)}

dashboard/components/Credentials/CredentialsForm.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FormEvent, useRef, useState } from 'react'
1+
import { FormEvent, useState } from 'react'
22
import { useRouter } from 'next/router'
33

44
import { Button, SelectBox, SelectBoxItem, TextInput } from '@tremor/react'
@@ -14,7 +14,6 @@ const hostOptions: OptionType<HostType>[] = [
1414

1515
export default function CredentialsForm() {
1616
const router = useRouter()
17-
const formRef = useRef<HTMLFormElement>(null)
1817
const [hostType, setHostType] = useState<HostType>(hostOptions[0].value)
1918

2019
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
@@ -32,7 +31,6 @@ export default function CredentialsForm() {
3231

3332
return (
3433
<form
35-
ref={formRef}
3634
onSubmit={handleSubmit}
3735
className="flex flex-col justify-between h-full"
3836
aria-labelledby="credentials-title"
@@ -45,7 +43,6 @@ export default function CredentialsForm() {
4543
<TextInput
4644
name="token"
4745
placeholder="p.eyJ3kdsfk2395IjogImMzZTMwNDIxLTYwNzctNGZhMS1iMjY1LWQwM2JhZDIzZGRlOCIsICJpZCI6ICIwYmUzNTgzNi0zODAyLTQwMmUtOTUxZi0zOWFm"
48-
marginTop="mt-0"
4946
/>
5047
<p className="text-xs text-secondaryLight">
5148
Copy the token named dashboard generated with your web-analytics
@@ -57,7 +54,10 @@ export default function CredentialsForm() {
5754
<label className="block text-sm font-normal text-neutral-64 mb-1">
5855
Host
5956
</label>
60-
<SelectBox value={hostType} onValueChange={setHostType}>
57+
<SelectBox
58+
value={hostType}
59+
onValueChange={value => setHostType(value as HostType)}
60+
>
6161
{hostOptions.map(({ text, value }) => (
6262
<SelectBoxItem key={value} text={text} value={value} />
6363
))}
@@ -75,10 +75,7 @@ export default function CredentialsForm() {
7575
</div>
7676
</div>
7777
<div className="flex flex-col items-end">
78-
<Button
79-
text="View dashboard"
80-
handleClick={() => formRef.current?.requestSubmit()}
81-
/>
78+
<Button type="submit">View dashboard</Button>
8279
<p className="text-xs text-neutral-64 mt-3">
8380
Not sure what to do next?{' '}
8481
<a

dashboard/components/ErrorModal.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ export default function ErrorModal() {
6262
</Modal.Description>
6363
</div>
6464
<div className="flex justify-end">
65-
<Button
66-
importance="secondary"
67-
text="Close"
68-
handleClick={handleClose}
69-
/>
65+
<Button variant="secondary" onClick={handleClose}>
66+
Close
67+
</Button>
7068
</div>
7169
</Modal.Content>
7270
</Modal>

dashboard/components/ErrorStats/ErrorStats.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export default function ErrorStats() {
5252
<div className="hidden sm:block">
5353
<TabList
5454
defaultValue="ErrorsFrequency"
55-
onValueChange={setSelectedTab}
55+
onValueChange={value =>
56+
setSelectedTab(value as typeof selectedTab)
57+
}
5658
>
5759
<Tab value="ErrorsFrequency" text="Error Frequency" />
5860
<Tab value="FunctionErrors" text="Function Errors" />
@@ -74,7 +76,7 @@ export default function ErrorStats() {
7476
<AreaChart
7577
data={errorFrequencyData ?? []}
7678
categories={['total']}
77-
dataKey="hour"
79+
index="hour"
7880
colors={['blue']}
7981
/>
8082
)}

0 commit comments

Comments
 (0)