Skip to content

Commit

Permalink
MINT-295 hotfix: mobile styles (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkchv authored and Boris Shevchenko committed Jul 3, 2017
1 parent 1b24747 commit 8d5409a
Show file tree
Hide file tree
Showing 22 changed files with 241 additions and 79 deletions.
11 changes: 11 additions & 0 deletions src/components/dashboard/DepositTokens/DepositTokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@

.actions {
text-align: right;

.action {
margin-left: 40px;

@media only screen and (max-width: $media-size-md) {
margin-left: 20px;
margin-bottom: 20px;
display: inline-block;

&:first-child {
margin-left: 0;
}
}
}
}
5 changes: 5 additions & 0 deletions src/components/dashboard/IconSection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
}

.right {

@media only screen and (max-width: $media-size-md) {
margin-left: 25px;
}

:global {
.icon {
border-radius: 12px;
Expand Down
3 changes: 2 additions & 1 deletion src/components/dashboard/SendTokens.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ export class SendTokens extends React.Component {
return (
<div styleName="form">
<div>
<TextField style={{width: '330px'}}
<TextField
fullWidth
onChange={(event, value) => this.handleRecipientChanged(value)}
value={this.state.recipient.value}
floatingLabelText="Recipient address"
Expand Down
14 changes: 14 additions & 0 deletions src/components/dashboard/TransactionsTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ $cell-padding: 24px 0px;
position: relative;
table-layout: fixed;

@media only screen and (max-width: $media-size-md) {
display: block;
overflow-x: scroll;
}

.table-head {

display: table-row-group;
Expand Down Expand Up @@ -66,6 +71,10 @@ $cell-padding: 24px 0px;
padding: $cell-padding;
position: relative;
overflow: hidden;

@media only screen and (max-width: $media-size-md) {
overflow: visible;
}
}
}
}
Expand Down Expand Up @@ -98,6 +107,11 @@ $cell-padding: 24px 0px;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 20px;

@media only screen and (max-width: $media-size-md) {
overflow: visible;
white-space: normal;
}
}

.text-faded {
Expand Down
10 changes: 9 additions & 1 deletion src/components/dialogs/AddCurrencyDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

.content {

width: 928px;
background-color: $color-white;

.header {
Expand Down Expand Up @@ -58,6 +57,11 @@
color: $color-primary-0;
display: flex;
padding: 36px 0px;

@media only screen and (max-width: $media-size-md) {
display: block;
}

:global {
td {
cursor: pointer;
Expand All @@ -70,6 +74,10 @@
width: 50%;
padding: 0px 24px;

@media only screen and (max-width: $media-size-md) {
width: 100%;
}

h5 {
margin: 0;
font-size: 24px;
Expand Down
1 change: 0 additions & 1 deletion src/components/dialogs/AddTokenDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

.content {

width: 362px;
background-color: $color-white;

.header {
Expand Down
1 change: 0 additions & 1 deletion src/components/dialogs/BuyTokensDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

.root {

width: 928px;
background-color: $color-white;

.header {
Expand Down
2 changes: 0 additions & 2 deletions src/components/dialogs/ConfirmTxDialog/ConfirmTxDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
@import '~styles/partials/variables';

.root {

width: 700px;
background-color: $color-white;

.header {
Expand Down
16 changes: 14 additions & 2 deletions src/components/dialogs/ModalDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@
align-items: center;
justify-content: center;

@media only screen and (max-width: $media-size-md) {
display: block;
}

.dialog {
flex: 0 0 auto;
//flex: 0 0 auto;
position: relative;

display: block;
width: 90%;
max-width: 900px;

@media only screen and (max-width: $media-size-md) {
margin: 20px auto;
}

.content {
position: relative;
}
Expand All @@ -34,7 +46,7 @@

:global(.ModalDialog) {
&__backdrop {

overflow: scroll;
background: $color-modal-backdrop-bg;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ class GenerateWallet extends Component {
/>
</div>
)}
<div>
<div styleName='action'>
<FlatButton
secondary
label='Back'
onTouchTap={this.handleBackClick}
style={styles.secondaryButton}
/>
</div>
<div>
<div styleName='action'>
<RaisedButton
label='Download Wallet'
primary
Expand Down
15 changes: 15 additions & 0 deletions src/components/pages/LoginPage/GenerateWallet/GenerateWallet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@
align-items: center;
margin-top: 32px;
justify-content: flex-end;

@media only screen and (max-width: $media-size-md) {
flex-wrap: wrap;
}
}

.grow {
flex-grow: 1;

@media only screen and (max-width: $media-size-md) {
width: 100%;
padding: 10px 0;
}
}

.action {
@media only screen and (max-width: $media-size-md) {
width: 50%;
}
}
14 changes: 13 additions & 1 deletion src/components/pages/LoginPage/LoginInfura/LoginInfura.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
@import "~styles/partials/variables";

$gutter: 20px;

.row {
display: flex;
margin: 20px (-$gutter / 2) 0
margin: 20px (-$gutter / 2) 0;

@media only screen and (max-width: $media-size-md) {
display: block;
}
}

.col {
width: 50%;
margin: 0 ($gutter/ 2);

@media only screen and (max-width: $media-size-md) {
width: 100%;
margin: 0;
padding: 10px 10px 0;
}
}

.generateIcon {
Expand Down
22 changes: 18 additions & 4 deletions src/layouts/Markup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,28 @@
flex-direction: row;

.drawer {
position: relative;
flex: 0 0 auto;
width: 60px;
display: none; // TODO @bshevchenko: display: flex;
display: none;
flex-direction: column;

background-color: $color-white;
box-shadow: $box-shadow-0;

width: 60px;
height: 60px;
overflow: hidden;
position: absolute;

&:hover {
width: auto;
height: auto;
overflow: visible;
box-shadow: $box-shadow-0;
position: relative;
}

@media only screen and (max-width: $media-size-md) {
display: flex;
}
}

.middle {
Expand Down
68 changes: 42 additions & 26 deletions src/layouts/partials/DrawerPartial.jsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,60 @@
import React from 'react'

import { connect } from 'react-redux'
import { List, ListItem, IconButton, FontIcon } from 'material-ui'

import { menu } from './HeaderPartial'
import styles from './styles'
import { logout } from '../../redux/session/actions'
import { Link } from 'react-router'
import './DrawerPartial.scss'

const mapStateToProps = (state) => ({
isCBE: state.get('session').isCBE
})

const mapDispatchToProps = (dispatch) => ({
handleLogout: () => dispatch(logout())
})

@connect(mapStateToProps, mapDispatchToProps)
export default class DrawerPartial extends React.Component {

constructor(props) {
constructor (props) {
super(props)
this.menu = [...menu]

if (!props.isCBE) {
this.menu.push({key: 'cbeDashboard', title: 'CBE Dashboard', icon: 'dashboard', path: '/cbe'})
} else {
this.menu.push({key: 'oldInterface', title: 'Old Interface', icon: 'dashboard', path: '/profile'})
}
}

render() {
render () {
return (
<div styleName="root">
<div styleName="content">
<div styleName="menu">
<div styleName='root'>
<div styleName='content'>
<div styleName='menu'>
<IconButton>
<FontIcon className="material-icons">menu</FontIcon>
<FontIcon className='material-icons'>menu</FontIcon>
</IconButton>
</div>
<List>
<ListItem styleName="item" style={styles.drawer.itemActive.style} primaryText="Dashboard" leftIcon={
<FontIcon style={styles.drawer.itemActive.iconStyle} className='material-icons'>dashboard</FontIcon>
} />
<ListItem styleName="item" style={styles.drawer.item.style} primaryText="Wallet" leftIcon={
<FontIcon style={styles.drawer.item.iconStyle} className='material-icons'>account_balance_wallet</FontIcon>
} />
<ListItem styleName="item" style={styles.drawer.item.style} primaryText="Exchange" leftIcon={
<FontIcon style={styles.drawer.item.iconStyle} className='material-icons'>compare_arrows</FontIcon>
} />
<ListItem styleName="item" style={styles.drawer.item.style} primaryText="History" leftIcon={
<FontIcon style={styles.drawer.item.iconStyle} className='material-icons'>history</FontIcon>
} />
<ListItem styleName="item" style={styles.drawer.item.style} primaryText="Rewards" leftIcon={
<FontIcon style={styles.drawer.item.iconStyle} className='material-icons'>attach_money</FontIcon>
} />
<ListItem styleName="item" style={styles.drawer.item.style} primaryText="Voting" leftIcon={
<FontIcon style={styles.drawer.item.iconStyle} className='material-icons'>record_voice_over</FontIcon>
} />
{this.menu.map(item => (
<ListItem
key={item.key}
styleName='item'
style={styles.drawer.item.style}
primaryText={item.title}
leftIcon={
<FontIcon
style={styles.drawer.item.iconStyle}
className='material-icons'>{item.icon}</FontIcon>
}
containerElement={
<Link activeClassName={'drawer-item-active'} to={{pathname: item.path}} />
}
/>
))}
</List>
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/layouts/partials/DrawerPartial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.root {

@include position(absolute);
overflow: hidden;
overflow: visible;
box-shadow: $box-shadow-0;
z-index: 200;

Expand All @@ -29,8 +29,10 @@
}
}
}
}

&:hover {
overflow: visible;
:global {
.drawer-item-active {
color: $color-primary-0 !important;
}
}
7 changes: 5 additions & 2 deletions src/layouts/partials/FooterPartial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
background-image: $bg-gradient-0;

.row {

margin: 40px 80px;

display: flex;
flex-direction: row;
position: relative;

@media only screen and (max-width: $media-size-md) {
flex-direction: column;
margin: 25px;
}

.column {
position: relative;
flex: 1 1 auto;
Expand Down
Loading

0 comments on commit 8d5409a

Please sign in to comment.