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: ui of page show winnner #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion src/actions/tomoAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,13 @@ export const getAliasBalance = () => async (dispatch, getState) => {
if (aliasBalance.includes('.')) {
let interger = aliasBalance.split('.', 2)[0];
let fractional = aliasBalance.split('.', 2)[1].substr(0, 4);
aliasBalance = interger.concat('.', fractional, ' ');
if (interger === '0' && fractional === '0000') {
aliasBalance = '0 ';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dấu cách sau số 0 để làm gì vậy bạn?

} else if (fractional === '0000') {
aliasBalance = interger + ' ';
} else {
aliasBalance = interger.concat('.', fractional, ' ');
}
}

dispatch({
Expand Down
2 changes: 1 addition & 1 deletion src/component/ModalDeposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ModalDeposit extends React.Component {
</ModalBody>
</FormGroup>
<ModalFooter>
<Button color='primary' type='submit'>
<Button color='primary' type='submit' onClick={this.toggle}>
Send
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n

</Button>
<Button color='secondary' onClick={this.toggle}>
Expand Down
33 changes: 28 additions & 5 deletions src/component/PlayerLayout/PlayerLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ class PlayerLayout extends Component {
<Row className='set_height'>
<Col className='box_color' xs='12' md='8'>
<div className='margin_box '>
<span> The winner is youuuuu</span>
<br />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viết style đi, tạo khoảng cách như này thô quá! Mai cần cách đoạn nữa lạ thêm
vào à?

<p className='congrat'>Congratulation! You are winner</p>
<div>
<strong>Game Balance:</strong> {this.props.aliasBalance}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<img width='35' src='https://i.imgur.com/VZgib3M.png' alt='tomoCoin' />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K được viết inline style như này, cho vào file style khi cần sửa trong file
src cho vào config

</div>

<Button
color='none'
className='withdraw'
Expand All @@ -96,9 +102,9 @@ class PlayerLayout extends Component {
<ToastContainer position='top-center' autoClose={2000} />
<img
alt=''
src='https://media.giphy.com/media/2A0JSxcE0eQfrQrjAZ/giphy.gif'
className='gif-load'
width='60%'
src='https://media.giphy.com/media/fxsqOYnIMEefC/giphy.gif'
className='gif-congrat mt-3'
width='80%'
/>
</div>
</Col>
Expand All @@ -116,6 +122,22 @@ class PlayerLayout extends Component {
<Col className='box_color' xs='12' md='8'>
<div className='margin_box '>
<span> Waiting a new game...</span>
<div>
<strong>Game Balance:</strong> {this.props.aliasBalance}
<img width='35' src='https://i.imgur.com/VZgib3M.png' alt='tomoCoin' />
</div>

<Button
color='none'
className='withdraw'
onClick={(e) => {
this.getMoneyBack();
this.notifyInfo('Withdrawing...');
}}
>
Withdraw
</Button>
<ToastContainer position='top-center' autoClose={2000} />
<img
alt=''
src='https://media.giphy.com/media/2A0JSxcE0eQfrQrjAZ/giphy.gif'
Expand Down Expand Up @@ -196,7 +218,8 @@ const mapStatetoProps = (state) => {
ranking: state.tomo.ranking,
wincount: state.tomo.winCount,
questionCount: state.tomo.questionCount,
tomo: state.tomo
tomo: state.tomo,
aliasBalance: state.tomo.aliasBalance
};
};

Expand Down
7 changes: 5 additions & 2 deletions src/component/PlayerLayout/QuesArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class QuesArea extends Component {

// auto scroll name='fixedScrol' when loading page
componentDidMount() {
Scroll.scroller.scrollTo('fixedScroll');
if (this.props.winCount < 10) {
Scroll.scroller.scrollTo('fixedScroll');
}
}

shouldComponentUpdate(nextProps) {
Expand Down Expand Up @@ -245,7 +247,8 @@ const mapStatetoProps = (state) => {
aliasBalance: state.tomo.aliasBalance,
aliasAddress: state.tomo.aliasAccount.address,
account: state.tomo.account,
questionCount: state.tomo.questionCount
questionCount: state.tomo.questionCount,
winCount: state.tomo.winCount
};
};

Expand Down
8 changes: 8 additions & 0 deletions src/style/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,11 @@ canvas {
.font-number-question {
font-weight: 600 !important;
}

.congrat {
background: linear-gradient(to left, violet, indigo, blue, green, orange, red);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bold;
font-size: 20px;
}
7 changes: 7 additions & 0 deletions src/style/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ button.answer_box:focus {
padding-right: 4%;
}

@media only screen and (min-width: 768px) {
.button-start,
.button-withdraw {
width: 14%;
}
}

@media only screen and (max-width: 700px) {
.switchSmall {
position: absolute;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nên chuyển indent sang 4 spaces cho đỡ đau mắt

Expand Down