Skip to content

Commit

Permalink
added contacts section
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Farmaha committed Feb 5, 2024
1 parent b120baa commit 198ef66
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/components/ContactsSection/ContactsSection-styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ export const Address = styled.address`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
align-items: right;
gap: 5px;
font-style: inherit;
`;

export const Text = styled.p`
font-size: 17px;
font-weight: 200;
text-align: right;
`;

export const Link = styled.a`
Expand All @@ -76,8 +78,9 @@ export const Link = styled.a`
border: none;
display: flex;
justify-content: center;
align-items: center;
justify-content: right;
gap: 10px;
font-size: 17px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContactsSection/ContactsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ContactsSection = () => {
<CourtIconSvg>
<use href={sprite + "#icon-court"}></use>
</CourtIconSvg>
<Address>
<Address style={{alignItems: "center"}}>
<Text>Адреса нашого домашнього корту:</Text>

<Link
Expand Down
32 changes: 32 additions & 0 deletions src/components/Counter/CounterSection-styled.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import styled from "styled-components";

export const Section = styled.section`
background-color: var(--primary-black-color);
color: var(--primary-white-color);
`;

export const Text = styled.p`
max-width: 1200px;
padding: 24px;
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: left;
align-items: center;
gap: 10px;
`;

export const IconWrap = styled.span`
display: inline-flex;
justify-content: center;
align-items: center;
width: 20px;
height: 20px;
`;

export const IconSvg = styled.svg`
width: 100%;
height: 100%;
fill: currentColor;
`;
20 changes: 20 additions & 0 deletions src/components/Counter/CounterSection.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { IconSvg, IconWrap, Section, Text } from "./CounterSection-styled";

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

export const CounterSection = ({ visibleUsers }) => {
return (
<>
<Section>
<Text>
<IconWrap>
<IconSvg>
<use href={sprite + "#icon-users"}></use>
</IconSvg>
</IconWrap>
Кількість учасників: {visibleUsers}
</Text>
</Section>
</>
);
};
2 changes: 1 addition & 1 deletion src/components/Filters/FilterByName.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export const FilterByName = ({ inputValue, setInputsValue }) => {
return (
<Group>
<Label isFilterFocused={isFilterFocused}>
Знайти учасника за іменем
<IconWrap>
<IconSvg>
<use href={sprite + "#icon-search"}></use>
</IconSvg>
</IconWrap>
Знайти учасника за іменем
</Label>

<Input
Expand Down
13 changes: 11 additions & 2 deletions src/components/Filters/FilterSelect.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Select from "react-select";
import { useState } from "react";
import { Group, Label } from "./Filters-styled";
import { Group, IconSvg, IconWrap, Label } from "./Filters-styled";

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

export const FilterSelect = ({
inputValue,
Expand Down Expand Up @@ -136,7 +138,14 @@ export const FilterSelect = ({

return (
<Group>
<Label isFilterFocused={isFilterFocused}>{label}</Label>
<Label isFilterFocused={isFilterFocused}>
{label}
<IconWrap>
<IconSvg>
<use href={sprite + "#icon-list"}></use>
</IconSvg>
</IconWrap>
</Label>
<Select
placeholder={placeholder}
noOptionsMessage={() => "Немає збігів"}
Expand Down
2 changes: 1 addition & 1 deletion src/components/MembersList/MembersList-styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const MembersItemLi = styled.li`
&:hover {
cursor: pointer;
background-color: var(--primary-black-color);
background-color: var(--primary-grey-color);
color: var(--primary-white-color);
}
`;
Expand Down
2 changes: 2 additions & 0 deletions src/pages/MembersPage/MembersPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
import { MembersList } from "../../components/MembersList/MembersList";
import { membersApi } from "../../Api/ApiRequest";
import { MembersFilterBar } from "../../components/Filters/MembersFilterBar";
import { CounterSection } from "../../components/Counter/CounterSection";

const MembersPage = () => {
const [membersArray, setMembersArray] = useState([]);
Expand All @@ -22,6 +23,7 @@ const MembersPage = () => {
membersArray={membersArray}
setVisibleMembersArray={setVisibleMembersArray}
/>
<CounterSection visibleUsers={visibleMembersArray.length} />
<MembersList visibleMembersArray={visibleMembersArray} />
</>
);
Expand Down
4 changes: 4 additions & 0 deletions src/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 198ef66

Please sign in to comment.