Skip to content

Commit 663aba1

Browse files
committed
formmating
1 parent 5f52fe3 commit 663aba1

File tree

5 files changed

+81
-79
lines changed

5 files changed

+81
-79
lines changed

src/components/dagshub/data-engine/annotations/LabelStudioPolygonDrawer.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ function getSingleAnnotationResultLayers(
173173
const [cx, cy] = pointPercentToPixel([cxPercent, cyPercent], dimension);
174174
const [rx, ry] = pointPercentToPixel([rxPercent, ryPercent], dimension);
175175

176-
const strokeWidth = rx * 2 > minStrokedObjectSize || ry * 2 > minStrokedObjectSize ? polygonStrokeWidth : 0;
176+
const strokeWidth =
177+
rx * 2 > minStrokedObjectSize || ry * 2 > minStrokedObjectSize ? polygonStrokeWidth : 0;
177178

178179
labelLayersPush(
179180
<Ellipse

src/components/elements/dateManager/index.tsx

+49-49
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { LocalizationProvider } from '@mui/x-date-pickers';
66
import { Button, ButtonStretch, ButtonVariant } from '../button';
77
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
88
import theme from '../../../theme';
9-
import PresetsContent, {PresetType} from './Presets';
9+
import PresetsContent, { PresetType } from './Presets';
1010
import { SearchForm } from './SearchForm';
1111

1212
export interface DateManagerProps {
@@ -17,8 +17,8 @@ export interface DateManagerProps {
1717
}
1818

1919
const formattedDate = (
20-
date: string | number | dayjs.Dayjs | Date | null | undefined,
21-
hour: string | number | dayjs.Dayjs | Date | null | undefined
20+
date: string | number | dayjs.Dayjs | Date | null | undefined,
21+
hour: string | number | dayjs.Dayjs | Date | null | undefined
2222
) => {
2323
return `${dayjs(date).format('YYYY-MM-DD')} ${dayjs(hour).format('HH:mm:ss')}`;
2424
};
@@ -43,59 +43,59 @@ export const DateManager = ({ presets, addClickedHandler, close, loading }: Date
4343
}, [hour, date]);
4444

4545
return (
46-
<LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale={'en-gb'}>
47-
<ThemeProvider theme={theme}>
48-
<Box width={'530px'} height={'100%'} color={'#172D32'} px={1}>
49-
<Typography component={'div'} p={1} variant={'mediumBold'}>
50-
Compare to previous version
51-
</Typography>
52-
<Divider sx={{ backgroundColor: '#F8FAFC' }} />
46+
<LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale={'en-gb'}>
47+
<ThemeProvider theme={theme}>
48+
<Box width={'530px'} height={'100%'} color={'#172D32'} px={1}>
49+
<Typography component={'div'} p={1} variant={'mediumBold'}>
50+
Compare to previous version
51+
</Typography>
52+
<Divider sx={{ backgroundColor: '#F8FAFC' }} />
5353

54-
<Box display={'flex'}>
55-
<SearchForm
56-
setErrorDate={setErrorDate}
57-
setDisplayName={setDisplayName}
58-
setDisplayNameTouched={setDisplayNameTouched}
59-
setHour={setHour}
60-
hour={hour}
61-
setDate={setDate}
62-
date={date}
63-
displayName={displayName}
64-
/>
54+
<Box display={'flex'}>
55+
<SearchForm
56+
setErrorDate={setErrorDate}
57+
setDisplayName={setDisplayName}
58+
setDisplayNameTouched={setDisplayNameTouched}
59+
setHour={setHour}
60+
hour={hour}
61+
setDate={setDate}
62+
date={date}
63+
displayName={displayName}
64+
/>
6565

66-
<Divider flexItem orientation={'vertical'} sx={{ backgroundColor: '#F8FAFC' }} />
66+
<Divider flexItem orientation={'vertical'} sx={{ backgroundColor: '#F8FAFC' }} />
6767

68-
<Box px={1} py={2} width={'50%'}>
69-
<PresetsContent presets={presets} onPresetClick={(value) => setDate(dayjs(value))} />
70-
</Box>
68+
<Box px={1} py={2} width={'50%'}>
69+
<PresetsContent presets={presets} onPresetClick={(value) => setDate(dayjs(value))} />
7170
</Box>
71+
</Box>
7272

73-
<Divider sx={{ backgroundColor: '#F8FAFC' }} />
74-
<Box p={1} display={'flex'} alignItems={'center'} justifyContent={'space-between'}>
75-
<Box display={'flex'} justifyContent={'flex-end'}>
76-
<Typography color={'#64748B'} component="div" variant={'small'}>
77-
Browser time: (GMT {dayjs(new Date()).format('Z')})
78-
</Typography>
79-
</Box>
73+
<Divider sx={{ backgroundColor: '#F8FAFC' }} />
74+
<Box p={1} display={'flex'} alignItems={'center'} justifyContent={'space-between'}>
75+
<Box display={'flex'} justifyContent={'flex-end'}>
76+
<Typography color={'#64748B'} component="div" variant={'small'}>
77+
Browser time: (GMT {dayjs(new Date()).format('Z')})
78+
</Typography>
79+
</Box>
8080

81-
<Box gap={1} display={'flex'} justifyContent={'flex-end'}>
82-
<Button
83-
stretch={ButtonStretch.Slim}
84-
variant={ButtonVariant.OutlineSecondary}
85-
onClick={close}
86-
label={'Cancel'}
87-
/>
88-
<Button
89-
stretch={ButtonStretch.Slim}
90-
variant={ButtonVariant.Primary}
91-
onClick={() => addClickedHandler({ alias: displayName, value })}
92-
disabled={!date || errorDate || loading}
93-
label={loading ? 'loading...' : 'Add Field'}
94-
/>
95-
</Box>
81+
<Box gap={1} display={'flex'} justifyContent={'flex-end'}>
82+
<Button
83+
stretch={ButtonStretch.Slim}
84+
variant={ButtonVariant.OutlineSecondary}
85+
onClick={close}
86+
label={'Cancel'}
87+
/>
88+
<Button
89+
stretch={ButtonStretch.Slim}
90+
variant={ButtonVariant.Primary}
91+
onClick={() => addClickedHandler({ alias: displayName, value })}
92+
disabled={!date || errorDate || loading}
93+
label={loading ? 'loading...' : 'Add Field'}
94+
/>
9695
</Box>
9796
</Box>
98-
</ThemeProvider>
99-
</LocalizationProvider>
97+
</Box>
98+
</ThemeProvider>
99+
</LocalizationProvider>
100100
);
101101
};

src/components/icons/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ export const icons = {
20932093
fill="#64748B"
20942094
/>
20952095
</svg>
2096-
)
2096+
),
20972097
};
20982098

