diff --git a/src/Api/ApiRequest.js b/src/Api/ApiRequest.js index 46615ce..672a366 100644 --- a/src/Api/ApiRequest.js +++ b/src/Api/ApiRequest.js @@ -1,6 +1,10 @@ -import data from './photoBase.json'; +import photos from "./photos.json"; +import members from "./members.json"; +export const photosApi = () => { + return photos; +}; -export const apiRequest = () => { - return data +export const membersApi = () => { + return members; }; diff --git a/src/Api/photoBase.json b/src/Api/members.json similarity index 80% rename from src/Api/photoBase.json rename to src/Api/members.json index d0ccff1..e4fbe64 100644 --- a/src/Api/photoBase.json +++ b/src/Api/members.json @@ -2,127 +2,127 @@ { "id": "1", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/1.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/1.jpg", "description": "Тут може бути опис" }, { "id": "2", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/2.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/2.jpg", "description": "Тут може бути опис" }, { "id": "3", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/3.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/3.jpg", "description": "Тут може бути опис" }, { "id": "4", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/4.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/4.jpg", "description": "Тут може бути опис" }, { "id": "5", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/5.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/5.jpg", "description": "Тут може бути опис" }, { "id": "6", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/6.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/6.jpg", "description": "Тут може бути опис" }, { "id": "7", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/7.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/7.jpg", "description": "Тут може бути опис" }, { "id": "8", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/8.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/8.jpg", "description": "Тут може бути опис" }, { "id": "9", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/9.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/9.jpg", "description": "Тут може бути опис" }, { "id": "10", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/10.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/10.jpg", "description": "Тут може бути опис" }, { "id": "11", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/11.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/11.jpg", "description": "Тут може бути опис" }, { "id": "12", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/12.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/12.jpg", "description": "Тут може бути опис" }, { "id": "13", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/13.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/13.jpg", "description": "Тут може бути опис" }, { "id": "14", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/14.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/14.jpg", "description": "Тут може бути опис" }, { "id": "15", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/15.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/15.jpg", "description": "Тут може бути опис" }, { "id": "16", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/16.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/16.jpg", "description": "Тут може бути опис" }, { "id": "17", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/17.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/17.jpg", "description": "Тут може бути опис" }, { "id": "18", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/18.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/18.jpg", "description": "Тут може бути опис" }, { "id": "19", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/19.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/19.jpg", "description": "Тут може бути опис" }, { "id": "20", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/20.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/20.jpg", "description": "Тут може бути опис" }, { "id": "21", "date": "unknown", - "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/photos/21.jpg", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/21.jpg", "description": "Тут може бути опис" } ] diff --git a/src/Api/photos.json b/src/Api/photos.json new file mode 100644 index 0000000..e4fbe64 --- /dev/null +++ b/src/Api/photos.json @@ -0,0 +1,128 @@ +[ + { + "id": "1", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/1.jpg", + "description": "Тут може бути опис" + }, + { + "id": "2", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/2.jpg", + "description": "Тут може бути опис" + }, + { + "id": "3", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/3.jpg", + "description": "Тут може бути опис" + }, + { + "id": "4", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/4.jpg", + "description": "Тут може бути опис" + }, + { + "id": "5", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/5.jpg", + "description": "Тут може бути опис" + }, + { + "id": "6", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/6.jpg", + "description": "Тут може бути опис" + }, + { + "id": "7", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/7.jpg", + "description": "Тут може бути опис" + }, + { + "id": "8", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/8.jpg", + "description": "Тут може бути опис" + }, + { + "id": "9", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/9.jpg", + "description": "Тут може бути опис" + }, + { + "id": "10", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/10.jpg", + "description": "Тут може бути опис" + }, + { + "id": "11", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/11.jpg", + "description": "Тут може бути опис" + }, + { + "id": "12", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/12.jpg", + "description": "Тут може бути опис" + }, + { + "id": "13", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/13.jpg", + "description": "Тут може бути опис" + }, + { + "id": "14", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/14.jpg", + "description": "Тут може бути опис" + }, + { + "id": "15", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/15.jpg", + "description": "Тут може бути опис" + }, + { + "id": "16", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/16.jpg", + "description": "Тут може бути опис" + }, + { + "id": "17", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/17.jpg", + "description": "Тут може бути опис" + }, + { + "id": "18", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/18.jpg", + "description": "Тут може бути опис" + }, + { + "id": "19", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/19.jpg", + "description": "Тут може бути опис" + }, + { + "id": "20", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/20.jpg", + "description": "Тут може бути опис" + }, + { + "id": "21", + "date": "unknown", + "path": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/ImageGallery/photos/21.jpg", + "description": "Тут може бути опис" + } +] diff --git a/src/components/ImageGallery/ImageGallery.jsx b/src/components/ImageGallery/ImageGallery.jsx index ed0ebeb..5d112dc 100644 --- a/src/components/ImageGallery/ImageGallery.jsx +++ b/src/components/ImageGallery/ImageGallery.jsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { apiRequest } from "../../Api/ApiRequest"; +import { photosApi } from "../../Api/ApiRequest"; import { ImageGalleryItem } from "./ImageGalleryItem"; import { ImageGalleryList, Section, SectionWrap } from "./ImageGallery-styled"; @@ -8,7 +8,7 @@ export const ImageGallery = () => { const [galleryArray, setGalleryArray] = useState([]); useEffect(() => { - const response = apiRequest(); + const response = photosApi(); setGalleryArray(response); }, []); diff --git a/src/components/ImageGallery/ImageGalleryModal.jsx b/src/components/ImageGallery/ImageGalleryModal.jsx index f75b007..e0f28cf 100644 --- a/src/components/ImageGallery/ImageGalleryModal.jsx +++ b/src/components/ImageGallery/ImageGalleryModal.jsx @@ -14,7 +14,7 @@ import sprite from "../../sprite.svg"; import { Loader } from "../Loaders/Loaders"; import { Modal } from "../Modal/Modal"; import { Portal } from "../../Routes/Portal/Portal"; -import { apiRequest } from "../../Api/ApiRequest"; +import { photosApi } from "../../Api/ApiRequest"; export const ImageGalleryModal = () => { const { id } = useParams(); @@ -36,7 +36,7 @@ export const ImageGalleryModal = () => { setScrollPosition(rect.y - window.innerHeight / 2 + 100); } - const response = apiRequest(); + const response = photosApi(); const current = response.find((el) => String(el.id) === String(id)); setGalleryArray(response); setCurrentImg(current); diff --git a/src/photos/1.jpg b/src/components/ImageGallery/photos/1.jpg similarity index 100% rename from src/photos/1.jpg rename to src/components/ImageGallery/photos/1.jpg diff --git a/src/photos/10.jpg b/src/components/ImageGallery/photos/10.jpg similarity index 100% rename from src/photos/10.jpg rename to src/components/ImageGallery/photos/10.jpg diff --git a/src/photos/11.jpg b/src/components/ImageGallery/photos/11.jpg similarity index 100% rename from src/photos/11.jpg rename to src/components/ImageGallery/photos/11.jpg diff --git a/src/photos/12.jpg b/src/components/ImageGallery/photos/12.jpg similarity index 100% rename from src/photos/12.jpg rename to src/components/ImageGallery/photos/12.jpg diff --git a/src/photos/13.jpg b/src/components/ImageGallery/photos/13.jpg similarity index 100% rename from src/photos/13.jpg rename to src/components/ImageGallery/photos/13.jpg diff --git a/src/photos/14.jpg b/src/components/ImageGallery/photos/14.jpg similarity index 100% rename from src/photos/14.jpg rename to src/components/ImageGallery/photos/14.jpg diff --git a/src/photos/15.jpg b/src/components/ImageGallery/photos/15.jpg similarity index 100% rename from src/photos/15.jpg rename to src/components/ImageGallery/photos/15.jpg diff --git a/src/photos/16.jpg b/src/components/ImageGallery/photos/16.jpg similarity index 100% rename from src/photos/16.jpg rename to src/components/ImageGallery/photos/16.jpg diff --git a/src/photos/17.jpg b/src/components/ImageGallery/photos/17.jpg similarity index 100% rename from src/photos/17.jpg rename to src/components/ImageGallery/photos/17.jpg diff --git a/src/photos/18.jpg b/src/components/ImageGallery/photos/18.jpg similarity index 100% rename from src/photos/18.jpg rename to src/components/ImageGallery/photos/18.jpg diff --git a/src/photos/19.jpg b/src/components/ImageGallery/photos/19.jpg similarity index 100% rename from src/photos/19.jpg rename to src/components/ImageGallery/photos/19.jpg diff --git a/src/photos/2.jpg b/src/components/ImageGallery/photos/2.jpg similarity index 100% rename from src/photos/2.jpg rename to src/components/ImageGallery/photos/2.jpg diff --git a/src/photos/20.jpg b/src/components/ImageGallery/photos/20.jpg similarity index 100% rename from src/photos/20.jpg rename to src/components/ImageGallery/photos/20.jpg diff --git a/src/photos/21.jpg b/src/components/ImageGallery/photos/21.jpg similarity index 100% rename from src/photos/21.jpg rename to src/components/ImageGallery/photos/21.jpg diff --git a/src/photos/3.jpg b/src/components/ImageGallery/photos/3.jpg similarity index 100% rename from src/photos/3.jpg rename to src/components/ImageGallery/photos/3.jpg diff --git a/src/photos/4.jpg b/src/components/ImageGallery/photos/4.jpg similarity index 100% rename from src/photos/4.jpg rename to src/components/ImageGallery/photos/4.jpg diff --git a/src/photos/5.jpg b/src/components/ImageGallery/photos/5.jpg similarity index 100% rename from src/photos/5.jpg rename to src/components/ImageGallery/photos/5.jpg diff --git a/src/photos/6.jpg b/src/components/ImageGallery/photos/6.jpg similarity index 100% rename from src/photos/6.jpg rename to src/components/ImageGallery/photos/6.jpg diff --git a/src/photos/7.jpg b/src/components/ImageGallery/photos/7.jpg similarity index 100% rename from src/photos/7.jpg rename to src/components/ImageGallery/photos/7.jpg diff --git a/src/photos/8.jpg b/src/components/ImageGallery/photos/8.jpg similarity index 100% rename from src/photos/8.jpg rename to src/components/ImageGallery/photos/8.jpg diff --git a/src/photos/9.jpg b/src/components/ImageGallery/photos/9.jpg similarity index 100% rename from src/photos/9.jpg rename to src/components/ImageGallery/photos/9.jpg diff --git a/src/components/MembersList/MembersList.jsx b/src/components/MembersList/MembersList.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/components/MembersList/MemdersList-styled.jsx b/src/components/MembersList/MemdersList-styled.jsx new file mode 100644 index 0000000..e69de29