-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df58046
commit fedc974
Showing
14 changed files
with
347 additions
and
692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,55 @@ | ||
import React,{useState} from 'react'; | ||
import React, { useState } from 'react'; | ||
import './BestPlacesSection.css'; | ||
|
||
const BestGroceries=()=>{ | ||
const cities = [ | ||
|
||
"Order grocery in Bangalore", | ||
"Order grocery in Gurgaon", | ||
"Order grocery in Hyderabad", | ||
"Order grocery in Delhi", | ||
" Order grocery in Mumbai", | ||
"Order grocery in Pune", | ||
" Order grocery in Kolkata", | ||
" Order grocery in Chennai", | ||
" Order grocery in Ahmedabad", | ||
"Order groceryin Chandigarh", | ||
" Order grocery in Jaipur", | ||
" Order grocery in Kochi", | ||
" Order grocery in Coimbatore", | ||
"Order grocery in Lucknow", | ||
" Order grocery in Nagpur", | ||
"Order groceryin Vadodara", | ||
"Order grocery in Indore", | ||
"Order grocery in Vizag", | ||
" Order grocery in Surat", | ||
" Order grocery in Dehradun", | ||
"Order grocery in Noida", | ||
"Order grocery in Vijayawada" | ||
|
||
|
||
]; | ||
const [visibleCount,setVisibleCount]=useState(9); | ||
const BestGroceries = () => { | ||
const cities = [ | ||
"Order grocery in Bangalore", | ||
"Order grocery in Gurgaon", | ||
"Order grocery in Hyderabad", | ||
"Order grocery in Delhi", | ||
" Order grocery in Mumbai", | ||
"Order grocery in Pune", | ||
" Order grocery in Kolkata", | ||
" Order grocery in Chennai", | ||
" Order grocery in Ahmedabad", | ||
"Order groceryin Chandigarh", | ||
" Order grocery in Jaipur", | ||
" Order grocery in Kochi", | ||
" Order grocery in Coimbatore", | ||
"Order grocery in Lucknow", | ||
" Order grocery in Nagpur", | ||
"Order groceryin Vadodara", | ||
"Order grocery in Indore", | ||
"Order grocery in Vizag", | ||
" Order grocery in Surat", | ||
" Order grocery in Dehradun", | ||
"Order grocery in Noida", | ||
"Order grocery in Vijayawada" | ||
]; | ||
|
||
const handleShow_more=()=>{ | ||
setVisibleCount((prevCount)=>prevCount+4); | ||
} | ||
const [visibleCount, setVisibleCount] = useState(9); | ||
|
||
return( | ||
<div> | ||
<h2>Cities with groceries delivery</h2> | ||
const handleShow_more = () => { | ||
try { | ||
setVisibleCount((prevCount) => prevCount + 4); | ||
} catch (error) { | ||
console.error('Error updating visible count:', error); | ||
} | ||
}; | ||
|
||
<div className='button-grid'> | ||
{cities.slice(0,visibleCount).map((item,index)=> | ||
<button key={index} className='city-button'>{item}</button>)} | ||
<button onClick={handleShow_more}>Show more</button> | ||
</div> | ||
return ( | ||
<div> | ||
<h2>Cities with groceries delivery</h2> | ||
|
||
</div> | ||
<div className='button-grid'> | ||
{cities.slice(0, visibleCount).map((item, index) => | ||
<button key={index} className='city-button'>{item}</button> | ||
)} | ||
<button onClick={handleShow_more}>Show more</button> | ||
</div> | ||
|
||
</div> | ||
); | ||
}; | ||
|
||
)} | ||
export default BestGroceries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,85 @@ | ||
.btn-pink { | ||
background-color: var(--bgOrange); | ||
width: fit-content; | ||
color: rgb(248, 11, 11); | ||
padding: 0.8rem 2.3rem; | ||
box-shadow: 5px 5px 7px 0px #0000003f; | ||
font-size: 18px; | ||
cursor: pointer; | ||
transition: all 0.5s; | ||
font-weight: 500; | ||
border: solid 3px transparent; | ||
position: relative; | ||
z-index: 1; | ||
} | ||
|
||
.btn-pink::before { | ||
content: ""; | ||
position: absolute; | ||
background-color: #fff; | ||
top: 0px; | ||
left: 0; | ||
right: 0; | ||
bottom: 0px; | ||
z-index: -1; | ||
transform: scaleX(0); | ||
transform-origin: left; | ||
transition: all 0.8s; | ||
} | ||
|
||
.btn-pink:hover::before { | ||
transform: scaleX(1); | ||
} | ||
|
||
.btn-pink:hover { | ||
border: solid 3px var(--bgOrange); | ||
color: black; | ||
} | ||
|
||
.contact-back { | ||
background-color: rgb(231, 231, 231); | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.contc { | ||
color: red; | ||
align-self: center; | ||
} | ||
|
||
.contact-form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 20px; | ||
} | ||
|
||
.form-group { | ||
margin-bottom: 15px; | ||
width: 100%; | ||
} | ||
|
||
label { | ||
display: block; | ||
margin-bottom: 5px; | ||
font-weight: bold; | ||
} | ||
|
||
input, textarea { | ||
width: 100%; | ||
padding: 10px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
|
||
textarea { | ||
resize: none; | ||
} | ||
|
||
footer.copyright { | ||
text-align: center; | ||
margin-top: 20px; | ||
font-size: 14px; | ||
color: #555; | ||
} | ||
.btn-pink { | ||
background-color: var(--bgOrange); | ||
width: fit-content; | ||
color: rgb(248, 11, 11); | ||
padding: 0.8rem 2.3rem; | ||
box-shadow: 5px 5px 7px 0px #0000003f; | ||
font-size: 18px; | ||
cursor: pointer; | ||
transition: all 0.5s; | ||
font-weight: 500; | ||
border: solid 3px transparent; | ||
position: relative; | ||
z-index: 1; | ||
} | ||
|
||
.btn-pink::before { | ||
content: ""; | ||
position: absolute; | ||
background-color: #fff; | ||
top: 0px; | ||
left: 0; | ||
right: 0; | ||
bottom: 0px; | ||
z-index: -1; | ||
transform: scaleX(0); | ||
transform-origin: left; | ||
transition: all 0.8s; | ||
} | ||
|
||
.btn-pink:hover::before { | ||
transform: scaleX(1); | ||
} | ||
|
||
.btn-pink:hover { | ||
border: solid 3px var(--bgOrange); | ||
color: black; | ||
} | ||
|
||
.contact-back { | ||
background-color: rgb(231, 231, 231); | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.contc { | ||
color: red; | ||
align-self: center; | ||
} | ||
|
||
.contact-form { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding: 20px; | ||
} | ||
|
||
.form-group { | ||
margin-bottom: 15px; | ||
width: 100%; | ||
} | ||
|
||
label { | ||
display: block; | ||
margin-bottom: 5px; | ||
font-weight: bold; | ||
} | ||
|
||
input, textarea { | ||
width: 100%; | ||
padding: 10px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
|
||
textarea { | ||
resize: none; | ||
} | ||
|
||
footer.copyright { | ||
text-align: center; | ||
margin-top: 20px; | ||
font-size: 14px; | ||
color: #555; | ||
} |
Oops, something went wrong.