-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ubaid-patel/mobile_responsive
Add mobile resposiveness
- Loading branch information
Showing
24 changed files
with
359 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* For WebKit browsers (e.g., Chrome, Safari) */ | ||
body::-webkit-scrollbar-thumb { | ||
display: none; | ||
} | ||
|
||
/* For Firefox */ | ||
/* Note: In Firefox, you need to set this property on the root element */ | ||
body { | ||
|
||
/* Hide horizontal scrollbar */ | ||
} | ||
|
||
body::-webkit-scrollbar { | ||
display: none; | ||
} | ||
|
||
/* Hide scrollbar for IE, Edge and Firefox */ | ||
.example { | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
scrollbar-width: none; /* Firefox */ | ||
} | ||
/* For Microsoft Edge and Internet Explorer */ | ||
/* Note: In IE, you need to set this property on the body element */ |
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,35 +1,49 @@ | ||
const logo = '/logo.png' | ||
const search = '/search.svg' | ||
const searchIcon = '/search.svg' | ||
const accountCircle = '/account_circle.jpg' | ||
const cart = '/shopping_cart.jpg' | ||
import { useNavigate } from 'react-router-dom' | ||
import styles from '../../css/common/header.module.css' | ||
import SuggestionBox from '../home/SuggestionBox' | ||
import { useState } from 'react' | ||
|
||
function Header (){ | ||
function Header() { | ||
const nav = useNavigate(); | ||
const [search,setSearch] = useState(false) | ||
function showSugestions(event){ | ||
const [search, setSearch] = useState(false) | ||
function showSugestions(event) { | ||
event.preventDefault(); | ||
if(event.target.value != ''){ | ||
if (event.target.value != '') { | ||
setSearch(true) | ||
}else{ | ||
} else { | ||
setSearch(false) | ||
} | ||
} | ||
return( | ||
<header className={styles.header}> | ||
<img src={logo} className={styles.logo} onClick={()=>nav("/")} /> | ||
<div className={styles.searchBar}> | ||
<img src={search} className={styles.search}/> | ||
<input type="text" className={styles.searchInput} onKeyUp={showSugestions}/> | ||
<SuggestionBox show={search}/> | ||
</div> | ||
return ( | ||
<> | ||
<header className={styles.header}> | ||
<img src={logo} className={styles.logo} onClick={() => nav("/")} /> | ||
<div className={styles.searchBar}> | ||
<img src={searchIcon} className={styles.search} /> | ||
<input type="text" className={styles.searchInput} onKeyUp={showSugestions} /> | ||
<SuggestionBox show={search} /> | ||
</div> | ||
<img src={accountCircle} className={styles.accountCircle} onClick={() => nav("/account/profile")} /> | ||
<img src={cart} className={styles.cart} onClick={() => nav("/cart")} /> | ||
</header> | ||
|
||
<img src={accountCircle} className={styles.accountCircle} onClick={()=>nav("/account/profile")}/> | ||
<img src={cart} className={styles.cart} onClick={()=>nav("/cart")}/> | ||
</header> | ||
<header className={styles.mob_header}> | ||
<div className={styles.row_one}> | ||
<img src={logo} className={styles.mob_logo} onClick={() => nav("/")} /> | ||
<img src={accountCircle} className={styles.mob_accountCircle} onClick={() => nav("/account/profile")} /> | ||
<img src={cart} className={styles.mob_cart} onClick={() => nav("/cart")} /> | ||
</div> | ||
<div className={styles.searchBar}> | ||
<img src={searchIcon} className={styles.search} /> | ||
<input type="text" className={styles.searchInput} onKeyUp={showSugestions} /> | ||
<SuggestionBox show={search} /> | ||
</div> | ||
</header> | ||
</> | ||
) | ||
} | ||
export default Header |
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
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
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,47 +1,61 @@ | ||
.main{ | ||
.main { | ||
width: 90%; | ||
margin: auto; | ||
margin-bottom: 50px; | ||
} | ||
.background{ | ||
|
||
.background { | ||
background-color: #D9D9D9; | ||
border-radius: var(--br-6xs); | ||
padding: 20px 0px; | ||
} | ||
.title{ | ||
|
||
.title { | ||
text-align: left; | ||
font-weight: 400; | ||
font-size: var(--font-size-mid); | ||
} | ||
.categories{ | ||
|
||
.categories { | ||
width: 80%; | ||
border-radius: 30px solid black; | ||
border-radius: 30px solid black; | ||
background-color: #D9D9D9; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin: auto; | ||
text-align: center; | ||
} | ||
.category{ | ||
|
||
.category { | ||
text-align: center; | ||
flex: 1; | ||
} | ||
.icon{ | ||
|
||
.icon { | ||
border-radius: 50%; | ||
border: 1px solid black; | ||
width: 100px; | ||
} | ||
.name{ | ||
|
||
.name { | ||
text-align: center; | ||
font-size: var(--font-size-mini); | ||
display: block; | ||
} | ||
|
||
@media screen and (max-width:500px) { | ||
.main{ | ||
width: 100%; | ||
} | ||
.categories{ | ||
overflow: scroll; | ||
} | ||
.main { | ||
width: 100%; | ||
} | ||
|
||
|
||
.background { | ||
width: 100%; | ||
overflow: scroll; | ||
padding: 5px 3px; | ||
} | ||
.categories { | ||
width: max-content; | ||
} | ||
} |
Oops, something went wrong.