-
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.
Merge pull request #3 from decentraland/feat/navbar
feat: navbar
- Loading branch information
Showing
21 changed files
with
813 additions
and
15 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,3 +1,4 @@ | ||
import '@storybook/addon-options/register' | ||
import '@storybook/addon-links/register' | ||
import '@storybook/addon-storysource/register' | ||
import '@storybook/addon-actions/register' |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,69 @@ | ||
.dcl.navbar { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
justify-content: space-between; | ||
height: var(--navbar-height); | ||
padding: 0px 30px; | ||
} | ||
|
||
.dcl.navbar-logo { | ||
cursor: pointer; | ||
} | ||
|
||
.dcl.account-wrapper { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
cursor: pointer; | ||
} | ||
|
||
.dcl.account-wrapper .dcl.mana { | ||
display: inline-block; | ||
margin: 0em 1em 0em 0em; | ||
} | ||
|
||
.dcl.account-wrapper .dcl.blockie { | ||
margin-top: -0.2em; | ||
} | ||
|
||
.dcl.navbar-account { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
} | ||
|
||
.dcl.navbar-account .ui.menu.navbar-account-menu { | ||
margin: 0em 1em 0em 0em; | ||
} | ||
|
||
.dcl.navbar-account .ui.menu.navbar-account-menu .item .icon { | ||
margin: 0em; | ||
} | ||
|
||
.dcl.navbar-back { | ||
display: inline-block; | ||
position: relative; | ||
width: 52px; | ||
height: 52px; | ||
background-color: var(--secondary); | ||
border-radius: 100%; | ||
} | ||
|
||
.dcl.navbar-back .icon.chevron { | ||
position: absolute; | ||
top: 16px; | ||
left: 12px; | ||
} | ||
|
||
.dcl.navbar .ui.menu .item { | ||
color: var(--secondary-text); | ||
border-radius: var(--radius); | ||
text-transform: uppercase; | ||
} | ||
|
||
.dcl.navbar .ui.menu .item:hover, | ||
.dcl.navbar .ui.menu .item.active { | ||
color: var(--text-on-primary); | ||
background: var(--primary); | ||
} |
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,95 @@ | ||
import * as React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { action } from '@storybook/addon-actions' | ||
import { Icon, Menu, Navbar } from '../..' | ||
|
||
const pageStyle = { | ||
width: 1024, | ||
borderRadius: 8 | ||
//border: '1px solid #eee' | ||
} | ||
|
||
storiesOf('Navbar', module) | ||
.add('Static', () => { | ||
return ( | ||
<div style={pageStyle}> | ||
<Navbar /> | ||
</div> | ||
) | ||
}) | ||
.add('Connecting...', () => { | ||
return ( | ||
<div style={pageStyle}> | ||
<Navbar | ||
isConnected={false} | ||
isConnecting | ||
connectingMenuItem={<Menu.Item>Connecting...</Menu.Item>} | ||
/> | ||
</div> | ||
) | ||
}) | ||
.add('Logged In', () => { | ||
const address = '0x0a7a3b5d56470f7d4bd481da3038c9b3508836ea' | ||
return ( | ||
<div style={pageStyle}> | ||
<Navbar | ||
mana={20000} | ||
address={address} | ||
onClickAccount={action('Account clicked!')} | ||
onClickLogo={action('Logo clicked!')} | ||
/> | ||
</div> | ||
) | ||
}) | ||
.add('Logged Out', () => { | ||
return ( | ||
<div style={pageStyle}> | ||
<Navbar | ||
isConnected={false} | ||
isConnecting | ||
connectingMenuItem={ | ||
<Menu.Item onClick={action('Sign In clicked!')}>Sign In</Menu.Item> | ||
} | ||
/> | ||
</div> | ||
) | ||
}) | ||
.add('With Menu', () => { | ||
const address = '0x0a7a3b5d56470f7d4bd481da3038c9b3508836ea' | ||
const menuItems = ( | ||
<> | ||
<Menu.Item active onClick={action('Atlas clicked')}> | ||
Atlas | ||
</Menu.Item> | ||
<Menu.Item onClick={action('Marketplace clicked!')}> | ||
Marketplace | ||
</Menu.Item> | ||
<Menu.Item onClick={action('My Land clicked!')}>My Land</Menu.Item> | ||
</> | ||
) | ||
const accountMenuItems = ( | ||
<Menu.Item onClick={action('Activity clicked!')}> | ||
<Icon name="bell" /> | ||
</Menu.Item> | ||
) | ||
return ( | ||
<div style={pageStyle}> | ||
<Navbar | ||
mana={20000} | ||
address={address} | ||
menuItems={menuItems} | ||
accountMenuItems={accountMenuItems} | ||
activePage="Atlas" /* this is for the mobile navbar */ | ||
onClickAccount={action('Account clicked!')} | ||
onClickLogo={action('Logo clicked!')} | ||
/> | ||
</div> | ||
) | ||
}) | ||
.add('Modal', () => { | ||
return ( | ||
<div style={pageStyle}> | ||
<Navbar isModal onBack={action('Go Back clicked!')} /> | ||
</div> | ||
) | ||
}) |
Oops, something went wrong.