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) Update Terms of Use page style #58

Merged
merged 4 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Current Master

- [#58](https://github.com/poanetwork/metamask-extension/pull/58): Update Terms of Use page style
- [#57](https://github.com/poanetwork/metamask-extension/pull/57): Optimized images for release.
- [#55](https://github.com/poanetwork/metamask-extension/pull/55): Tests fix.
- [#52](https://github.com/poanetwork/metamask-extension/pull/52): Nifty Wallet restyling.
Expand Down
124 changes: 71 additions & 53 deletions old-ui/app/components/notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,91 +15,109 @@ function Notice () {
Notice.prototype.render = function () {
const { notice, onConfirm } = this.props
const { title, body } = notice
const state = this.state || { disclaimerDisabled: true }
const state = this.state || { disclaimerDisabled: false }
const disabled = state.disclaimerDisabled

return (
h('.flex-column.flex-center.flex-grow', {
style: {
width: '100%',
fontFamily: 'Nunito SemiBold',
},
}, [
h('h3.flex-center.terms-header.section-title', {
style: {
background: '#ffffff',
color: '#333333',
width: '100%',
fontSize: '16px',
textAlign: 'center',
padding: 6,
marginBottom: 24,
},
}, [
title,
]),

h('style', `

.markdown {
overflow-x: hidden;
}

.markdown h1, .markdown h2, .markdown h3 {
margin: 10px 0;
font-weight: bold;
margin: 20px 0;
line-height: 18px;
font-weight: normal;
}

.markdown strong {
font-weight: bold;
font-weight: normal;
}
.markdown em {
font-style: italic;
}

.markdown p {
margin: 10px 0;
margin: 20px 0;
line-height: 18px;
font-weight: normal;
}

.markdown a {
color: #8fdc97;
}

`),
.markdown::-webkit-scrollbar {
width: 16px;
}

.markdown::-webkit-scrollbar-track {
background-color: transparent;
}

.markdown::-webkit-scrollbar-thumb {
background-color: #411a6a;
border-radius: 2px;
border: 6px solid transparent;
background-clip: content-box;
}

h('div.markdown', {
onScroll: (e) => {
var object = e.currentTarget
if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) {
this.setState({disclaimerDisabled: false})
}
},
style: {
background: '#ffffff',
height: '310px',
padding: '6px',
width: '90%',
overflowY: 'scroll',
scroll: 'auto',
borderRadius: '3px',
},
}, [
h(ReactMarkdown, {
className: 'notice-box',
source: body,
skipHtml: true,
}),
]),
`), [
h('h3.flex-center.terms-header', {
key: 'notice-key',
style: {
color: '#ffffff',
width: '100%',
fontSize: '16px',
textAlign: 'center',
margin: '20px 0px',
},
}, [
title,
]),
h('div.markdown', {
onScroll: (e) => {
var object = e.currentTarget
if (object.offsetHeight + object.scrollTop + 100 >= object.scrollHeight) {
this.setState({disclaimerDisabled: false})
}
},
style: {
background: '#542289',
color: '#ffffff',
height: '310px',
width: '90%',
overflowY: 'scroll',
scroll: 'auto',
borderRadius: '3px',
fontSize: '14px',
},
}, [
h(ReactMarkdown, {
className: 'notice-box',
source: body,
skipHtml: true,
}),
]),

h('button', {
disabled,
onClick: () => {
this.setState({disclaimerDisabled: true})
onConfirm()
},
style: {
marginTop: '18px',
},
}, 'Accept'),
h('button', {
disabled,
onClick: () => {
this.setState({disclaimerDisabled: true})
onConfirm()
},
style: {
marginTop: '18px',
},
}, 'Accept'),
],
])
)
}
Expand Down
4 changes: 4 additions & 0 deletions old-ui/app/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ button.btn-thin {
background: #ffffff;
}

.notice-box {
margin: 20px;
}

h2.page-subtitle {
font-family: 'Nunito Regular';
color: #333333;
Expand Down