Tabs Simplify and Summary Tidy-up (#885)

* tabs simple

* remove min width

* 3 stats iphone size

* node info media-small

* spacing

* center stat

* iphone SE size summary support

* line-height, safari UI bug

* mob spacing (uhoh, @media queries building up)

*      trailing whitespace

* normalise media breakpoints

* nits

* padding, rem-ing

* trailing whitespace
This commit is contained in:
Ross Bulat 2019-04-03 22:32:16 +08:00 committed by Jaco Greeff
parent 71b8eb167a
commit 9a3489e54f
9 changed files with 89 additions and 43 deletions

View File

@ -45,18 +45,24 @@ class Summary extends React.PureComponent<Props, State> {
return (
<SummaryBox>
<section className='ui--media-medium'>
<section>
<CardSummary label={t('refresh in')}>
<Elapsed value={nextRefresh} />
</CardSummary>
<CardSummary label={t('total peers')}>
<CardSummary
className='ui--media-small'
label={t('total peers')}
>
{
info.health
? `${info.health.peers.toNumber()}`
: '-'
}
</CardSummary>
<CardSummary label={t('syncing')}>
<CardSummary
className='ui--media-small'
label={t('syncing')}
>
{
info.health
? (

View File

@ -19,8 +19,11 @@ class Summary extends React.PureComponent<Props> {
return (
<SummaryBox>
<section className='ui--media-small'>
<CardSummary label={t('target')}>
<section>
<CardSummary
className='ui--media-small'
label={t('target')}
>
<TimePeriod />
</CardSummary>
<CardSummary label={t('last block')}>

View File

@ -31,6 +31,15 @@ const Wrapper = styled.div`
overflow-x: hidden;
overflow-y: auto;
width: 100%;
padding: 0 2rem;
@media(max-width: 768px) {
padding: 0 0.5rem;
}
`;
const Connecting = styled.div`
padding: 1rem 0;
`;
const unknown = {
@ -52,7 +61,7 @@ class Content extends React.Component<Props> {
if (needsApi && (!isApiReady || !isApiConnected)) {
return (
<Wrapper>
<main>{t('Waiting for API to be connected and ready.')}</main>
<Connecting>{t('Waiting for API to be connected and ready.')}</Connecting>
</Wrapper>
);
}

View File

@ -17,7 +17,6 @@ import styled from 'styled-components';
const Card = styled.article`
align-items: center;
box-shadow: none;
background: none;
color: rgba(0, 0, 0, 0.6);
display: flex;
flex: 0 1 auto;
@ -25,29 +24,45 @@ const Card = styled.article`
justify-content: flex-end;
min-height: 5.7rem;
padding: 0.5rem 1.5rem;
text-align: left;
> div {
font-size: 2.2rem;
font-size: 2.1rem;
font-weight: 100;
line-height: 2.25rem;
line-height: 2.1rem;
text-align: right;
> * {
margin: 0.4rem 0;
margin: 0.6rem 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
> label {
line-height: 1rem;
min-width: 7rem !important;
font-size: 0.9rem;
font-size: 0.95rem;
}
.progress {
margin: 0.25rem 0 -0.5rem !important;
margin: 0.2rem 0 -0.5rem !important;
background: rgba(0,0,0,0.05);
}
}
@media(max-width: 767px) {
min-height: 4.8rem;
padding: 0.25 0.4em;
> div {
font-size: 1.4rem;
line-height: 1.4rem;
}
}
`;
type ProgressProps = {
@ -66,7 +81,7 @@ type Props = BareProps & {
export default class CardSummary extends React.PureComponent<Props> {
render () {
const { children, progress, label } = this.props;
const { children, className, label, progress, style } = this.props;
const value = progress && progress.value;
const total = progress && progress.total;
const left = progress && !isUndefined(value) && !isUndefined(total) && value.gten(0) && total.gtn(0)
@ -90,7 +105,10 @@ export default class CardSummary extends React.PureComponent<Props> {
}
return (
<Card>
<Card
className={className}
style={style}
>
<Labelled
isSmall
label={label}

View File

@ -13,27 +13,11 @@ type Props = BareProps & {
const StyledSummary = styled.div`
align-items: stretch;
background: rgba(255,255,255,0.65);
border-radius: 4px;
box-shadow: 0 10px 40px rgba(0,0,0,.1);
display: flex;
flex-wrap: no-wrap;
justify-content: space-between;
margin-bottom: 2.5em;
overflow-x: scroll;
padding-right: 1rem;
&::-webkit-scrollbar {
height: 2px;
}
&::-webkit-scrollbar-thumb {
background: #e1e1e1;
}
&::-webkit-scrollbar-track {
background: none;
}
> section {
display: flex;
@ -41,10 +25,6 @@ const StyledSummary = styled.div`
text-align: left;
}
> section:first-child > article:first-child .label-small > label {
min-width: 4rem !important;
}
details & {
display: block;
margin: 0.5rem 0.25rem;
@ -61,6 +41,14 @@ const StyledSummary = styled.div`
}
}
@media(max-width: 767px) {
padding: 0;
.ui--media-small {
display: none !important;
}
}
.ui.label {
padding-left: 0;
padding-right: 0;

View File

@ -53,7 +53,6 @@ br {
}
main {
padding: 1em 2em;
min-height: 100vh;
}
@ -98,6 +97,10 @@ article {
}
header {
margin-bottom: 2em;
margin-bottom: 1.1rem;
text-align: center;
@media(max-width: 767px) {
margin-bottom: 0.8rem;
}
}

View File

@ -13,6 +13,7 @@
.ui--media-large,
.ui--media-medium,
.ui--media-small {
display: none;
height: 0;
visibility: hidden;
width: 0;
@ -70,6 +71,7 @@ th.ui--media-small {
height: auto;
visibility: visible;
width: auto;
}
td.ui--media-small,
@ -81,7 +83,7 @@ th.ui--media-small {
/* tabs */
@media (max-width: 767px) {
.ui.menu.tabular {
padding-left: 4.2rem !important;
padding-left: 5.2rem !important;
}
}

View File

@ -160,14 +160,27 @@
}
.ui.menu.tabular {
background: #f2f2f2;
border-color: #e6e6e6;
/* break out of the wrapping main padding */
margin: -1em -2em 0;
padding: 1em 2em 0;
overflow-x: scroll;
padding: 2em 2em 0 2em;
transition: padding-left 0.2s linear 0.4s;
.item.active {
background: #fafafa /* #fff */;
&::-webkit-scrollbar {
display: none;
width: 0px;
}
.item {
border-bottom: 2px solid rgba(0, 0, 0, 0);
top: -1px;
&.active {
background: none; /* #fafafa */;
border: none;
border-bottom: 2px solid #3f3f3f;
}
}
}

View File

@ -114,4 +114,8 @@
color: $nav-link;
}
}
.ui.menu.tabular .item.active {
border-bottom: 2px solid rgba(215, 94, 161, 1);
}
}