Skip to content

Commit 44a6a08

Browse files
remove react select (#1367)
Co-authored-by: Elizabet Oliveira <elizabet.oliveira@clickhouse.com>
1 parent af6a8d0 commit 44a6a08

File tree

10 files changed

+38
-461
lines changed

10 files changed

+38
-461
lines changed

.changeset/angry-walls-fetch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
Remove react-select for mantine

packages/app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
"react-markdown": "^8.0.4",
8787
"react-papaparse": "^4.4.0",
8888
"react-query": "^3.39.3",
89-
"react-select": "^5.7.0",
9089
"react-sortable-hoc": "^2.0.0",
9190
"react-useportal": "^1.0.18",
9291
"recharts": "^2.12.7",

packages/app/src/ChartUtils.tsx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useMemo, useRef } from 'react';
22
import { add } from 'date-fns';
3-
import Select from 'react-select';
43
import { z } from 'zod';
54
import {
65
filterColumnMetaByType,
@@ -197,33 +196,6 @@ export function seriesToUrlSearchQueryParam({
197196
});
198197
}
199198

200-
export function TableSelect({
201-
table,
202-
setTableAndAggFn,
203-
}: {
204-
setTableAndAggFn: (table: SourceTable, fn: AggFn) => void;
205-
table: string;
206-
}) {
207-
return (
208-
<Select
209-
options={TABLES}
210-
className="ds-select w-auto text-nowrap"
211-
value={TABLES.find(v => v.value === table)}
212-
onChange={opt => {
213-
const val = opt?.value ?? 'logs';
214-
if (val === 'logs') {
215-
setTableAndAggFn('logs', 'count');
216-
} else if (val === 'metrics') {
217-
// TODO: This should set rate if metric field is a sum
218-
// or we should just reset the field if changing tables
219-
setTableAndAggFn('metrics', 'max');
220-
}
221-
}}
222-
classNamePrefix="ds-react-select"
223-
/>
224-
);
225-
}
226-
227199
export function TableToggle({
228200
table,
229201
setTableAndAggFn,

packages/app/src/DSSelect.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/app/src/GranularityPicker.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { memo } from 'react';
22
import { useController, UseControllerProps } from 'react-hook-form';
3+
import { Select } from '@mantine/core';
34

45
import { Granularity } from './ChartUtils';
5-
import DSSelect from './DSSelect';
66

77
export default function GranularityPicker({
88
value,
@@ -14,9 +14,9 @@ export default function GranularityPicker({
1414
disabled?: boolean;
1515
}) {
1616
return (
17-
<DSSelect
17+
<Select
1818
disabled={disabled}
19-
options={[
19+
data={[
2020
{
2121
value: 'auto' as const,
2222
label: 'Auto Granularity',
@@ -58,7 +58,9 @@ export default function GranularityPicker({
5858
label: '7 Day Granularity',
5959
},
6060
]}
61-
onChange={onChange}
61+
onChange={v =>
62+
onChange((v ?? undefined) as Granularity | 'auto' | undefined)
63+
}
6264
value={value}
6365
/>
6466
);

packages/app/src/components/DBColumnMultiSelect.tsx

Lines changed: 0 additions & 144 deletions
This file was deleted.

packages/app/styles/AppNav.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
text-transform: uppercase;
3636
font-size: 11px;
3737
letter-spacing: 1px;
38-
margin-bottom: 2x;
38+
margin-bottom: 2px;
3939
margin-top: 6px;
4040
padding-left: 16px;
4141
width: 100%;

packages/app/styles/app.scss

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -180,69 +180,6 @@ body {
180180
}
181181
}
182182

183-
.ds-select {
184-
&.w-auto {
185-
.ds-react-select__menu {
186-
width: auto;
187-
}
188-
}
189-
&.text-nowrap {
190-
.ds-react-select__option {
191-
text-wrap: nowrap;
192-
}
193-
}
194-
195-
&.input-bg .ds-react-select__control {
196-
background: var(--color-bg-field);
197-
}
198-
199-
.ds-react-select__control {
200-
background: var(--color-bg-field);
201-
border: 1px solid var(--color-border);
202-
}
203-
204-
.ds-react-select__menu {
205-
background: var(--color-bg-field);
206-
border: 1px solid var(--color-border);
207-
}
208-
209-
.ds-react-select__option {
210-
color: var(--color-text);
211-
}
212-
213-
.ds-react-select__option--is-focused {
214-
background: var(--color-bg-muted);
215-
}
216-
217-
.ds-react-select__option--is-selected {
218-
background: var(--color-bg-muted);
219-
}
220-
221-
.ds-react-select__multi-value {
222-
background: var(--color-bg-field);
223-
224-
.ds-react-select__multi-value__label {
225-
color: var(--color-text);
226-
}
227-
}
228-
229-
.ds-react-select__indicator-separator {
230-
width: 0;
231-
}
232-
.ds-react-select__indicator {
233-
color: var(--color-text-muted);
234-
}
235-
236-
.ds-react-select__input-container,
237-
.ds-react-select__placeholder,
238-
.ds-react-select__single-value {
239-
// @apply text-neutral-600 dark:text-neutral-200;
240-
color: var(--color-text);
241-
// background: $bg-dark;
242-
background: transparent;
243-
}
244-
}
245-
246183
// React Grid for Dashboarding
247184
.react-grid-item.react-grid-placeholder {
248185
// Override the default placeholder color from red

0 commit comments

Comments
 (0)