Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
fix as comments
Browse files Browse the repository at this point in the history
  • Loading branch information
evilpeach committed Aug 16, 2020
1 parent d02ae98 commit 331d6e7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
49 changes: 22 additions & 27 deletions scan/src/components/Header.re
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Styles = {
paddingTop(Spacing.lg),
backgroundColor(Colors.white),
borderBottom(`px(2), `solid, Colors.blueGray1),
marginBottom(`px(24)),
zIndex(3),
Media.mobile([
padding(Spacing.md),
Expand All @@ -23,14 +22,7 @@ module Styles = {
let telegramLogo = style([width(`px(15))]);
let cmcLogo = style([width(`px(17))]);

let socialLink =
style([
display(`flex),
flexDirection(`row),
justifyContent(`center),
alignItems(`center),
marginLeft(`px(10)),
]);
let socialLink = style([marginLeft(`px(10))]);

let link = style([cursor(`pointer)]);
};
Expand Down Expand Up @@ -78,24 +70,27 @@ module DesktopRender = {
</LinkToHome>
<HSpacing size=Spacing.xs />
<ChainIDBadge />
<div className=Styles.socialLink>
<a href="https://twitter.com/bandprotocol" target="_blank" rel="noopener">
<img src=Images.twitterLogo className=Styles.twitterLogo />
</a>
</div>
<div className=Styles.socialLink>
<a href="https://t.me/bandprotocol" target="_blank" rel="noopener">
<img src=Images.telegramLogo className=Styles.telegramLogo />
</a>
</div>
<div className=Styles.socialLink>
<a
href="https://coinmarketcap.com/currencies/band-protocol/"
target="_blank"
rel="noopener">
<img src=Images.cmcLogo className=Styles.telegramLogo />
</a>
</div>
<a
href="https://twitter.com/bandprotocol"
target="_blank"
rel="noopener"
className=Styles.socialLink>
<img src=Images.twitterLogo className=Styles.twitterLogo />
</a>
<a
href="https://t.me/bandprotocol"
target="_blank"
rel="noopener"
className=Styles.socialLink>
<img src=Images.telegramLogo className=Styles.telegramLogo />
</a>
<a
href="https://coinmarketcap.com/currencies/band-protocol/"
target="_blank"
rel="noopener"
className=Styles.socialLink>
<img src=Images.cmcLogo className=Styles.telegramLogo />
</a>
</div>
</div>
</div>
Expand Down
6 changes: 2 additions & 4 deletions scan/src/components/NavBar.re
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module RenderDesktop = {
module Styles = {
open Css;

let flexBox = style([display(`flex), justifyContent(`spaceBetween)]);

let nav = isActive =>
style([
padding2(~v=`px(16), ~h=`zero),
Expand All @@ -21,10 +19,10 @@ module RenderDesktop = {
let make = (~routes) => {
let currentRoute = ReasonReactRouter.useUrl() |> Route.fromUrl;

<div className=Styles.flexBox>
<div className={CssHelper.flexBox(~justify=`spaceBetween, ())}>
{routes
->Belt.List.map(((v, route)) =>
<div className=Styles.flexBox>
<div className={CssHelper.flexBox(~justify=`spaceBetween, ())}>
<Link className={Styles.nav(currentRoute == route)} route>
{v |> React.string}
</Link>
Expand Down
3 changes: 2 additions & 1 deletion scan/src/pages/HomePage.re
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ let make = () => {
let lastest11BlocksSub = BlockSub.getList(~pageSize, ~page=1, ());
let latestBlockSub = lastest11BlocksSub->Sub.map(blocks => blocks->Belt_Array.getExn(0));

<Section>
// TODO: fix it later
<Section ptSm=0>
<div className=CssHelper.container>
<div className=Styles.highlightsContainer>
<ChainInfoHighlights latestBlockSub />
Expand Down
12 changes: 10 additions & 2 deletions scan/src/reusable/Section.re
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ module Styles = {

let base = (~pt, ~pb, ()) => style([paddingTop(`px(pt)), paddingBottom(`px(pb))]);

let mobile = (~ptSm, ~pbSm, ()) =>
style([Media.mobile([paddingTop(`px(ptSm)), paddingBottom(`px(pbSm))])]);

let bgColor = color => style([backgroundColor(color)]);
};

[@react.component]
let make = (~children, ~pt=0, ~pb=0, ~bg=Colors.white) => {
let css = Css.merge([Styles.bgColor(bg), Styles.base(~pt, ~pb, ())]);
let make = (~children, ~pt=24, ~pb=24, ~ptSm=pt, ~pbSm=pb, ~bg=Colors.white) => {
let css =
Css.merge([
Styles.bgColor(bg),
Styles.base(~pt, ~pb, ()),
Styles.mobile(~ptSm, ~pbSm, ()),
]);

<section className=css> children </section>;
};

0 comments on commit 331d6e7

Please sign in to comment.