Skip to content

Commit

Permalink
corrected Duplicate form field id in the same form error in inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Farmaha committed Feb 9, 2024
1 parent 7bb367e commit 7e0f773
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/Filters/FilterByName.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Group, IconSvg, IconWrap, Input, Label } from "./Filters-styled";

import sprite from "../../sprite.svg";

export const FilterByName = ({ inputValue, setInputsValue }) => {
export const FilterByName = ({ id, inputValue, setInputsValue }) => {
const [isFilterFocused, setIsFilterFocused] = useState(false);

const onInputChange = (e) => {
Expand All @@ -15,7 +15,7 @@ export const FilterByName = ({ inputValue, setInputsValue }) => {

return (
<Group>
<Label isFilterFocused={isFilterFocused}>
<Label htmlFor={id} isFilterFocused={isFilterFocused}>
Знайти учасника за іменем
<IconWrap>
<IconSvg>
Expand All @@ -25,6 +25,8 @@ export const FilterByName = ({ inputValue, setInputsValue }) => {
</Label>

<Input
id={id}
name={id}
autoComplete="off"
type="text"
value={inputValue}
Expand Down
6 changes: 4 additions & 2 deletions src/components/Filters/FilterSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Group, IconSvg, IconWrap, Label } from "./Filters-styled";
import sprite from "../../sprite.svg";

export const FilterSelect = ({
id,
inputValue,
setInputsValue,
typeOptions,
Expand Down Expand Up @@ -155,7 +156,7 @@ export const FilterSelect = ({

return (
<Group>
<Label isFilterFocused={isFilterFocused}>
<Label htmlFor={id} isFilterFocused={isFilterFocused}>
{label}
<IconWrap>
<IconSvg>
Expand All @@ -164,14 +165,15 @@ export const FilterSelect = ({
</IconWrap>
</Label>
<Select
inputId={id}
name={id}
placeholder={placeholder}
noOptionsMessage={() => "Немає збігів"}
maxMenuHeight={300}
components={{
IndicatorSeparator: () => null,
}}
styles={selectStyles}
inputId="type"
value={inputValue}
isSearchable={false}
onMenuOpen={() => setIsFilterFocused(true)}
Expand Down
1 change: 1 addition & 0 deletions src/components/Filters/ImageGalleryFilterBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const ImageGalleryFilterBar = ({
<Section>
<Form onSubmit={(e) => e.preventDefault()}>
<FilterSelect
id={"FilterByDate"}
inputsValue={inputsValue}
setInputsValue={setInputsValue}
typeOptions={typeOptions}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Filters/MembersFilterBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ export const MembersFilterBar = ({ membersArray, setVisibleMembersArray }) => {
<Section>
<Form onSubmit={(e) => e.preventDefault()}>
<FilterByName
id={"filterByName"}
inputsValue={inputsValue}
setInputsValue={setInputsValue}
/>

<FilterSelect
id={"filterByType"}
inputsValue={inputsValue}
setInputsValue={setInputsValue}
typeOptions={optionsByType}
Expand All @@ -104,6 +106,7 @@ export const MembersFilterBar = ({ membersArray, setVisibleMembersArray }) => {
/>

<FilterSelect
id={"filterByBirthday"}
inputsValue={inputsValue}
setInputsValue={setInputsValue}
typeOptions={optionsByBirthday}
Expand Down
2 changes: 2 additions & 0 deletions src/components/ImageGallery/ImageGallery-styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const ImageCount = styled.p`
background-color: transparent;
font-size: 20px;
z-index: 1;
`;

export const ImageDate = styled.p`
Expand All @@ -117,4 +118,5 @@ export const ImageDate = styled.p`
background-color: transparent;
font-size: 18px;
z-index: 1;
`;

0 comments on commit 7e0f773

Please sign in to comment.