-
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cf2bcf7
topbar
florin-baciu 78726aa
+
florin-baciu 162553e
solved the issues
florin-baciu 0714385
regrouping imports
florin-baciu d08318d
Merge branch 'main' into 50-showroom-|-top-bar
florin-baciu a91eca1
fix spelling
florin-baciu 0cdd27a
moved the searchbar and category selector to the showroom feature
florin-baciu 4208b8b
+
florin-baciu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -40,4 +40,5 @@ | |
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
|
||
</html> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions
63
src/features/top-bar/components/top-bar/top-bar.module.scss
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,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); | ||
} | ||
} |
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,81 @@ | ||
import { Dropdown, DropdownChangeParams } 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 FavIcon } from './../../assets/favourites-icon.svg' | ||
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 style from './top-bar.module.scss' | ||
import { DROPDOWN_PLACEHOLDER } from 'features/top-bar/constants/top-bar-constants' | ||
|
||
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: DropdownChangeParams) => { | ||
setSelectedCategory(e.value) | ||
} | ||
|
||
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => { | ||
const textBox = event.target as HTMLInputElement | ||
|
||
if (event.key === 'Enter') { | ||
navigate(`${PAGES_PATHS.SEARCH}/${textBox.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={DROPDOWN_PLACEHOLDER} | ||
/> | ||
</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> | ||
) | ||
} |
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 @@ | ||
export const DROPDOWN_PLACEHOLDER = 'Category' |
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,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; | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.