Skip to content

Commit b20983f

Browse files
committed
refactor(DateRange): make DateRange a separate component
1 parent 34f066f commit b20983f

File tree

5 files changed

+17
-20
lines changed

5 files changed

+17
-20
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.date-range {
2+
&__input {
3+
min-width: 190px;
4+
padding: 5px 8px;
5+
6+
color: var(--yc-color-text-primary);
7+
border: 1px solid var(--yc-color-line-generic);
8+
border-radius: var(--yc-border-radius-m);
9+
background: transparent;
10+
}
11+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import cn from 'bem-cn-lite';
21
import {ChangeEventHandler} from 'react';
2+
import cn from 'bem-cn-lite';
33

44
import './DateRange.scss';
55

6-
const b = cn('overloaded-shards');
6+
const b = cn('date-range');
77

88
export interface DateRangeValues {
99
/** ms from epoch */
@@ -54,21 +54,21 @@ export const DateRange = ({from, to, className, onChange}: DateRangeProps) => {
5454
const endISO = toTimezonelessISOString(to);
5555

5656
return (
57-
<div className={b('date-range', className)}>
57+
<div className={b(null, className)}>
5858
<input
5959
type="datetime-local"
6060
value={startISO}
6161
max={endISO}
6262
onChange={handleFromChange}
63-
className={b('date-range-input')}
63+
className={b('input')}
6464
/>
6565
6666
<input
6767
type="datetime-local"
6868
min={startISO}
6969
value={endISO}
7070
onChange={handleToChange}
71-
className={b('date-range-input')}
71+
className={b('input')}
7272
/>
7373
</div>
7474
);

src/containers/Tenant/Diagnostics/OverloadedShards/DateRange/DateRange.scss

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

src/containers/Tenant/Diagnostics/OverloadedShards/OverloadedShards.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import cn from 'bem-cn-lite';
55
import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-table';
66
import {Loader} from '@gravity-ui/uikit';
77

8+
import {DateRange, DateRangeValues} from '../../../../components/DateRange';
89
import InternalLink from '../../../../components/InternalLink/InternalLink';
910

1011
import HistoryContext from '../../../../contexts/HistoryContext';
@@ -30,8 +31,6 @@ import {getDefaultNodePath} from '../../../Node/NodePages';
3031

3132
import {isColumnEntityType} from '../../utils/schema';
3233

33-
import {DateRange, DateRangeValues} from './DateRange';
34-
3534
import i18n from './i18n';
3635
import './OverloadedShards.scss';
3736

0 commit comments

Comments
 (0)