-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marko profile page header responsiveness ( userprofile img, searchbox, connectwallet) #151
base: main
Are you sure you want to change the base?
Changes from 4 commits
5167573
ad32467
5371d59
60f7cca
9076069
31d408b
da93488
a8b9168
20789c9
f58f0e9
7a4ced0
a11780c
b1a2857
1761cbb
a625009
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,19 +52,39 @@ const HomepageNav = ({ | |
const regex = /\b\w+/; | ||
if (!regex.test(e.target.value) && e.target.value !== '') return; | ||
setSearch(e.target.value); | ||
router.push({ | ||
/*router.push({ | ||
pathname: router.pathname, | ||
query: { _q: encodeURI(e.target.value) }, | ||
}); | ||
});*/ | ||
}; | ||
|
||
const handleKeyDown = (e) => { | ||
if (e.key === 'Enter') { | ||
console.log('Enter is pressed !'); | ||
router.push({ | ||
pathname: router.pathname, | ||
query: { _q: encodeURI(searchValue) }, | ||
}); | ||
} | ||
} | ||
|
||
const handleSearchIconSubmit = () => { | ||
console.log(router.pathname) | ||
console.log(searchValue) | ||
router.push({ | ||
pathname: router.pathname, | ||
query: { _q: encodeURI(searchValue) }, | ||
}); | ||
} | ||
|
||
|
||
const handleSubmit = () => { | ||
const regex = /\b\w+/; | ||
if (!regex.test(searchValue)) return; | ||
setSearch(''); | ||
router.push({ | ||
pathname: '/search', | ||
query: { _q: searchValue }, | ||
pathname: router.pathname, | ||
query: { _q: encodeURI(searchValue) }, | ||
}); | ||
}; | ||
|
||
|
@@ -191,6 +211,7 @@ const HomepageNav = ({ | |
<div className="mobile-searchBox"> | ||
<input | ||
onChange={handleSearch} | ||
onKeyDown={handleKeyDown} | ||
value={searchValue} | ||
className="mobile-searchInput" | ||
type="text" | ||
|
@@ -200,8 +221,8 @@ const HomepageNav = ({ | |
<button | ||
type="button" | ||
className="mobile-searchButton" | ||
href="#" | ||
onClick={onClickSearch} | ||
onClick={handleSearchIconSubmit} | ||
|
||
> | ||
<i className="fas fa-search" /> | ||
</button> | ||
|
@@ -215,8 +236,8 @@ const HomepageNav = ({ | |
ref={dropdownMobileRef} | ||
> | ||
{userData !== null && userData !== undefined ? ( | ||
<div className="nav__mobile-profile tw:z-10"> | ||
<div className="nav__mobile-img"> | ||
<div style={{border:"1px solid red"}} className="nav__mobile-profile tw:z-10"> | ||
<div style={{border:"1px solid red"}} className="nav__mobile-img"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since you're just adding a border and not manipulating the DOM, why not add it to the className instead, or better still use tailwind, so we can stick to classNames. for consistency. WDYT ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. solved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are my oriantation borders, before I was interducing tailwind...I forgot to delete them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool |
||
<img | ||
src={ | ||
userData.profilePicture | ||
|
@@ -300,7 +321,7 @@ const HomepageNav = ({ | |
</a> | ||
</ul> | ||
{userData !== null && userData !== undefined ? ( | ||
<ul className="nav__mobile-items"> | ||
<ul className="nav__mobile-items" > | ||
<a | ||
href={`${ | ||
userData.userName | ||
|
@@ -309,7 +330,7 @@ const HomepageNav = ({ | |
}`} | ||
onClick={closeMobileMenu} | ||
> | ||
<li className="nav-item"> | ||
<li style={{border:"1px solid red"}} className="nav-item" > | ||
<div className="nav__mobile-link">Profile</div> | ||
</li> | ||
</a> | ||
|
@@ -321,6 +342,8 @@ const HomepageNav = ({ | |
</div> | ||
); | ||
|
||
|
||
|
||
return ( | ||
<header | ||
className="homepage__header" | ||
|
@@ -338,7 +361,7 @@ const HomepageNav = ({ | |
}`} | ||
> | ||
{isLogin === true && ( | ||
<div | ||
<div | ||
className="hamburger-icon tw-cursor-pointer" | ||
onClick={() => setOpen(!open)} | ||
> | ||
|
@@ -487,32 +510,33 @@ const HomepageNav = ({ | |
</Link> | ||
</li> | ||
</ul> | ||
<ul className="tw-flex tw-flex-row tw-justify-around tw-w-1/4 tw-my-8 navbar__right md:tw-hidden"> | ||
<li> | ||
<div className="navbar__search tw-flex tw-flex-row tw-w-full tw-border tw-border-white tw-rounded-md tw-px-1 tw-text-white"> | ||
<ul className="tw-flex tw-flex-row tw-justify-end tw-w-5/12 navbar__right md:tw-hidden tw-h-full "> | ||
<li className="tw-h-full tw-w-4/12"> | ||
<div className="tw-flex tw-flex-row tw-h-9 tw-mt-8 tw-bg-inputColor tw-border-2 tw-border-purple-800 tw-rounded-full tw-px-1 tw-text-white"> | ||
<input | ||
onChange={handleSearch} | ||
onKeyDown={handleKeyDown} | ||
value={searchValue} | ||
className="searchInput tw-bg-transparent tw-border-0 tw-text-white tw-py-1 xl:tw-w-10/12 tw-w-full tw-outline-none focus:tw-outline-none" | ||
className="searchInput tw-text-sm tw-border-0 tw-text-white tw-p-4 xl:tw-w-9/12 tw-w-4/5 tw-outline-none focus:tw-outline-none" | ||
// ${ | ||
// searchValue ? "expand" : "" | ||
// }`} | ||
type="text" | ||
name="" | ||
placeholder="Search..." | ||
/> | ||
<button type="submit" onClick={handleSubmit}> | ||
<i className="fas fa-search" /> | ||
<button type="submit" onClick={handleSearchIconSubmit}> | ||
<i className="fas fa-search tw-ml-2" /> | ||
</button> | ||
</div> | ||
</li> | ||
<li> | ||
<div className="tw-w-full tw-mx-2 tw-cursor-pointer"> | ||
<li className="tw-h-full tw-ml-5 tw-w-5/12 tw-pt-8"> | ||
<div className="tw-cursor-pointer tw-pl-1"> | ||
<Account /> | ||
</div> | ||
</li> | ||
{userData !== null && userData !== undefined ? ( | ||
<div className="tw-mx-2"> | ||
<div className=" tw-w-1/12 tw-pt-8"> | ||
<li> | ||
{userData.profilePicture ? ( | ||
<img | ||
|
@@ -523,7 +547,8 @@ const HomepageNav = ({ | |
/> | ||
) : ( | ||
<i | ||
className="fa-user-circle fas tw-content-center tw-text-center NavIcon tw-cursor-pointer tw-mt-2" | ||
|
||
className=" fa-user-circle fas tw-content-center tw-text-center NavIcon tw-cursor-pointer tw-mt-8" | ||
onClick={onClick} | ||
/> | ||
)} | ||
|
@@ -539,10 +564,10 @@ const HomepageNav = ({ | |
</li> | ||
</div> | ||
) : ( | ||
<li className=""> | ||
<i | ||
<li > | ||
<i | ||
aria-hidden | ||
className="fas fa-user-circle tw-content-center tw-text-center NavIcon tw-cursor-pointer tw-mt-2" | ||
className="fa-user-circle fas fa-5x tw-content-center tw-text-center NavIcon tw-cursor-pointer tw-mt-8" | ||
onClick={onClick} | ||
/> | ||
{isActive ? ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up, if commented out code would not be used in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool