diff --git a/frontend/src/components/sidebar.tsx b/frontend/src/components/sidebar.tsx index eb94318..a834606 100644 --- a/frontend/src/components/sidebar.tsx +++ b/frontend/src/components/sidebar.tsx @@ -1,4 +1,4 @@ -import { Autocomplete, Box, Divider, Grid, InputLabel, MenuItem, Paper, Rating, Select, SelectChangeEvent, TextField, ToggleButton, Typography } from "@mui/material"; +import { Autocomplete, Box, Divider, Grid, InputLabel, MenuItem, Paper, Rating, Select, SelectChangeEvent, Switch, TextField, ToggleButton, Typography } from "@mui/material"; import getCities from "../functions/getCities"; import FilterState from "../models/filterState"; import { useEffect, useState } from "react"; @@ -35,111 +35,107 @@ export default function Sidebar(props : SidebarProps) { Filter Conveyancers - - - Firm Name - props.onChange(Object.assign({}, {...props.filters}, {namePart: (e.target as any).value}))} - /> - - - props.onChange(Object.assign({}, {...props.filters}, {nameOnly: !props.filters.nameOnly}))} - > - {props.filters.nameOnly - ? - : } - - - + Firm Name + props.onChange(Object.assign({}, {...props.filters}, {namePart: (e.target as any).value}))} + /> - Cities - props.onChange(Object.assign({}, {...props.filters}, {cities: value}))} - renderInput={(params) => ( - - )} + Search by Firm Name Only + props.onChange(Object.assign({}, {...props.filters}, {nameOnly: value}))} /> - - - - - Min. Rating - props.onChange(Object.assign({}, {...props.filters}, {minRating: value}))} - /> - - - Rating Provider - - - - - - - Results per Page - props.onChange(Object.assign({}, {...props.filters}, {resultsPerPage: value, currentPage: 1}))} - min={10} - max={40} - /> - - - - Sort By - props.onChange(Object.assign({}, {...props.filters}, {ratingsProvider: (e.target as any).value}))} > - {option.name} - - ) - })} - - + {ratingsProviders.map(provider => { + return ( + {capitaliseFirstLetter(provider)} + + ) + })} + + + + + + + Results per Page + props.onChange(Object.assign({}, {...props.filters}, {resultsPerPage: value, currentPage: 1}))} + min={10} + max={40} + /> + + + + Sort By + + + } ) }