Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving the mobile css #180

Merged
merged 10 commits into from
Sep 29, 2024
5 changes: 3 additions & 2 deletions ui/src/common/DateTimeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ export const DateTimeSelector: React.FC<DateTimeSelectorProps> = React.memo(

return (
<KeyboardDateTimePicker
variant="inline"
className="time-picker"
variant="dialog"
InputProps={{disableUnderline: true}}
title={selectedDate.format()}
style={{width: (showDate ? 185 : 95) + (ampm ? 20 : 0)}}
style={{width: (showDate ? 185 : 105) + (ampm ? 20 : 0)}}
PopoverProps={{
onEntered: () => {
popoverOpen(true);
Expand Down
10 changes: 9 additions & 1 deletion ui/src/common/TagChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ export const TagChip = ({color, label}: {label: string; color: string}) => {
<Chip
tabIndex={-1}
variant="outlined"
style={{background: color, margin: '5px', color: textColor, cursor: 'text'}}
style={{
background: color,
margin: '5px',
color: textColor,
cursor: 'text',
minHeight: '32px',
whiteSpace: 'normal',
wordBreak: 'break-word',
}}
label={label}
/>
);
Expand Down
1 change: 0 additions & 1 deletion ui/src/dashboard/DashboardsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const useStyles = makeStyles((theme) => ({
paddingBottom: theme.spacing(3),
textAlign: 'center',
maxWidth: 800,
minWidth: 500,
margin: '0 auto',
},
}));
Expand Down
1 change: 0 additions & 1 deletion ui/src/devices/DevicesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const useStyles = makeStyles((theme) => ({
paddingBottom: theme.spacing(3),
textAlign: 'center',
maxWidth: 1200,
minWidth: 800,
margin: '0 auto',
},
}));
Expand Down
32 changes: 32 additions & 0 deletions ui/src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,35 @@ body,
html {
height: 100%;
}

/* Allows the tag Chips to wrap lines */
.MuiChip-label {
white-space: normal !important;
}

/* The wrapping box around the input and icon for the datetime picker */
.time-picker .MuiInputBase-root.MuiInput-root.MuiInputBase-formControl.MuiInput-formControl.MuiInputBase-adornedEnd {
margin-top: 0;
}

/* The calendar icon for the datetime picker */
.time-picker
.MuiInputBase-root.MuiInputBase-formControl.MuiInputBase-adornedEnd
.MuiInputAdornment-root.MuiInputAdornment-positionEnd
.MuiButtonBase-root.MuiIconButton-root {
position: absolute;
left: 0;
}

/* The label for the datetime picker */
.time-picker.MuiFormControl-root.MuiTextField-root .MuiFormLabel-root.MuiInputLabel-root.MuiInputLabel-formControl {
margin-left: 48px;
}

/* The input box for the datetime picker */
.time-picker.MuiFormControl-root.MuiTextField-root .MuiInputBase-input.MuiInput-input.MuiInputBase-inputAdornedEnd {
margin-left: 48px;
/* margin-top: 8px; */
margin-top: 12px;
min-width: calc(100% - 48px);
}
1 change: 0 additions & 1 deletion ui/src/setting/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const useStyles = makeStyles((theme) => ({
paddingTop: theme.spacing(1),
paddingBottom: theme.spacing(3),
maxWidth: 500,
minWidth: 500,
margin: '0 auto',
},
}));
Expand Down
1 change: 0 additions & 1 deletion ui/src/tag/TagPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const useStyles = makeStyles((theme) => ({
paddingBottom: theme.spacing(3),
textAlign: 'center',
maxWidth: 1200,
minWidth: 800,
margin: '0 auto',
},
}));
Expand Down
4 changes: 2 additions & 2 deletions ui/src/tag/TagSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const TagSelector: React.FC<TagSelectorProps> = ({

return (
<ClickAwayListener onClickAway={() => setOpen(false)}>
<div>
<div style={{width: '100%'}}>
<Tooltip
disableFocusListener
disableHoverListener
Expand All @@ -152,7 +152,7 @@ export const TagSelector: React.FC<TagSelectorProps> = ({
}>
<div
ref={(ref) => (container.current = ref)}
style={{display: 'flex', flexWrap: 'wrap', cursor: 'text'}}
style={{display: 'flex', flexWrap: 'wrap', cursor: 'text', width: '100%'}}
onClick={focusInput}>
{toChips(selectedEntries)}
<Input
Expand Down
Loading
Loading