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 924a9c5 commit 4402282
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 168 deletions.
9 changes: 3 additions & 6 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,13 @@ import Searchbar from './Searchbar/Searchbar'

render() {
const {
error,
gallery,
isLoading,
showModal,
largeImageURL,
tags,
currentPage,
quantityPage,
} = this.state;
// const { error, gallery, isLoading } = this.state;
// const { error, gallery, isLoading, showModal,largeImageURL, tags, } = this.state;

console.log(gallery);
return (
<Container maxWidth="xl">
Expand All @@ -128,7 +125,7 @@ render() {

{/* <Modal> </Modal> */}
{/* {showModal && <Modal onClose={this.toggleModal} > <h2>Modal Hallo</h2>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit, molestias assumenda aliquid incidunt corrupti a pariatur ratione rerum numquam alias omnis in non totam voluptatum quas voluptatem! Non, aspernatur? Suscipit!</p>
<button type='button' onClick={this.toggleModal}>Close modal</button>
</Modal> } */}

Expand Down
53 changes: 0 additions & 53 deletions src/components/ImageGalleryItem/ImageGalleryItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,56 +55,3 @@ export default ImageGalleryItem;




// // import * as React from 'react';
// import React from 'react'
// import Box from '@mui/material/Box';
// import Button from '@mui/material/Button';

// import Modal from '@mui/material/Modal';

// const style = {
// position: 'absolute',
// top: '50%',
// left: '50%',
// transform: 'translate(-50%, -50%)',
// width: 400,
// bgcolor: 'background.paper',
// border: 'none',
// boxShadow: 24,
// p: 4,
// padding: 0,

// };

// export default function BasicModal() {
// const [open, setOpen] = React.useState(false);
// const handleOpen = () => setOpen(true);
// const handleClose = () => setOpen(false);

// return (
// <div>
// <Button onClick={handleOpen}>Open modal</Button>
// <Modal
// open={open}
// onClose={handleClose}
// aria-labelledby="modal-modal-title"
// aria-describedby="modal-modal-description"
// >
// <Box sx={style}>

// <img src=
// "https://pixabay.com/get/g9fa88d8f527c93fc8a7a32f6b024c94e43ce0ad33aec7b27556725b8cacb75118bbe0e52abd5d11511f607cb820adbab988faa0ca4988dafcd481afa6fc78855_1280.jpg" alt="Image" style={{ width: '100%', marginBottom: -50, }} />


// </Box>
// </Modal>
// </div>
// );
// }





// "https://pixabay.com/get/gb94cf3696a0ed4fba98519b268ca73582ed1015808a41fdc862aadf6be5dd4978fa5872c6ad5244bf942e4433f4ab361c1c7e40c6cc91762aba05c9ea719a084_640.jpg"
110 changes: 1 addition & 109 deletions src/components/Searchbar/Searchbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,19 @@ export default class Searchbar extends Component {
this.setState({ inputQuery: '' });
};


render() {


console.log(this.state.inputQuery);

return (
<header className={css.searchbar}>

<form className="form" onSubmit={this.handleSubmit}>

{/* <Button variant="contained" className='btn btn-success' type='submit' >Show all photos
<span className="button-label">Search</span>
</Button> */}

<Box sx={{ display: 'flex', alignItems: 'center' , justifyContent: 'center'}}>
<YoutubeSearchedForIcon sx={{ color: 'action.active', mr: 1, my: 0.5 }} />
<TextField
// className="input"
// className="input"
type="text"
// autocomplete="off"
// autofocus
Expand All @@ -61,111 +55,9 @@ export default class Searchbar extends Component {
variant="outlined"
margin="dense" />
</Box>



{/* <Button variant="contained" className='btn btn-success' type='submit' >Show all photos </Button> */}

</form>

{/* <button className='btn btn-success' onClick={handleClick}>
Show all photos
</button> */}

</header>
)
}
}







// />
// {isLoading && <h1>Loading...</h1>}
// {error && <h1>{error}</h1>}
// {photos && (
// <ul className='list-group'>
// {(photos).map((el) => (
// <ImageGalleryItem
// photos={el}
// key={el.id}
// handleDelete={handleDelete}
// handleCheck={handleCheck}
// />
// ))}
// </ul>
// )}

















// state = { value: '' }

// handleChange = ({ target: { value } }) => {
// // toLowerCase() преобразуем букві в нижний регистр
// this.setState({ value:value.toLowerCase() })
// console.log(value);

// }



// handleSubmit = (e) => {
// e.preventDefault()
// if (this.state.value.trim() === '') {
// return alert('Please enter key words for search');}
// this.props.onSubmit(this.state.value);
// this.setState({ value: '' });
// };


// render() {
// const { value } = this.state;
// console.log(value);

// return (

// <header className="searchbar">
// <form onSubmit={this.handleSubmit} className="form">
// <button type="submit" className="button">
// <span className="button-label">Search</span>
// </button>

// <input
// className="input"
// type="text"
// autocomplete="off"
// autofocus
// placeholder="Search images and photos"
// onChange={this.handleChange}
// value={this.state.value}
// />
// </form>

// {/* <button type='button' onClick={this.toggleModal}>Open modal</button> */}
// </header>

// )
// }

// }

// 38614458-d50fcc5469c58311283d9e834

// https://pixabay.com/api/?key=38614458-d50fcc5469c58311283d9e834&q=yellow+flowers&image_type=photo&pretty=true

0 comments on commit 4402282

Please sign in to comment.