Skip to content

Commit

Permalink
Cardinal design updates
Browse files Browse the repository at this point in the history
  • Loading branch information
m-tymchyk committed Oct 19, 2017
1 parent 57427a0 commit 7f4c31b
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 105 deletions.
23 changes: 11 additions & 12 deletions src/Popup/Screens/HomeScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,30 @@ class HomeScreen extends React.Component {

const currentTicker = _.find(tickers, {key: currentTickerKey});

const currentTickerLabelProps = {
className: "current-ticker-label",
const currentMarketLabelProps = {
className: "header__current-market",
onClick: () => {
this.setState({selectMode: true});
}
};

return (
<div>
{this.drawTickerList()}

<header className="header">
<a href="https://kuna.io/" target="_blank" className="header__logo">
<img className="header__logo-img" src="/images/kuna-logo.png"/>
</a>
</header>

{this.drawTickerList()}
{
currentTicker && (
<div {...currentTickerLabelProps}>
<label className="current-ticker-label__item">
{
currentTicker && (
<label {...currentMarketLabelProps}>
{currentTicker.baseCurrency} / {currentTicker.quoteCurrency}
</label>
</div>
)
}
)
}
</header>

<CurrentTickerView ticker={currentTicker}/>
</div>
);
Expand Down
70 changes: 44 additions & 26 deletions src/Popup/Screens/HomeViews/CurrentTickerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,52 @@ class CurrentTickerView extends React.Component<CurrentTickerViewPropsInterface,

return (
<div className="current-ticker">
<label className="current-ticker__price">
{Numeral(ticker.price).format(ticker.format)}
<span className="current-ticker__price-currency">{ticker.quoteCurrency}</span>
</label>

<div className="current-ticker__market">
<a
href={`https://kuna.io/markets/${ticker.key}`}
className="current-ticker__market-link"
target="_blank"
>Market {ticker.baseCurrency}/{ticker.quoteCurrency}</a>
<div className="current-ticker__bugged">
<label className="current-ticker__price">
{Numeral(ticker.price).format(ticker.format)}
<span className="current-ticker__price-currency">{ticker.quoteCurrency}</span>
</label>

<div className="current-ticker__market">
<a
href={`https://kuna.io/markets/${ticker.key}`}
className="current-ticker__market-link"
target="_blank"
>Market {ticker.baseCurrency}/{ticker.quoteCurrency}</a>
</div>
</div>

<div className="current-ticker__title">Volume 24h</div>

<label className="current-ticker__vol">
<span className="current-ticker__vol-currency">{ticker.baseCurrency}</span>
<span className="current-ticker__vol-value">
{Numeral(ticker.volume_base).format("0,0.[00]")}
</span>
</label>

<label className="current-ticker__vol">
<span className="current-ticker__vol-currency">{ticker.quoteCurrency}</span>
<span className="current-ticker__vol-value">
{Numeral(ticker.volume_quote).format("0,0.[00]")}
</span>
</label>
<div className="current-ticker__info-container">
<label className="current-ticker__info">
<span className="current-ticker__info-label">Volume {ticker.baseCurrency}</span>
<span className="current-ticker__info-value">
{Numeral(ticker.volume_base).format("0,0.[00]")}
</span>
</label>

<label className="current-ticker__info">
<span className="current-ticker__info-label">Volume {ticker.quoteCurrency}</span>
<span className="current-ticker__info-value">
{Numeral(ticker.volume_quote).format("0,0.[00]")}
</span>
</label>



<label className="current-ticker__info">
<span className="current-ticker__info-label">Low price</span>
<span className="current-ticker__info-value">
{Numeral(ticker.OHLC.low).format("0,0.[00]")}
</span>
</label>

<label className="current-ticker__info">
<span className="current-ticker__info-label">High price</span>
<span className="current-ticker__info-value">
{Numeral(ticker.OHLC.high).format("0,0.[00]")}
</span>
</label>
</div>
</div>
);
}
Expand Down
40 changes: 40 additions & 0 deletions src/Style/parts/header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.header {
padding: 0 10px;
height: 50px;
background: white;
display: flex;
justify-content: space-between;
align-items: center;

&__logo {
display: block;
&-img {
display: block;
height: 21px;
}
}

&__current-market {
display: block;
cursor: pointer;
padding: 0 22px 0 8px;
border-radius: 4px;
font-size: 14px;
color: $color-shuttle-gray;

&:after {
border-style: solid;
border-color: $color-shuttle-gray;
border-width: 1px 1px 0 0;
content: '';
transform: rotate(135deg);
display: block;
height: 4px;
width: 4px;
margin-top: -4px;
position: absolute;
right: 8px;
top: 50%;
}
}
}
20 changes: 4 additions & 16 deletions src/Style/popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ html {

body {
width: 300px;
height: 200px;
height: 255px;
overflow: hidden;
font-size: 16px;
background: white;
color: $color-shuttle-gray;
color: $color-dark-gray;
background: $color-all-ocean;
font-family: $font;
}

@import "parts/header";

.created-by {
display: none;
position: fixed;
Expand Down Expand Up @@ -49,20 +51,6 @@ body {
letter-spacing: 0.8px;
}

.header {
height: 50px;
background: white;
display: flex;
justify-content: space-between;
align-items: center;
&__logo {
display: block;
&-img {
height: 16px;
}
}
}

.application {
padding: 0;
}
Expand Down
103 changes: 52 additions & 51 deletions src/Style/screens/home.scss
Original file line number Diff line number Diff line change
@@ -1,55 +1,74 @@
.current-ticker {

&__bugged {
padding: 24px 0;
}

&__price {
font-size: 24px;
display: inline-block;
display: block;
position: relative;
margin: 0;
text-align: center;
width: 100%;
line-height: 24px;
letter-spacing: 0.6px;

&-currency {
position: absolute;
bottom: 0;
left: 100%;
margin-bottom: 3px;
margin-left: 6px;
font-size: 14px;
color: rgb(200, 200, 200);
color: $color-gull-gray;
font-weight: 100;
letter-spacing: 0.4px;
}
}

&__market {
display: block;
margin: 4px 0 8px 0;
text-align: center;
line-height: 16px;
font-weight: 100;
letter-spacing: 0.4px;
&-link {
font-size: 10px;
color: $color-gull-gray;
text-decoration: none;
&:hover {
color: darken($color-gull-gray, 5%);
}
}
}

&__title {
font-size: 12px;
color: rgb(160, 160, 160);
}
&__info {
&-container {
padding: 0 10px;
}

&__vol {
display: inline-block;
width: 100px;
&-currency, &-value {
display: inline-block;
vertical-align: middle;
font-size: 12px;
}
width: 50%;
padding: 0;
margin-bottom: 16px;

&-currency {
color: rgb(200, 200, 200);
margin-right: 4px;
&-label {
display: block;
color: $color-gull-gray;
text-transform: uppercase;
font-size: 10px;
font-weight: 100;
letter-spacing: 0.8px;
}

&-value {
font-size: 14px;
font-weight: 100;
letter-spacing: 0.8px;
}
}
}

.ticker-list {
transition: all 0.2s;
transition: all 0.4s;
position: fixed;
left: 0;
top: 0;
Expand All @@ -58,22 +77,25 @@
background: rgb(255, 255, 255);
overflow-y: scroll;
z-index: 100;
padding: 4px;
visibility: hidden;
opacity: 0;
transform: scale(0.8);

&.-active {
visibility: visible;
opacity: 1;
transform: scale(1);
}

&__item {
transition: all 0.2s;
position: relative;
padding: 8px 8px;
padding: 8px;
border-radius: 4px;
font-size: 12px;
margin-bottom: 2px;
cursor: pointer;
border-bottom: 1px solid rgb(240, 240, 240);

display: flex;
justify-content: space-between;

Expand All @@ -88,35 +110,14 @@
color: $color-kuna-blue;
font-weight: 100;
}
}
}

.current-ticker-label {
display: block;
text-align: center;
margin-bottom: 16px;
&.-active {
background: linear-gradient(45deg, $color-kuna-dark-blue, $color-kuna-blue);
}

&__item {
display: inline-block;
cursor: pointer;
padding: 0 22px 0 8px;
border-radius: 4px;
font-size: 14px;
color: $color-kuna-blue;

&:after {
border-style: solid;
border-color: $color-kuna-blue;
border-width: 1px 1px 0 0;
content: ' ';
transform: rotate(135deg);
display: block;
height: 4px;
width: 4px;
margin-top: -4px;
position: absolute;
right: 8px;
top: 50%;
&.-active &-price,
&.-active &-name {
color: white;
}
}
}
1 change: 1 addition & 0 deletions src/Style/variable.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$color-kuna-blue: #3FA9F5;
$color-kuna-dark-blue: #3F97F5;

$color-dark-gray: #373C46;
$color-shuttle-gray: #5A6170;
$color-gull-gray: #9DA6B8;
$color-alto: #DADFEA;
Expand Down

0 comments on commit 7f4c31b

Please sign in to comment.