mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-07-29 18:21:01 -04:00
improve time range selector usability
* hide the end day selector away when it's not in use. It was confusing, especially since it seemed to have a purely black circle over the selected date when disabled. * add a "Time" label to the time selectors. On desktop, this isn't entirely necessary because they have clock icons and "hh:mm:ss" annotations. But on mobile, they were entirely blank, so it was unclear what they were for.
This commit is contained in:
parent
7522b37de7
commit
1cb6a19a65
@ -16,6 +16,7 @@ import FormLabel from "@material-ui/core/FormLabel";
|
|||||||
import Radio from "@material-ui/core/Radio";
|
import Radio from "@material-ui/core/Radio";
|
||||||
import RadioGroup from "@material-ui/core/RadioGroup";
|
import RadioGroup from "@material-ui/core/RadioGroup";
|
||||||
import TimePicker, { TimePickerProps } from "@material-ui/lab/TimePicker";
|
import TimePicker, { TimePickerProps } from "@material-ui/lab/TimePicker";
|
||||||
|
import Collapse from "@material-ui/core/Collapse";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
selectedStreams: Set<Stream>;
|
selectedStreams: Set<Stream>;
|
||||||
@ -28,6 +29,7 @@ const MyTimePicker = (
|
|||||||
props: Pick<TimePickerProps, "value" | "onChange" | "disabled">
|
props: Pick<TimePickerProps, "value" | "onChange" | "disabled">
|
||||||
) => (
|
) => (
|
||||||
<TimePicker
|
<TimePicker
|
||||||
|
label="Time"
|
||||||
views={["hours", "minutes", "seconds"]}
|
views={["hours", "minutes", "seconds"]}
|
||||||
renderInput={(params) => <TextField size="small" {...params} />}
|
renderInput={(params) => <TextField size="small" {...params} />}
|
||||||
inputFormat="HH:mm:ss"
|
inputFormat="HH:mm:ss"
|
||||||
@ -307,6 +309,7 @@ const TimerangeSelector = ({
|
|||||||
label="Other day"
|
label="Other day"
|
||||||
/>
|
/>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
<Collapse in={days.endType === "other-day"}>
|
||||||
<StaticDatePicker
|
<StaticDatePicker
|
||||||
displayStaticWrapperAs="desktop"
|
displayStaticWrapperAs="desktop"
|
||||||
value={endDate}
|
value={endDate}
|
||||||
@ -320,8 +323,11 @@ const TimerangeSelector = ({
|
|||||||
onChange={(d: Date | null) => {
|
onChange={(d: Date | null) => {
|
||||||
updateDays({ op: "set-end-day", newEndDate: d! });
|
updateDays({ op: "set-end-day", newEndDate: d! });
|
||||||
}}
|
}}
|
||||||
renderInput={(params) => <TextField {...params} variant="outlined" />}
|
renderInput={(params) => (
|
||||||
|
<TextField {...params} variant="outlined" />
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
|
</Collapse>
|
||||||
<MyTimePicker
|
<MyTimePicker
|
||||||
value={endTime}
|
value={endTime}
|
||||||
onChange={(newValue) => {
|
onChange={(newValue) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user