-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: first Navbar2 mockup. style: run prettier * fix: theme dark/light switch * style: desktop * refactor: update naming * feat: renew UserMenu component * feat: include UserMenu into NavBar2 * feat: UserMenu and Navbar2 stories * feat: split UserMenu in different components * style: reorganized * style: UserMenu mobile. refactor: UserMenu types * feat: Navbar2 mobile * style: change prettier rules * feat: change prettier rule * style: navbar2 hover * feat: add Navbar2 links and copy * feat: UserMenu links, reorganize config json constants * feat: change user menu link to my assets * feat: renove hardcoded function * feat: change Navbar2 arrow * feat: navbar2 subitem hover link * style: sign out * style: UserMenu arrow * style: Notification icon fill color * fix: set onClickMenuOption as optional * style: mobile menu icon * style: Navbar in mobile * fix: related PR comments * feat: handle user menu without profile * feat: change copy of DAO Grants * style: Navbar font size and hover sign out * feat: hide UserMenu when leave * refactor: Navbar and sub component * style: color and hover in Navbar2 * feat: remove useless isSomeBalanceTooHigh * feat: changed requested from PR * feat: add i18n support and menu tracking action * fix: stories * refactor: Navbar2 i18n and types * style: prettier * refactor: naming
- Loading branch information
Showing
62 changed files
with
3,232 additions
and
563 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "none" | ||
|
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
|
||
import './styles.css' | ||
|
||
const ArrowIcon = () => ( | ||
<div className={classNames('dui-icon-container', 'centered')}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="19" | ||
height="16" | ||
viewBox="0 0 19 16" | ||
fill="none" | ||
> | ||
<path | ||
fill={'var(--navbar-icons)'} | ||
d="M10.303 15.8894L8.94081 14.5416L14.5763 8.92003H0.016949L0.021785 6.96933L14.5812 6.96933L8.97347 1.36549L10.3424 0L18.2674 7.94468L10.303 15.8894Z" | ||
/> | ||
</svg> | ||
</div> | ||
) | ||
|
||
export default ArrowIcon |
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,31 @@ | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
|
||
import './styles.css' | ||
|
||
const ChevronIcon = ({ down = false }: { down?: boolean }) => ( | ||
<div | ||
className={classNames( | ||
'dui-icon-container', | ||
'centered', | ||
down && 'rotate-180' | ||
)} | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="10" | ||
height="6" | ||
viewBox="0 0 10 6" | ||
> | ||
<g fill="none" fillRule="evenodd"> | ||
<path d="M-7 15h24V-9H-7z" /> | ||
<path | ||
fill={'var(--navbar-icons)'} | ||
d="M5 0l4.756 4.6a.806.806 0 0 1 .002 1.156.856.856 0 0 1-1.192.003L5 2.317 1.434 5.759a.856.856 0 0 1-1.192-.003A.806.806 0 0 1 .244 4.6L5 0z" | ||
/> | ||
</g> | ||
</svg> | ||
</div> | ||
) | ||
|
||
export default ChevronIcon |
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 @@ | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
|
||
import './styles.css' | ||
|
||
const ExternalIcon = () => ( | ||
<div className={classNames('dui-icon-container', 'centered')}> | ||
<svg | ||
width="14" | ||
height="15" | ||
viewBox="0 0 14 15" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M13.7158 11.9549L11.7997 11.9674L11.7997 4.00746L1.51738 14.3152L0.139735 12.9342L10.422 2.62639L2.49426 2.63894L2.49426 0.705449H13.7158L13.7158 11.9549Z" | ||
fill={'var(--navbar-icons)'} | ||
/> | ||
</svg> | ||
</div> | ||
) | ||
|
||
export default ExternalIcon |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.dui-navbar2__menu.dui-navbar2__menu-desktop { | ||
display: flex; | ||
height: 100%; | ||
} | ||
|
||
.dui-navbar2__menu.dui-navbar2__menu-mobile { | ||
position: fixed; | ||
display: none; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
background-color: var(--background); | ||
width: 100vw; | ||
height: 100vh; | ||
top: -150vh; | ||
left: 0; | ||
transition: top 200ms ease-in-out; | ||
} | ||
|
||
@media (max-width: 991px) { | ||
.dui-navbar2__menu.dui-navbar2__menu-mobile { | ||
display: flex; | ||
} | ||
} |
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,47 @@ | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
|
||
import { MenuItem } from '../MenuItem/MenuItem' | ||
import { Navbar2Pages } from '../Navbar2.types' | ||
import { MainMenuProps } from './MainMenu.types' | ||
|
||
import './MainMenu.css' | ||
|
||
export const MainMenu = (props: MainMenuProps) => { | ||
const { i18n, ...menuItemProps } = props | ||
return ( | ||
<div | ||
className={classNames( | ||
'dui-navbar2__menu', | ||
!props.isMobile && 'dui-navbar2__menu-desktop', | ||
props.isMobile && 'dui-navbar2__menu-mobile' | ||
)} | ||
> | ||
<MenuItem | ||
{...menuItemProps} | ||
section={Navbar2Pages.MARKETPLACE} | ||
title={i18n.marketplace} | ||
/> | ||
<MenuItem | ||
{...menuItemProps} | ||
section={Navbar2Pages.CREATE} | ||
title={i18n.create} | ||
/> | ||
<MenuItem | ||
{...menuItemProps} | ||
section={Navbar2Pages.EXPLORE} | ||
title={i18n.explore} | ||
/> | ||
<MenuItem | ||
{...menuItemProps} | ||
section={Navbar2Pages.LEARN} | ||
title={i18n.learn} | ||
/> | ||
<MenuItem | ||
{...menuItemProps} | ||
section={Navbar2Pages.GOVERNANCE} | ||
title={i18n.governance} | ||
/> | ||
</div> | ||
) | ||
} |
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,12 @@ | ||
import { Navbar2MenuI18nProps, Navbar2Pages } from '../Navbar2.types' | ||
|
||
export type MainMenuProps = { | ||
activePage: Navbar2Pages | string | ||
onToggleShowSubMenu: ( | ||
e: React.MouseEvent, | ||
show: boolean, | ||
section?: Navbar2Pages | ||
) => void | ||
i18n: Navbar2MenuI18nProps | ||
isMobile?: boolean | ||
} |
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,32 @@ | ||
.dui-menu-item .dui-icon-container.centered { | ||
margin-top: 4px; | ||
margin-left: 4px; | ||
} | ||
|
||
.dui-menu-item .dui-icon-container.centered svg path:nth-child(2) { | ||
fill: var(--navbar-item-text-enabled); | ||
} | ||
|
||
.dui-menu-item.active .dui-icon-container.centered svg path:nth-child(2), | ||
.dui-menu-item:hover .dui-icon-container.centered svg path:nth-child(2) { | ||
fill: var(--text); | ||
} | ||
|
||
@media (max-width: 991px) { | ||
.item.dui-menu-item.mobile { | ||
cursor: pointer; | ||
padding: 40px 0 23.66px; | ||
display: flex; | ||
align-items: center; | ||
border-bottom-color: var(--navbar-menu-hover); | ||
color: var(--navbar-menu-hover); | ||
font-size: 20px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 18px; | ||
border-bottom-style: solid; | ||
width: calc(100% - 50px); | ||
margin: 0 25px; | ||
justify-content: space-between; | ||
} | ||
} |
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,33 @@ | ||
import React from 'react' | ||
import Menu from 'semantic-ui-react/dist/commonjs/collections/Menu' | ||
import classNames from 'classnames' | ||
|
||
import ArrowIcon from '../../Icons/ArrowIcon' | ||
import ChevronIcon from '../../Icons/ChevronIcon' | ||
import { MenuItemProps } from './MenuItem.types' | ||
|
||
import './MenuItem.css' | ||
|
||
export const MenuItem = (props: MenuItemProps) => { | ||
const { activePage, section, title, onToggleShowSubMenu, isMobile } = props | ||
|
||
return ( | ||
<Menu.Item | ||
active={activePage === section} | ||
onMouseEnter={(e: React.MouseEvent) => | ||
!isMobile && onToggleShowSubMenu(e, true, section) | ||
} | ||
onMouseLeave={(e: React.MouseEvent) => | ||
!isMobile && onToggleShowSubMenu(e, false, section) | ||
} | ||
onClick={(e: React.MouseEvent) => { | ||
isMobile && onToggleShowSubMenu(e, true, section) | ||
}} | ||
className={classNames('dui-menu-item', section, isMobile && 'mobile')} | ||
> | ||
{title} | ||
{!isMobile && <ChevronIcon down={true} />} | ||
{isMobile && <ArrowIcon />} | ||
</Menu.Item> | ||
) | ||
} |
Oops, something went wrong.
c7c3272
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.
Successfully deployed to the following URLs:
decentraland-ui – ./
decentraland-ui-decentraland1.vercel.app
decentraland-ui-git-master-decentraland1.vercel.app