Skip to content

Commit

Permalink
ui: add animation in FilterMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Arnauer committed Aug 3, 2022
1 parent 9390655 commit 05222fe
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions frontend/src/pages/Overview/FilterMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import React from "react";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import MenuItem from "@mui/material/MenuItem";
import { keyframes } from "@mui/system";

import strings from "../../localizeStrings";
import DropDown from "../Common/NewDropdown";
import DatePicker from "../Common/DatePicker";

const FilterMenu = props => {
const flyInAnimation = keyframes`
0% { opacity: 0; }
100% { opacity: 1; }
`;

const FilterMenu = (props) => {
const {
startDate,
setStartDate,
Expand All @@ -22,32 +28,32 @@ const FilterMenu = props => {
} = props;

return (
<Box data-test="filter-menu">
<Box sx={{ display: "flex", margin: "0px" }}>
<Box data-test="filter-menu" style={{}}>
<Box sx={{ display: "flex", margin: "0px", animation: `${flyInAnimation} 1s ease` }}>
<Box sx={{ marginLeft: "0px" }}>
<DatePicker
id="filter-start"
label={strings.history.start_date}
name="start"
datetime={startDate}
onChange={selectedDate => setStartDate(selectedDate)}
onChange={(selectedDate) => setStartDate(selectedDate)}
onDelete={() => setStartDate(null)}
/>
<DatePicker
id="filter-end"
label={strings.history.end_date}
name="end"
datetime={endDate}
onChange={selectedDate => setEndDate(selectedDate)}
onChange={(selectedDate) => setEndDate(selectedDate)}
onDelete={() => setEndDate(null)}
/>
</Box>
<Box>
<DropDown
style={{ minWidth: 200, marginLeft: "10px" }}
value={status}
floatingLabel={"Status"}
onChange={x => setStatus(x)}
floatingLabel={strings.common.status}
onChange={(x) => setStatus(x)}
id="status-select"
>
<MenuItem key={"status-all"} value={"all"}>
Expand All @@ -64,14 +70,14 @@ const FilterMenu = props => {
<DropDown
style={{ minWidth: 200, marginLeft: "10px" }}
value={assigneeId}
floatingLabel={"Assignee"}
onChange={x => setAssigneeId(x)}
floatingLabel={strings.common.assignee}
onChange={(x) => setAssigneeId(x)}
id="assignee-select"
>
<MenuItem key={"assignee-all"} value={"all"}>
{strings.common.all}
</MenuItem>
{users.map(u => {
{users.map((u) => {
return (
<MenuItem key={"assignee-" + u.id} value={u.id}>
{u.id}
Expand Down

0 comments on commit 05222fe

Please sign in to comment.