Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vertical responsiveness of L breakpoint - Closes #170 #203

Merged
merged 5 commits into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/account/account.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
.peer {
font-size: 16px;
float: left;
margin: 50px 0px;
margin: 5vh 0px; /* stylelint-disable-line */
}

@media (--medium-viewport) {
Expand Down
1 change: 0 additions & 1 deletion src/components/app/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ body {
.bodyWrapper {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ or "warn/action" ineastd of "red/green"
--sidebar-width: 162px;
--sidebar-width-xl: 192px;
--main-box-width: 1291px;
--main-box-height: 788px;
--main-box-height: 75vh; /* stylelint-disable-line */
--border-radius-normal: 3px;
--m-menu-bar-height: 72px;
--s-menu-bar-height: 62px;
Expand Down
10 changes: 3 additions & 7 deletions src/components/box/box.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
@import '../app/variables.css';
@import './../app/variables.css';

.wrapper {
position: relative;
width: 100%;
height: var(--main-box-height);
display: flex;
box-sizing: border-box;
background: var(--color-white);
Expand All @@ -14,13 +13,10 @@
overflow: auto;
overflow-x: hidden;
margin: 0px;
height: var(--main-box-height);

& footer {
position: absolute;
bottom: 0;
right: 0;
left: 0;
padding: 50px 30px 20px;
padding: 50px 0px;
text-align: center;

& :global .subTitle {
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
}

.wrapper {
padding: 8px;
padding: 0px 8px;
float: right;
margin: 50px 0px;
margin: 5vh 0px; /* stylelint-disable-line */
}

.logoWrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/components/mainMenu/mainMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
box-shadow: none;
width: 100% !important;
border: none !important;
padding: 25px 10px !important;
padding: 20px 10px !important;
}

.navigationContainer {
Expand Down
3 changes: 2 additions & 1 deletion src/components/send/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class Send extends React.Component {
onClick={this.setSendIsActive.bind(this, false)}>
{t('Close')} <FontIcon value='close' />
</span>
<MultiStep finalCallback={this.setSendIsActive.bind(this, false)}>
<MultiStep finalCallback={this.setSendIsActive.bind(this, false)}
className={styles.wrapper}>
<SendWritable autoFocus={this.state.sendIsActive || window.innerWidth > 1024}/>
<SendReadable />
<ResultBox />
Expand Down
6 changes: 6 additions & 0 deletions src/components/send/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@
font-size: 18px;
}
}

.wrapper {
display: flex;
height: 100%;
justify-content: space-between;
}
10 changes: 10 additions & 0 deletions src/components/sendReadable/send.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
--tab-inactive-color: --color-grayscale-dark;
}

.wrapper {
padding: 0px 30px 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 100%;
overflow-y: hidden;
box-sizing: border-box;
}

.fee {
text-align: right;
margin-top: -12px;
Expand Down
49 changes: 25 additions & 24 deletions src/components/sendReadable/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SendReadable extends React.Component {

render() {
return (
<div className='boxPadding send'>
<div className={`${styles.wrapper} send`}>
<div className={styles.header}>
<header className={styles.headerWrapper}>
<h2>{this.props.t('Confirm transfer')}</h2>
Expand All @@ -105,7 +105,7 @@ class SendReadable extends React.Component {
<AccountVisual address={this.state.recipient.value} size={60} />
</figure>
</div>
<form onSubmit={this.send.bind(this)}>
<form>
<Input label={this.props.t('Send to Address')}
className={`recipient ${styles.disabledInput}`}
value={this.props.recipient}
Expand All @@ -127,29 +127,30 @@ class SendReadable extends React.Component {
theme={inputStyles}
columns={{ xs: 6, sm: 4, md: 4 }}
/>
<footer>
<section className={grid.row} >
<div className={grid['col-xs-4']}>
<Button
label={this.props.t('Back')}
onClick={() => this.props.prevStep()}
type='button'
theme={styles}
/>
</div>
<div className={grid['col-xs-8']}>
<PrimaryButton
className='send-button'
label={this.props.t('Send')}
type='submit'
theme={styles}
disabled={!authStateIsValid(this.state) || this.state.loading}
/>
<div className='subTitle'>{this.props.t('Transactions can’t be reversed')}</div>
</div>
</section>
</footer>
</form>
<footer>
<section className={grid.row} >
<div className={grid['col-xs-4']}>
<Button
label={this.props.t('Back')}
onClick={() => this.props.prevStep()}
type='button'
theme={styles}
/>
</div>
<div className={grid['col-xs-8']}>
<PrimaryButton
className='send-button'
label={this.props.t('Send')}
type='submit'
theme={styles}
onClick={this.send.bind(this)}
disabled={!authStateIsValid(this.state) || this.state.loading}
/>
<div className='subTitle'>{this.props.t('Transactions can’t be reversed')}</div>
</div>
</section>
</footer>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sendReadable/send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Send Readable Component', () => {
it('allows to send a transaction', () => {
wrapper.find('.amount input').simulate('change', { target: { value: '120.25' } });
wrapper.find('.recipient input').simulate('change', { target: { value: '11004588490103196952L' } });
wrapper.find('.send-button button').simulate('submit');
wrapper.find('.send-button button').simulate('click');
expect(props.sent).to.have.been.calledWith({
account: props.account,
activePeer: {},
Expand Down
9 changes: 7 additions & 2 deletions src/components/sendWritable/send.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ input:read-only {
}
}

.header {
height: 300px;
.sendWrapper {
display: flex;
flex-flow: column wrap;
justify-content: space-between;
width: 100%;
height: 100%;
box-sizing: border-box;
}

@media (--small-viewport) {
Expand Down
29 changes: 14 additions & 15 deletions src/components/sendWritable/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SendWritable extends React.Component {

render() {
return (
<div className='boxPadding'>
<div className={`${styles.sendWrapper} boxPadding`}>
<div className={styles.header}>
<header className={styles.headerWrapper}>
<h2>Transfer</h2>
Expand Down Expand Up @@ -103,21 +103,20 @@ class SendWritable extends React.Component {
theme={styles}
onChange={this.handleChange.bind(this, 'amount')} />
<div className={styles.fee}> {this.props.t('Fee: {{fee}} LSK', { fee: fromRawLsk(this.fee) })} </div>

<footer>
<Button onClick={() => this.props.nextStep({
recipient: this.state.recipient.value,
amount: this.state.amount.value,
})}
disabled={(!!this.state.recipient.error ||
!this.state.recipient.value ||
!!this.state.amount.error ||
!this.state.amount.value)}
className={`send-next-button ${styles.nextButton}`}
>{this.props.t('Next')}</Button>
<div className='subTitle'>{this.props.t('Confirmation in the next step.')}</div>
</footer>
</form>
<footer>
<Button onClick={() => this.props.nextStep({
recipient: this.state.recipient.value,
amount: this.state.amount.value,
})}
disabled={(!!this.state.recipient.error ||
!this.state.recipient.value ||
!!this.state.amount.error ||
!this.state.amount.value)}
className={`send-next-button ${styles.nextButton}`}
>{this.props.t('Next')}</Button>
<div className='subTitle'>{this.props.t('Confirmation in the next step.')}</div>
</footer>
</div>
);
}
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/forging.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Forging page
Given I'm logged in as "delegate"
When I click "forging" menu
Then I should see forging center
And I should see table with 20 lines
And I scroll to the bottom of "forging"
And I should see table with 40 lines
And I scroll to the bottom of "forging"
And I should see table with 60 lines

10 changes: 5 additions & 5 deletions test/integration/wallet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('@integration: Wallet', () => {
step('And I click "send next button"', clickStep.bind(null, 'send next button'));
step('When I click "send button"', () => {
requestToActivePeerStub.withArgs(match.any, 'transactions', match.any).returnsPromise().rejects({});
wrapper.find('form').simulate('submit');
wrapper.find('.send-button button').simulate('click');
});
step(`Then I should see text ${errorMessage} in "result box message" element`, shouldContainMessage.bind(this, 'result box message', errorMessage));
});
Expand All @@ -121,7 +121,7 @@ describe('@integration: Wallet', () => {
step('And I fill in "1" to "amount" field', fillInputField.bind(null, '1', 'amount'));
step('And I fill in "537318935439898807L" to "recipient" field', fillInputField.bind(null, '537318935439898807L', 'recipient'));
step('And I click "send next button"', clickStep.bind(null, 'send next button'));
step('When I click "send button"', () => { wrapper.find('form').simulate('submit'); });
step('When I click "send button"', () => { wrapper.find('.send-button button').simulate('click'); });
step(`Then I should see text ${successMessage} in "result box message" element`, shouldContainMessage.bind(this, 'result box message', successMessage));
});

Expand All @@ -132,7 +132,7 @@ describe('@integration: Wallet', () => {
step('And I fill in "537318935439898807L" to "recipient" field', fillInputField.bind(null, '537318935439898807L', 'recipient'));
step('And I click "send next button"', clickStep.bind(null, 'send next button'));
step('And I fill in passphrase of "genesis" to "passphrase" field', fillInputField.bind(null, passphrase, 'passphrase'));
step('When I click "send button"', () => { wrapper.find('form').simulate('submit'); });
step('When I click "send button"', () => { wrapper.find('.send-button button').simulate('click'); });
step(`Then I should see text ${successMessage} in "result box message" element`, shouldContainMessage.bind(this, 'result box message', successMessage));
});

Expand All @@ -143,7 +143,7 @@ describe('@integration: Wallet', () => {
step('And I fill in "537318935439898807L" to "recipient" field', fillInputField.bind(null, '537318935439898807L', 'recipient'));
step('And I click "send next button"', clickStep.bind(null, 'send next button'));
step('And I fill in second passphrase of "second passphrase account" to "second passphrase" field', fillInputField.bind(null, secondPassphrase, 'second-passphrase'));
step('When I click "send button"', () => { wrapper.find('form').simulate('submit'); });
step('When I click "send button"', () => { wrapper.find('.send-button button').simulate('click'); });
step(`Then I should see text ${successMessage} in "result box message" element`, shouldContainMessage.bind(this, 'result box message', successMessage));
});

Expand All @@ -155,7 +155,7 @@ describe('@integration: Wallet', () => {
step('And I click "send next button"', clickStep.bind(null, 'send next button'));
step('And I fill in passphrase of "second passphrase account" to "passphrase" field', fillInputField.bind(null, passphrase, 'passphrase'));
step('And I fill in second passphrase of "second passphrase account" to "second passphrase" field', fillInputField.bind(null, secondPassphrase, 'second-passphrase'));
step('When I click "send button"', () => { wrapper.find('form').simulate('submit'); });
step('When I click "send button"', () => { wrapper.find('.send-button button').simulate('click'); });
step(`Then I should see text ${successMessage} in "result box message" element`, shouldContainMessage.bind(this, 'result box message', successMessage));
});
});
Expand Down