Skip to content

Commit

Permalink
Merge pull request #847 from nthgness/alexFront
Browse files Browse the repository at this point in the history
#828 - Fix wallet page on all devices, all media and mobile
  • Loading branch information
0xZick committed Nov 7, 2018
2 parents 6d5292f + 368f583 commit 8db4c7c
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 29 deletions.
3 changes: 2 additions & 1 deletion shared/components/tables/Table/Table.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { isMobile } from 'react-device-detect'

import CSSModules from 'react-css-modules'
import styles from './Table.scss'
Expand Down Expand Up @@ -75,7 +76,7 @@ export default class Table extends React.Component {
const { sticky } = this.state
return (
<table styleName={sticky ? 'table table-fixed' : 'table'} className={className} ref={(table) => this.linkOnTable = table}>
<thead ref={(thead) => this.linkOnTableHead = thead}>
<thead ref={(thead) => this.linkOnTableHead = thead} styleName={isMobile ? 'mobileThead' : ''}>
<tr>
{
titles.filter(title => !!title).map((title, index) => (
Expand Down
53 changes: 41 additions & 12 deletions shared/components/tables/Table/Table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,43 @@
}


table.wallet {
tr {
display: table-row;
}
}

@include media-tablet {

table {
overflow-x: auto;
}

table.wallet {
td:nth-child(1) {
width: 5%;
}
td:nth-child(2) {
width: 12%;
}
td:nth-child(3) {
width: 18%;
}
th:last-child {
padding-left: 15px;
}
tr {
display: table-row;
}
}
th:nth-child(4) {
display: none;
}
.mobileThead {
th:nth-child(4) {
display: block;
}
}
}

@include media-mobile {
Expand All @@ -290,13 +324,11 @@
}

table.wallet {
td {
td:nth-child(5) {
div {
button {
width: 40px;
padding: 1px 7px 2px 7px;
margin: 0 1px;
}
position: absolute;
bottom: 0;
left: 20px;
}
}

Expand Down Expand Up @@ -335,6 +367,9 @@
}
}
}
tr {
display: block;
}
}
.wallet {
margin-bottom: 15px;
Expand Down Expand Up @@ -381,12 +416,6 @@
padding: 0 10px;
align-items: center;
}
td:nth-child(1) {
// a {
// position: absolute;
// top: 10px;
// }
}
tbody {
width: 100%;
display: block;
Expand Down
4 changes: 2 additions & 2 deletions shared/pages/Wallet/Row/Row.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default class Row extends Component {
</div>
)
}
{isMobile && <span styleName="mobileName">{fullName}</span>}
<span styleName="mobileName">{fullName}</span>
</td>

{ !isMobile && (
Expand All @@ -231,7 +231,7 @@ export default class Row extends Component {
text={address}
onCopy={this.handleCopyAddress}
>
<td>
<td styleName="yourAddress">
{
!contractAddress ? (
<div styleName="notContractAddress">
Expand Down
41 changes: 28 additions & 13 deletions shared/pages/Wallet/Row/Row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,35 @@
max-width: 124px;
}

.mobileName {
color: #000;
display: block;
margin-left: -10px;
display: none;
}

.hidden {
display: none;
}

.visible {
display: none;
}


@include media-tablet {
.yourAddress {
display: none;
}
}

@include media-mobile {
.mobileName {
display: block;
}
.yourAddress {
display: none;
}
.table_balance-cell {
min-width: 75px;
}
Expand Down Expand Up @@ -182,19 +210,6 @@
}
}

.mobileName {
color: #000;
display: block;
margin-left: -10px;
}

.hidden {
display: none;
}

.visible {
display: none;
}



Expand Down
2 changes: 1 addition & 1 deletion shared/pages/Wallet/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class Wallet extends Component {
const showSaveKeysModal = !zeroBalance && !keysSaved && !testNetSkip // non-zero balance and no keys saved

return (
<section>
<section styleName={isMobile ? 'sectionWalletMobile' : 'sectionWallet'}>
{ showSaveKeysModal && <SaveKeysModal /> }
<PageHeadline>
<SubTitle>
Expand Down
11 changes: 11 additions & 0 deletions shared/pages/Wallet/Wallet.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.coinsActionsBlock {
margin: 25px 0px;
}
.sectionWalletMobile {
margin-top: -88px;
}
.sectionWallet {
margin-top: 88px;
}
@include media-mobile {
.sectionWalletMobile {
margin-top: 0px;
}
}

0 comments on commit 8db4c7c

Please sign in to comment.