Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
agsulimko committed Sep 16, 2023
1 parent c3f036e commit 76380b6
Show file tree
Hide file tree
Showing 10 changed files with 229 additions and 82 deletions.
172 changes: 172 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"bootstrap": "^5.3.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-loader-spinner": "^5.4.5",
"react-scripts": "^5.0.1",
"styled-components": "^6.0.7",
"web-vitals": "^2.1.3"
Expand Down
2 changes: 2 additions & 0 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Searchbar from './Searchbar/Searchbar'
// import axios from "axios";
import getAllPhotos from '../api/api'
import { Container } from '@mui/material';
import Loader from './Loader/Loader';

class App extends Component {

Expand Down Expand Up @@ -113,6 +114,7 @@ render() {

<Searchbar onSubmit={this.hendleFormSubmit}/>
{/* <button type='button' onClick={this.toggleModal}>Open modal</button> */}
{isLoading && <Loader />}
{gallery && gallery.length > 0 && <ImageGallery hits={gallery} />}
{currentPage < quantityPage && (
<ButtonLoad handleBtnLoad={this.handleBtnLoad} />
Expand Down
72 changes: 0 additions & 72 deletions src/components/FormCreatePhotos/FormCreatePhotos.jsx

This file was deleted.

1 change: 1 addition & 0 deletions src/components/ImageGallery/ImageGallery.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import ImageGalleryItem from 'components/ImageGalleryItem/ImageGalleryItem'
import css from './ImageGallery.module.css'


const ImageGallery = ({ hits }) => {
console.log('hits in ImageGallery :>> ', hits);
Expand Down
1 change: 0 additions & 1 deletion src/components/ImageGalleryItem/ImageGalleryItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ return(
aria-describedby="modal-modal-description"
>
<Box sx={style}>

<img src= {largeImageURL}
alt="Image" style={{ width: 800, marginBottom: -50, }} />

Expand Down
21 changes: 21 additions & 0 deletions src/components/Loader/Loader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { ColorRing } from 'react-loader-spinner';
import css from './Loader.module.css'

const Loader = () => {
return (
<div className={css.loaderWrap}>
<ColorRing
visible={true}
height="80"
width="80"
ariaLabel="blocks-loading"
wrapperStyle={{}}
wrapperClass="blocks-wrapper"
colors={['#b8c480', '#B2A3B5', '#F4442E', '#51E5FF', '#429EA6']}
/>
</div>
);
};

export default Loader;
6 changes: 6 additions & 0 deletions src/components/Loader/Loader.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.loaderWrap{
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
Loading

0 comments on commit 76380b6

Please sign in to comment.