feat(design): home page new design and functionality #135

Merged
enes merged 24 commits from issue-121 into staging 2024-08-14 08:44:09 +00:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit d0e3704ed6 - Show all commits

View File

@ -62,11 +62,15 @@ interface SelectItemProps<T extends string> {
interface SelectProps<T extends string> { interface SelectProps<T extends string> {
setValue: React.Dispatch<React.SetStateAction<T>> setValue: React.Dispatch<React.SetStateAction<T>>
options: SelectItemProps<T>[] options: SelectItemProps<T>[]
name?: string
id?: string
} }
export function Select<T extends string>({ export function Select<T extends string>({
setValue, setValue,
options options,
name,
id
}: SelectProps<T>) { }: SelectProps<T>) {
const handleChange = (event: SelectChangeEvent<unknown>) => { const handleChange = (event: SelectChangeEvent<unknown>) => {
setValue(event.target.value as T) setValue(event.target.value as T)
@ -75,6 +79,8 @@ export function Select<T extends string>({
return ( return (
<FormControl> <FormControl>
<SelectCustomized <SelectCustomized
id={id}
name={name}
size="small" size="small"
variant="outlined" variant="outlined"
defaultValue={options[0].value as string} defaultValue={options[0].value as string}

View File

@ -109,6 +109,7 @@ export const HomePage = () => {
{isFilterVisible && ( {isFilterVisible && (
<> <>
<Select <Select
name={'filter-select'}
setValue={setFilter} setValue={setFilter}
options={FILTERS.map((f) => { options={FILTERS.map((f) => {
return { return {
@ -118,6 +119,7 @@ export const HomePage = () => {
})} })}
/> />
<Select <Select
name={'sort-select'}
setValue={setSort} setValue={setSort}
options={SORT_BY.map((s) => { options={SORT_BY.map((s) => {
return { ...s } return { ...s }