From bc922deb23a72d6ca1bf4c39efd1d7366baa9a84 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 17:39:09 -0200 Subject: [#922] Refactoring react folder structure with @anikarni --- web-ui/src/account_recovery/account_recovery.html | 12 ++ web-ui/src/account_recovery/account_recovery.js | 18 +++ web-ui/src/account_recovery/page.js | 28 ++++ web-ui/src/account_recovery/page.scss | 176 ++++++++++++++++++++++ web-ui/src/i18n.js | 39 +++++ 5 files changed, 273 insertions(+) create mode 100644 web-ui/src/account_recovery/account_recovery.html create mode 100644 web-ui/src/account_recovery/account_recovery.js create mode 100644 web-ui/src/account_recovery/page.js create mode 100644 web-ui/src/account_recovery/page.scss create mode 100644 web-ui/src/i18n.js (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/account_recovery.html b/web-ui/src/account_recovery/account_recovery.html new file mode 100644 index 00000000..bd451ebc --- /dev/null +++ b/web-ui/src/account_recovery/account_recovery.html @@ -0,0 +1,12 @@ + + + + + + Pixelated Account Recovery + + +
+ + + diff --git a/web-ui/src/account_recovery/account_recovery.js b/web-ui/src/account_recovery/account_recovery.js new file mode 100644 index 00000000..f2421bfc --- /dev/null +++ b/web-ui/src/account_recovery/account_recovery.js @@ -0,0 +1,18 @@ +import React from 'react' +import { render } from 'react-dom' +import a11y from 'react-a11y' +import { I18nextProvider } from 'react-i18next' + +import Page from './page' +import i18n from '../i18n' + +import 'font-awesome/scss/font-awesome.scss' + +if(process.env.NODE_ENV === 'development') a11y(React); + +render( + + + , + document.getElementById('root') +); diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js new file mode 100644 index 00000000..a02d307c --- /dev/null +++ b/web-ui/src/account_recovery/page.js @@ -0,0 +1,28 @@ +import React from 'react' +import { translate } from 'react-i18next' + +import './page.scss' + +export const Page = ({ t }) => ( +
+ {t('backup-account.image-description')}/ +
+

{t('backup-account.title')}

+

{t('backup-account.paragraph1')}

+

{t('backup-account.paragraph2')}

+
+ + +
+ +
+ + + {t('back-to-inbox')} + +
+
+
+) + +export default translate('', { wait: true })(Page) diff --git a/web-ui/src/account_recovery/page.scss b/web-ui/src/account_recovery/page.scss new file mode 100644 index 00000000..e7b1504e --- /dev/null +++ b/web-ui/src/account_recovery/page.scss @@ -0,0 +1,176 @@ +@import "~scss/vendor/reset"; +@import "~scss/base/colors"; +@import "~scss/base/fonts"; + +html { + min-height: 100%; +} + +body { + font-family: "Open Sans", "Microsoft YaHei", "Hiragino Sans GB", "Hiragino Sans GB W3", "微软雅黑", "Helvetica Neue", Arial, sans-serif; + background: $dark_blue; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(left top, $dark_blue, $middle_blue); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(bottom right, $dark_blue, $middle_blue); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(bottom right, $dark_blue, $middle_blue); /* For Firefox 3.6 to 15 */ + background: linear-gradient(to bottom right, $dark_blue, $middle_blue); /* Standard syntax */ + color: $dark_grey_text; + min-height: 100%; +} + +h1 { + font-size: 1.3em; + font-weight: 600; +} + +p { + -webkit-margin-before: 0.5em; + -webkit-margin-after: 0.5em; + margin-before: 0.5em; + margin-after: 0.5em; +} + +a { + text-decoration: none; + color: $dark_blue; + font-style: italic; + + .fa { + font-size: 1.6em; + position: relative; + top: 3px; + margin-right: 0.3em; + } + +} + +.field-group { + position:relative; + margin: 1.5em 0; + width: 100%; + + label { + font-size: 0.9em; + margin-bottom: 10px; + display: inline-block; + } + + input { + display: block; + border: none; + border-bottom: solid 1px #4da3b6; + width: 100%; + height: auto; + padding: 0.3em 0px; + } + + input:focus { + outline:none; + border-width: 2px; + } + + input:focus ~ .animated-label, input:valid ~ .animated-label { + top:-12px; + left: 0; + font-size:0.7em; + color:#4da3b6; + } + + .animated-label { + color:#999; + position:absolute; + pointer-events:none; + left: 6px; + top:10px; + transition:0.2s ease all; + -moz-transition:0.2s ease all; + -webkit-transition:0.2s ease all; + } +} + + +button { + background: $dark_blue; + padding: 0.8em; + color: $white; + text-align: center; + border: none; + border-radius: 2px; + font-weight: 300; + width: 100%; + margin-bottom: 1em; +} + +.container { + background: $white; + width: 84%; + // margin: 3% auto; + padding: 6% 5%; + + -webkit-display: flex; + display: flex; + -webkit-align-items: flex-start; + align-items: flex-start; + -webkit-flex-direction: column; + flex-direction: column; +} + +img { + width: 50%; + -webkit-align-self: center; + align-self: center; +} + +@media only screen and (min-width : 500px) { + body { + font-size: 1.3em; + } + + form { + display: flex; + -webkit-display: flex; + -webkit-flex-direction: column; + flex-direction: column; + + .field-group, button, div { + flex-basis: 70%; + -webkit-align-self: center; + align-self: center; + } + } +} + +@media only screen and (min-width : 960px) { + .container{ + width: 60%; + padding: 3%; + -webkit-align-items: flex-start; + align-items: flex-start; + -webkit-flex-direction: row; + flex-direction: row; + max-width: 700px; + } + + form { + margin-left: 2.5em; + + .field-group, button, div { + width: 300px; + -webkit-align-self: flex-start; + align-self: flex-start; + } + + .field-group { + margin-top: 3em; + font-size: 1em; + } + } + + img { + width: 300px; + } + + button { + font-size: 0.8em; + margin-bottom: 1em; + } +} diff --git a/web-ui/src/i18n.js b/web-ui/src/i18n.js new file mode 100644 index 00000000..9c6ad550 --- /dev/null +++ b/web-ui/src/i18n.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ +import i18n from 'i18next' +import i18nBackend from 'i18nextXHRBackend' +import i18nDetector from 'i18nextBrowserLanguageDetector' + +const detector = new i18nDetector(); +const detect = detector.detect.bind(detector); + +detector.detect = function(detectionOrder) { + let result = detect(detectionOrder); + return result.replace('-', '_'); +}; + +i18n + .use(i18nBackend) + .use(detector) + .init({ + fallbackLng: 'en_US', + backend: { + loadPath: 'assets/locales/{{lng}}/{{ns}}.json' + } + }); + +export default i18n; -- cgit v1.2.3 From 1204842f3eb792b6f12445edf1a79532493a3d55 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 17:47:49 -0200 Subject: [#922] Add copyright with @anikarni --- web-ui/src/account_recovery/account_recovery.js | 17 +++++++++++++++++ web-ui/src/account_recovery/page.js | 17 +++++++++++++++++ web-ui/src/account_recovery/page.scss | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/account_recovery.js b/web-ui/src/account_recovery/account_recovery.js index f2421bfc..6c12e326 100644 --- a/web-ui/src/account_recovery/account_recovery.js +++ b/web-ui/src/account_recovery/account_recovery.js @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + import React from 'react' import { render } from 'react-dom' import a11y from 'react-a11y' diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js index a02d307c..79eca8a7 100644 --- a/web-ui/src/account_recovery/page.js +++ b/web-ui/src/account_recovery/page.js @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + import React from 'react' import { translate } from 'react-i18next' diff --git a/web-ui/src/account_recovery/page.scss b/web-ui/src/account_recovery/page.scss index e7b1504e..6cd8c5aa 100644 --- a/web-ui/src/account_recovery/page.scss +++ b/web-ui/src/account_recovery/page.scss @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + @import "~scss/vendor/reset"; @import "~scss/base/colors"; @import "~scss/base/fonts"; -- cgit v1.2.3 From a47f32a7b0728c402787ebe914a0953638734820 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 18:09:20 -0200 Subject: [#922] Extract the submit button to a component with @anikarni --- web-ui/src/account_recovery/page.js | 7 ++--- web-ui/src/account_recovery/page.scss | 24 +++--------------- web-ui/src/common/submit-button.scss | 48 +++++++++++++++++++++++++++++++++++ web-ui/src/common/submit_button.js | 26 +++++++++++++++++++ 4 files changed, 81 insertions(+), 24 deletions(-) create mode 100644 web-ui/src/common/submit-button.scss create mode 100644 web-ui/src/common/submit_button.js (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js index 79eca8a7..90a1faa4 100644 --- a/web-ui/src/account_recovery/page.js +++ b/web-ui/src/account_recovery/page.js @@ -17,21 +17,22 @@ import React from 'react' import { translate } from 'react-i18next' +import SubmitButton from 'src/common/submit_button' import './page.scss' export const Page = ({ t }) => (
- {t('backup-account.image-description')}/ + {t('backup-account.image-description')}

{t('backup-account.title')}

{t('backup-account.paragraph1')}

{t('backup-account.paragraph2')}

- +
- +
diff --git a/web-ui/src/account_recovery/page.scss b/web-ui/src/account_recovery/page.scss index 6cd8c5aa..2ddb366c 100644 --- a/web-ui/src/account_recovery/page.scss +++ b/web-ui/src/account_recovery/page.scss @@ -104,23 +104,10 @@ a { } } - -button { - background: $dark_blue; - padding: 0.8em; - color: $white; - text-align: center; - border: none; - border-radius: 2px; - font-weight: 300; - width: 100%; - margin-bottom: 1em; -} - .container { background: $white; width: 84%; - // margin: 3% auto; + margin: 3% auto; padding: 6% 5%; -webkit-display: flex; @@ -148,7 +135,7 @@ img { -webkit-flex-direction: column; flex-direction: column; - .field-group, button, div { + .field-group, div { flex-basis: 70%; -webkit-align-self: center; align-self: center; @@ -170,7 +157,7 @@ img { form { margin-left: 2.5em; - .field-group, button, div { + .field-group, div { width: 300px; -webkit-align-self: flex-start; align-self: flex-start; @@ -185,9 +172,4 @@ img { img { width: 300px; } - - button { - font-size: 0.8em; - margin-bottom: 1em; - } } diff --git a/web-ui/src/common/submit-button.scss b/web-ui/src/common/submit-button.scss new file mode 100644 index 00000000..86a24e5a --- /dev/null +++ b/web-ui/src/common/submit-button.scss @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +@import "~scss/base/colors"; + +.submit-button { + background: $dark_blue; + padding: 0.8em; + color: $white; + text-align: center; + border: none; + border-radius: 2px; + font-weight: 300; + width: 100%; + margin-bottom: 1em; +} + +@media only screen and (min-width : 500px) { + .submit-button { + flex-basis: 70%; + -webkit-align-self: center; + align-self: center; + } +} + +@media only screen and (min-width : 960px) { + .submit-button { + width: 300px; + -webkit-align-self: flex-start; + align-self: flex-start; + font-size: 0.8em; + margin-bottom: 1em; + } +} diff --git a/web-ui/src/common/submit_button.js b/web-ui/src/common/submit_button.js new file mode 100644 index 00000000..89cfc55b --- /dev/null +++ b/web-ui/src/common/submit_button.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +import React from 'react' + +import './submit-button.scss' + +const SubmitButton = ({ buttonText }) => ( + +) + +export default SubmitButton -- cgit v1.2.3 From 31b0bcaa673794024a71065be76681150ad4b9d6 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 18:51:08 -0200 Subject: [#922] Extract input field to a component with @anikarni --- web-ui/src/account_recovery/page.js | 8 +-- web-ui/src/account_recovery/page.scss | 53 +-------------- web-ui/src/common/input_field/input-field.scss | 77 ++++++++++++++++++++++ web-ui/src/common/input_field/input_field.js | 29 ++++++++ web-ui/src/common/submit-button.scss | 48 -------------- web-ui/src/common/submit_button.js | 26 -------- web-ui/src/common/submit_button/submit-button.scss | 48 ++++++++++++++ web-ui/src/common/submit_button/submit_button.js | 26 ++++++++ 8 files changed, 185 insertions(+), 130 deletions(-) create mode 100644 web-ui/src/common/input_field/input-field.scss create mode 100644 web-ui/src/common/input_field/input_field.js delete mode 100644 web-ui/src/common/submit-button.scss delete mode 100644 web-ui/src/common/submit_button.js create mode 100644 web-ui/src/common/submit_button/submit-button.scss create mode 100644 web-ui/src/common/submit_button/submit_button.js (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js index 90a1faa4..d1bcb464 100644 --- a/web-ui/src/account_recovery/page.js +++ b/web-ui/src/account_recovery/page.js @@ -17,7 +17,8 @@ import React from 'react' import { translate } from 'react-i18next' -import SubmitButton from 'src/common/submit_button' +import SubmitButton from 'src/common/submit_button/submit_button' +import InputField from 'src/common/input_field/input_field' import './page.scss' @@ -28,10 +29,7 @@ export const Page = ({ t }) => (

{t('backup-account.title')}

{t('backup-account.paragraph1')}

{t('backup-account.paragraph2')}

-
- - -
+
diff --git a/web-ui/src/account_recovery/page.scss b/web-ui/src/account_recovery/page.scss index 2ddb366c..c23fe569 100644 --- a/web-ui/src/account_recovery/page.scss +++ b/web-ui/src/account_recovery/page.scss @@ -60,50 +60,6 @@ a { } -.field-group { - position:relative; - margin: 1.5em 0; - width: 100%; - - label { - font-size: 0.9em; - margin-bottom: 10px; - display: inline-block; - } - - input { - display: block; - border: none; - border-bottom: solid 1px #4da3b6; - width: 100%; - height: auto; - padding: 0.3em 0px; - } - - input:focus { - outline:none; - border-width: 2px; - } - - input:focus ~ .animated-label, input:valid ~ .animated-label { - top:-12px; - left: 0; - font-size:0.7em; - color:#4da3b6; - } - - .animated-label { - color:#999; - position:absolute; - pointer-events:none; - left: 6px; - top:10px; - transition:0.2s ease all; - -moz-transition:0.2s ease all; - -webkit-transition:0.2s ease all; - } -} - .container { background: $white; width: 84%; @@ -135,7 +91,7 @@ img { -webkit-flex-direction: column; flex-direction: column; - .field-group, div { + div { flex-basis: 70%; -webkit-align-self: center; align-self: center; @@ -157,16 +113,11 @@ img { form { margin-left: 2.5em; - .field-group, div { + div { width: 300px; -webkit-align-self: flex-start; align-self: flex-start; } - - .field-group { - margin-top: 3em; - font-size: 1em; - } } img { diff --git a/web-ui/src/common/input_field/input-field.scss b/web-ui/src/common/input_field/input-field.scss new file mode 100644 index 00000000..ad5dda13 --- /dev/null +++ b/web-ui/src/common/input_field/input-field.scss @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +@import "~scss/base/colors"; + +.input-field-group { + position:relative; + margin: 1.5em 0; + width: 100%; +} + +.input-field-label { + font-size: 0.9em; + margin-bottom: 10px; + display: inline-block; + color:#999; + position:absolute; + pointer-events:none; + left: 6px; + top:10px; + transition:0.2s ease all; + -moz-transition:0.2s ease all; + -webkit-transition:0.2s ease all; +} + +.input-field { + display: block; + border: none; + border-bottom: solid 1px $dark_blue; + width: 100%; + height: auto; + padding: 0.3em 0px; + + &:focus { + outline:none; + border-width: 2px; + } +} + +.input-field:focus ~ .input-field-label, .input-field:valid ~ .input-field-label { + top:-12px; + left: 0; + font-size:0.7em; + color: $dark_blue; +} + +@media only screen and (min-width : 500px) { + .input-field-group { + flex-basis: 70%; + -webkit-align-self: center; + align-self: center; + } +} + +@media only screen and (min-width : 960px) { + .input-field-group { + width: 300px; + -webkit-align-self: flex-start; + align-self: flex-start; + margin-top: 3em; + font-size: 1em; + } +} diff --git a/web-ui/src/common/input_field/input_field.js b/web-ui/src/common/input_field/input_field.js new file mode 100644 index 00000000..43899419 --- /dev/null +++ b/web-ui/src/common/input_field/input_field.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +import React from 'react' + +import './input-field.scss' + +const InputField = ({ label, name }) => ( +
+ + +
+) + +export default InputField diff --git a/web-ui/src/common/submit-button.scss b/web-ui/src/common/submit-button.scss deleted file mode 100644 index 86a24e5a..00000000 --- a/web-ui/src/common/submit-button.scss +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017 ThoughtWorks, Inc. - * - * Pixelated is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Pixelated is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Pixelated. If not, see . - */ - -@import "~scss/base/colors"; - -.submit-button { - background: $dark_blue; - padding: 0.8em; - color: $white; - text-align: center; - border: none; - border-radius: 2px; - font-weight: 300; - width: 100%; - margin-bottom: 1em; -} - -@media only screen and (min-width : 500px) { - .submit-button { - flex-basis: 70%; - -webkit-align-self: center; - align-self: center; - } -} - -@media only screen and (min-width : 960px) { - .submit-button { - width: 300px; - -webkit-align-self: flex-start; - align-self: flex-start; - font-size: 0.8em; - margin-bottom: 1em; - } -} diff --git a/web-ui/src/common/submit_button.js b/web-ui/src/common/submit_button.js deleted file mode 100644 index 89cfc55b..00000000 --- a/web-ui/src/common/submit_button.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017 ThoughtWorks, Inc. - * - * Pixelated is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Pixelated is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Pixelated. If not, see . - */ - -import React from 'react' - -import './submit-button.scss' - -const SubmitButton = ({ buttonText }) => ( - -) - -export default SubmitButton diff --git a/web-ui/src/common/submit_button/submit-button.scss b/web-ui/src/common/submit_button/submit-button.scss new file mode 100644 index 00000000..86a24e5a --- /dev/null +++ b/web-ui/src/common/submit_button/submit-button.scss @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +@import "~scss/base/colors"; + +.submit-button { + background: $dark_blue; + padding: 0.8em; + color: $white; + text-align: center; + border: none; + border-radius: 2px; + font-weight: 300; + width: 100%; + margin-bottom: 1em; +} + +@media only screen and (min-width : 500px) { + .submit-button { + flex-basis: 70%; + -webkit-align-self: center; + align-self: center; + } +} + +@media only screen and (min-width : 960px) { + .submit-button { + width: 300px; + -webkit-align-self: flex-start; + align-self: flex-start; + font-size: 0.8em; + margin-bottom: 1em; + } +} diff --git a/web-ui/src/common/submit_button/submit_button.js b/web-ui/src/common/submit_button/submit_button.js new file mode 100644 index 00000000..89cfc55b --- /dev/null +++ b/web-ui/src/common/submit_button/submit_button.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017 ThoughtWorks, Inc. + * + * Pixelated is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pixelated is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pixelated. If not, see . + */ + +import React from 'react' + +import './submit-button.scss' + +const SubmitButton = ({ buttonText }) => ( + +) + +export default SubmitButton -- cgit v1.2.3 From aa26a47abac48d817a04a4f2375f1378767fa83c Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Tue, 7 Feb 2017 19:02:47 -0200 Subject: [#922] Fix button and input width with @anikarni --- web-ui/src/account_recovery/page.scss | 2 +- web-ui/src/common/input_field/input-field.scss | 2 +- web-ui/src/common/submit_button/submit-button.scss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/page.scss b/web-ui/src/account_recovery/page.scss index c23fe569..c928d815 100644 --- a/web-ui/src/account_recovery/page.scss +++ b/web-ui/src/account_recovery/page.scss @@ -92,7 +92,7 @@ img { flex-direction: column; div { - flex-basis: 70%; + width: 70%; -webkit-align-self: center; align-self: center; } diff --git a/web-ui/src/common/input_field/input-field.scss b/web-ui/src/common/input_field/input-field.scss index ad5dda13..6ec827ab 100644 --- a/web-ui/src/common/input_field/input-field.scss +++ b/web-ui/src/common/input_field/input-field.scss @@ -60,7 +60,7 @@ @media only screen and (min-width : 500px) { .input-field-group { - flex-basis: 70%; + width: 70%; -webkit-align-self: center; align-self: center; } diff --git a/web-ui/src/common/submit_button/submit-button.scss b/web-ui/src/common/submit_button/submit-button.scss index 86a24e5a..ccd0bef4 100644 --- a/web-ui/src/common/submit_button/submit-button.scss +++ b/web-ui/src/common/submit_button/submit-button.scss @@ -31,7 +31,7 @@ @media only screen and (min-width : 500px) { .submit-button { - flex-basis: 70%; + width: 70%; -webkit-align-self: center; align-self: center; } -- cgit v1.2.3 From 7f76c79319bf0817222fc88011fd870d97648963 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Tue, 7 Feb 2017 19:46:45 -0200 Subject: [#922] Adds eslint for react and es6 files --- web-ui/src/account_recovery/account_recovery.js | 14 +++++++------- web-ui/src/account_recovery/page.js | 8 ++++++-- web-ui/src/common/input_field/input_field.js | 5 +++++ web-ui/src/common/submit_button/submit_button.js | 4 ++++ web-ui/src/i18n.js | 18 +++++++++--------- 5 files changed, 31 insertions(+), 18 deletions(-) (limited to 'web-ui/src') diff --git a/web-ui/src/account_recovery/account_recovery.js b/web-ui/src/account_recovery/account_recovery.js index 6c12e326..eac14bf7 100644 --- a/web-ui/src/account_recovery/account_recovery.js +++ b/web-ui/src/account_recovery/account_recovery.js @@ -20,16 +20,16 @@ import { render } from 'react-dom' import a11y from 'react-a11y' import { I18nextProvider } from 'react-i18next' -import Page from './page' -import i18n from '../i18n' - import 'font-awesome/scss/font-awesome.scss' -if(process.env.NODE_ENV === 'development') a11y(React); +import PageWrapper from './page' +import i18n from '../i18n' + +if (process.env.NODE_ENV === 'development') a11y(React) render( - - + + , document.getElementById('root') -); +) diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js index d1bcb464..396788e7 100644 --- a/web-ui/src/account_recovery/page.js +++ b/web-ui/src/account_recovery/page.js @@ -32,8 +32,8 @@ export const Page = ({ t }) => (