-
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
50 showroom | top bar #54
Changes from 2 commits
cf2bcf7
78726aa
162553e
0714385
d08318d
a91eca1
0cdd27a
4208b8b
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 |
---|---|---|
|
@@ -40,4 +40,5 @@ | |
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
|
||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.topBar { | ||
width: 100vw; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
&Elements { | ||
max-width: 1100px; | ||
width: 100%; | ||
margin: 22px auto; | ||
display: flex; | ||
} | ||
|
||
&Element { | ||
margin: auto 15px; | ||
font-weight: 600; | ||
font-size: 14px; | ||
color: var(--gray-500); | ||
} | ||
|
||
&InputCategoryHolder { | ||
background: transparent !important; | ||
padding: 0 !important; | ||
} | ||
|
||
&InputCategory { | ||
border: 0 !important; | ||
} | ||
|
||
&Search { | ||
width: 688px; | ||
} | ||
|
||
&Link { | ||
display: flex; | ||
text-decoration: none; | ||
} | ||
|
||
&Link:hover { | ||
span { | ||
color: var(--primary-300) !important; | ||
} | ||
svg path { | ||
fill: var(--primary-300) !important; | ||
} | ||
} | ||
|
||
&LinkIcon { | ||
margin: auto 6px; | ||
} | ||
|
||
&LinkText { | ||
color: var(--gray-600); | ||
font-size: 14px; | ||
margin: auto; | ||
} | ||
|
||
&Divider { | ||
margin: 0; | ||
width: 100%; | ||
height: 1px; | ||
border: 1px solid var(--gray-200); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Dropdown } from 'primereact/dropdown' | ||
import { Link, useNavigate } from 'react-router-dom' | ||
import classNames from 'classnames' | ||
import { useState } from 'react' | ||
|
||
import { AUTH_PAGES, PAGES_PATHS } from 'common/constants/constants' | ||
import { InputText } from 'primereact/inputtext' | ||
import { useStore } from 'store/store' | ||
|
||
import { ReactComponent as AssistLogo } from 'common/assets/logo-assist.svg' | ||
import { ReactComponent as UserIcon } from './../../assets/user-icon.svg' | ||
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. sa folosim mereu absolute paths. |
||
import { ReactComponent as FavIcon } from './../../assets/favourites-icon.svg' | ||
|
||
import style from './top-bar.module.scss' | ||
|
||
export const TopBar = () => { | ||
const [selectCategory, setSelectedCategory] = useState(null) | ||
|
||
const { authStore } = useStore() | ||
const { userName } = authStore | ||
|
||
const navigate = useNavigate() | ||
|
||
const categories = [{ name: 'Category 1' }, { name: 'Category 2' }, { name: 'Category 3' }] | ||
|
||
const onCityChange = (e: any) => { | ||
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. Un type pentru event, te rog |
||
setSelectedCategory(e.value) | ||
} | ||
|
||
const handleKeyDown = (event: any) => { | ||
if (event.key === 'Enter') { | ||
navigate(`${PAGES_PATHS.SEARCH}/${event.target.value}`) | ||
} | ||
} | ||
|
||
if (AUTH_PAGES.includes(document.location.pathname)) return <></> | ||
|
||
return ( | ||
<section className={style.topBar}> | ||
<div className={style.topBarElements}> | ||
<div className={style.topBarElement}> | ||
<Link to={PAGES_PATHS.HOME}> | ||
<AssistLogo /> | ||
</Link> | ||
</div> | ||
<div className={style.topBarSearch}> | ||
<div className='p-inputgroup'> | ||
<span className={classNames('p-inputgroup-addon', style.topBarInputCategoryHolder)}> | ||
<Dropdown | ||
className={style.topBarInputCategory} | ||
value={selectCategory} | ||
options={categories} | ||
onChange={onCityChange} | ||
optionLabel='name' | ||
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. Pune constante, te rog |
||
placeholder='Category' | ||
/> | ||
</span> | ||
<InputText onKeyDown={handleKeyDown} /> | ||
</div> | ||
</div> | ||
<div className={style.topBarElement}> | ||
<Link to={PAGES_PATHS.FAVOURITES} className={style.topBarLink}> | ||
<FavIcon className={style.topBarLinkIcon} /> | ||
<span className={style.topBarLinkText}>Favourites</span> | ||
</Link> | ||
</div> | ||
<div className={style.topBarElement}> | ||
{/**replace the link to PAGES_PATHS.settings when the PR will be merged */} | ||
<Link to={'/setting/profile'} className={style.topBarLink}> | ||
<UserIcon className={style.topBarLinkIcon} /> | ||
<span className={style.topBarLinkText}>{userName || 'My account'}</span> | ||
</Link> | ||
</div> | ||
</div> | ||
<hr className={style.topBarDivider} /> | ||
</section> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', | ||
'Droid Sans', 'Helvetica Neue', sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; | ||
} |
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.
sa grupam importurile din node_modules si custom imports si sa lasam un spatiu intre ele.