20992099
export type IconType = keyof typeof icons;
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
import { Meta, StoryFn } from '@storybook/react';
22
import React from 'react';
33
import { DateManager, DateManagerProps } from '../../../components';
4-
5-
function deductDays(days: number) {
6-
const date = new Date();
7-
return date.setDate(date.getDay() - days);
8-
}
4+
import dayjs from 'dayjs';
5+
import { Box } from '@mui/system';
96

107
const meta: Meta<DateManagerProps> = {
118
title: 'Elements/Date Manager',
12-
component: DateManager
9+
component: DateManager,
1310
};
1411

1512
export default meta;
1613

17-
const Template: StoryFn<DateManagerProps> = (args) => <DateManager {...args} />;
14+
const Template: StoryFn<DateManagerProps> = (args) => (
15+
<Box sx={{ backgroundColor: 'white', width: 'fit-content' }}>
16+
<DateManager {...args} />
17+
</Box>
18+
);
1819

1920
export const DateManagerExample = Template.bind({});
2021
DateManagerExample.args = {
2122
presets: [
2223
{
2324
name: '1 day ago',
24-
value: deductDays(1)
25+
value: dayjs().subtract(1, 'day'),
2526
},
2627
{
2728
name: '1 week ago',
28-
value: deductDays(7)
29+
value: dayjs().subtract(7, 'day'),
2930
},
3031
{
3132
name: '1 month ago',
32-
value: deductDays(30)
33-
}
34-
]
33+
value: dayjs().subtract(30, 'day'),
34+
},
35+
],
3536
};

src/theme.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ const lightTheme = createTheme({
121121
style: {
122122
fontWeight: 700,
123123
fontSize: '16px',
124-
lineHeight: '24px'
125-
}
126-
}
127-
]
124+
lineHeight: '24px',
125+
},
126+
},
127+
],
128128
},
129129
MuiButtonBase: {
130130
defaultProps: {
131-
disableRipple: true
132-
}
131+
disableRipple: true,
132+
},
133133
},
134134
MuiInputBase: {
135135
styleOverrides: {
@@ -144,10 +144,10 @@ const lightTheme = createTheme({
144144
outline: '0',
145145
'& fieldset': { border: 'none' },
146146
'&:focus-within': {
147-
boxShadow: '0px 0px 0px 3px rgba(196, 181, 253, 0.5)'
148-
}
149-
}
150-
}
147+
boxShadow: '0px 0px 0px 3px rgba(196, 181, 253, 0.5)',
148+
},
149+
},
150+
},
151151
},
152152
MuiOutlinedInput: {
153153
styleOverrides: {
@@ -158,12 +158,12 @@ const lightTheme = createTheme({
158158
border: '2px solid #cbd5e1',
159159
'& fieldset': { border: 'none' },
160160
'&:focus': {
161-
boxShadow: '0px 0px 0px 3px rgba(196, 181, 253, 0.5)'
162-
}
163-
}
164-
}
165-
}
166-
}
161+
boxShadow: '0px 0px 0px 3px rgba(196, 181, 253, 0.5)',
162+
},
163+
},
164+
},
165+
},
166+
},
167167
});
168168

169169
export default lightTheme;

0 commit comments

Comments
 (0)