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

551 feature filtering searches for rooms filter sidebar #564

Draft
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

bengodw
Copy link

@bengodw bengodw commented Oct 31, 2024

In this pull request:

  • connected all rooms filter sidebar to backend endpoint

  • made small styling changes to allrooms page layout (removing mobile filter, adding loading state)

  • changed filter sidebar logic to use regular filter slice

  • fixed allroomsfilterslice, it is now unused but could be used if we wanted to multi select filters in the future?

  • made some style changes but commented out in case they need to be added again

tech debt

  • it feels like filter bar and filter sidebar should not be separate components

@bengodw bengodw requested a review from JessicaF October 31, 2024 05:55
@bengodw bengodw linked an issue Oct 31, 2024 that may be closed by this pull request
Copy link
Contributor

@JessicaF JessicaF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Working well for me locally - just had a few questions on some changes but otherwise should be ready to merge soon! 🥳

PS. Regarding the comments on styling - I think you're good to just delete the commented out styles unless you think there's worth in changing them back?

export const FreeRoomsAPIContext = createContext<ContextType>({ buildings : [], rooms: {}, roomInfo: { rooms: {} }, onRefresh: () => {} });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm this should be for the mobile app so shouldn't need changes?

@@ -1,23 +1,25 @@
"use client";

import SearchIcon from "@mui/icons-material/Search";
import { useMediaQuery } from "@mui/material";
import Button from "@mui/material/Button";
import { Button, CircularProgress } from "@mui/material";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is CircularProgress used in this file?

const filters = useSelector(selectFilters);
const { rooms, isValidating } = useAllRooms(filters);
const centred = isValidating ? "center" : "default";
// const displayMobile = useMediaQuery(useTheme().breakpoints.down("md"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking that this is left here for future use when a mobile design is ready?

[theme.breakpoints.down("md")]: {
flexDirection: "column",
alignItems: "center",
// alignItems: "center",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan on using the commented out styles later?

borderWidth: 1,
borderStyle: "solid",
// borderWidth: 1,
// borderStyle: "solid",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we keeping these styles for any reason?

borderColor: theme.palette.mode === "light" ? "#BCBCBC" : "#3F3F3F",
":hover": {
cursor: "auto",
},
}));

const FilterSideBar = () => {
const FilterSideBar = ({ filters }: { filters: Filters }) => {
// To do - make this the same component as filter bar?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for now we keep them separate because in the future it's uncertain how we may want to distinguish functionality

state.value[key]!.splice(targetIndex);
}
} else {
throw "unsetting unincluded key";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain to me how this section works? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Filtering searches for rooms (filter sidebar)
2 participants