forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moved current header to the new navigation bar using new icons
- Loading branch information
1 parent
4fad6fa
commit 1f5ab78
Showing
18 changed files
with
174 additions
and
83 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
wallet/src/ui/app/components/navigation/Navigation.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,56 @@ | ||
@use '_variables' as v; | ||
@use '_values' as values; | ||
|
||
.container { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
background-color: v.use(v.$colors-nav-background-color); | ||
backdrop-filter: v.use(v.$colors-nav-background-filter); | ||
height: values.$sizing-nav-height; | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
align-items: center; | ||
justify-content: stretch; | ||
padding: 5px 10px; | ||
overflow: hidden; | ||
} | ||
|
||
.link { | ||
display: flex; | ||
flex-flow: column nowrap; | ||
align-items: center; | ||
padding: 6px 6px 14px; | ||
text-decoration: none; | ||
color: v.use(v.$colors-nav-item-color); | ||
user-select: none; | ||
flex-grow: 1; | ||
flex-basis: 80px; | ||
|
||
&.active { | ||
color: v.use(v.$colors-nav-item-highlighted-color); | ||
} | ||
} | ||
|
||
.icon { | ||
font-size: 32px; | ||
margin-bottom: 2px; | ||
|
||
.active > & { | ||
color: v.use(v.$colors-nav-item-icon-highlighted-color); | ||
background-clip: text; | ||
background-image: v.use( | ||
v.$colors-nav-item-icon-highlighted-gradient-color | ||
); | ||
} | ||
} | ||
|
||
.title { | ||
font-size: 13px; | ||
line-height: 12px; | ||
font-weight: 600; | ||
|
||
.active > & { | ||
font-weight: 700; | ||
} | ||
} |
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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import cl from 'classnames'; | ||
import { memo } from 'react'; | ||
import { NavLink } from 'react-router-dom'; | ||
|
||
import Icon, { SuiIcons } from '_components/icon'; | ||
|
||
import st from './Navigation.module.scss'; | ||
|
||
function makeLinkCls({ isActive }: { isActive: boolean }) { | ||
return cl(st.link, { [st.active]: isActive }); | ||
} | ||
|
||
export type NavigationProps = { | ||
className?: string; | ||
}; | ||
|
||
function Navigation({ className }: NavigationProps) { | ||
return ( | ||
<nav className={cl(st.container, className)}> | ||
<NavLink to="./tokens" className={makeLinkCls} title="Tokens"> | ||
<Icon className={st.icon} icon={SuiIcons.Tokens} /> | ||
<span className={st.title}>Coins</span> | ||
</NavLink> | ||
<NavLink to="./nfts" className={makeLinkCls} title="NFTs"> | ||
<Icon className={st.icon} icon={SuiIcons.Nfts} /> | ||
<span className={st.title}>NFTs</span> | ||
</NavLink> | ||
<NavLink | ||
to="./transactions" | ||
className={makeLinkCls} | ||
title="Transactions" | ||
> | ||
<Icon className={st.icon} icon={SuiIcons.History} /> | ||
<span className={st.title}>Activity</span> | ||
</NavLink> | ||
<NavLink to="./settings" className={makeLinkCls} title="Settings"> | ||
<Icon className={st.icon} icon={SuiIcons.Apps} /> | ||
<span className={st.title}>Settings</span> | ||
</NavLink> | ||
</nav> | ||
); | ||
} | ||
|
||
export default memo(Navigation); |
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
@use '_values/dimensions'; | ||
@use '_values' as val; | ||
@use '_variables' as v; | ||
|
||
.container { | ||
display: flex; | ||
align-items: center; | ||
flex-flow: column nowrap; | ||
@include v.set(v.$sizing-nav-height-placeholder, val.$sizing-nav-height); | ||
|
||
&.forced-popup-dimensions, | ||
&.nav-hidden { | ||
@include v.set(v.$sizing-nav-height-placeholder, 0); | ||
} | ||
|
||
&.forced-popup-size, | ||
:global(.is-popup) & { | ||
width: dimensions.$popup-width; | ||
height: dimensions.$popup-height; | ||
width: val.$sizing-popup-width; | ||
height: val.$sizing-popup-height; | ||
} | ||
} |
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
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,2 +1,2 @@ | ||
@forward './dimensions' as dimensions-*; | ||
@forward './sizing' as sizing-*; | ||
@forward './colors' as colors-*; |
1 change: 1 addition & 0 deletions
1
wallet/src/ui/styles/values/dimensions.scss → wallet/src/ui/styles/values/sizing.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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
$popup-width: 360px; | ||
$popup-height: 595px; | ||
$nav-height: 76px; |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
@forward './colors' as colors-*; | ||
@forward './shadows' as shadows-*; | ||
@forward './sizing' as sizing-*; | ||
|
||
@function use($variable) { | ||
@return var(#{$variable}); | ||
} | ||
|
||
@mixin set($variable, $value) { | ||
#{$variable}: $value; | ||
} |
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 @@ | ||
$nav-height-placeholder: '--sizing-navigation-placeholder-height'; |