55 | );
56 | }
57 | }
58 |
59 | const mapStateToProps = (state) => ({
60 | user: state.user,
61 | });
62 |
63 | export default connect(mapStateToProps)(ProfileEditPage);
64 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to this project
2 |
3 | **Firstly**, thank you getting involved!
4 |
5 | ## What should I know before I get started?
6 |
7 | ### Code of Conduct
8 |
9 | This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
10 | By participating, you are expected to uphold this code.
11 |
12 | Please report unacceptable behaviour to [github@opencredo.com](mailto:github@opencredo.com).
13 |
14 | ## How Can I Contribute?
15 |
16 | ### Pull Requests
17 |
18 | We :heart: pull requests.
19 |
20 | ### Reporting Bugs
21 |
22 | This section guides you through submitting a bug report. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behaviour :computer: :computer:, and find related reports :mag_right:.
23 |
24 | Before creating bug reports, please perform a search as you might find out that you don't need to create one.
25 |
26 |
27 | ### Before you commit
28 |
29 | Please make sure you do the following before committing code:
30 |
31 | * do a quick smoke-test to ensure the app appears to be functioning as expected
32 | * run `npm run build` – ensure no errors
33 |
34 |
35 | ## Style Guide
36 |
37 | We're mostly following [Airbnb's JavaScript style guide](https://github.com/airbnb/javascript), with a few overrides that you can check in our .eslintrc file. The lint task will catch most of these so be sure to run it (`npm run lint`) on your code.
38 |
39 |
40 | ### Code Conventions
41 |
42 | * We :heart: semicolons `;`
43 | * Commas last `,`
44 | * 2 spaces for indentation (no tabs)
45 | * Prefer single `'` over double `"` quotes.
46 | * Except in JSX. Use double quotes in JSX: ``
47 | * 100 character line length
48 | * Do not use underscore prefix for "private" methods.
49 | * In fact, you probably don't need private methods. Try to keep components small. Compose.
50 |
51 | ### Git commits
52 |
53 | * Use the present tense ("Add feature" not "Added feature")
54 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
55 | * Limit the first line to 72 characters or less
56 | * Reference issues and pull requests liberally ("Fix #17")
57 |
58 |
--------------------------------------------------------------------------------
/EDITORS.md:
--------------------------------------------------------------------------------
1 | # Configuring your editor or IDE
2 |
3 | If you're new to React, most editors come with built in support for JavaScript
4 | (and ES2015), but you might need to configure your editor in order to get better
5 | JSX and Flowtype support. Here's a list of recommended packages:
6 |
7 | ## Atom
8 |
9 | * [language-babel](https://atom.io/packages/language-babel): Language plugin for
10 | ES201x, JSX, and Flowtype. This does not support reporting Flow errors; it simply
11 | provides correct syntax highlighting.
12 | * [linter-flow](https://atom.io/packages/linter-flow): Reports flow errors.
13 | * [linter-eslint](https://atom.io/packages/linter-eslint): Reports linting errors.
14 | * [editorconfig](https://atom.io/packages/editorconfig): Adds support for
15 | `.editorconfig` project files.
16 |
17 | As an alternative, [Nuclide](http://nuclide.io) is an Atom package that comes
18 | with built in support for Flow and JSX, but it can be used in conjunction with
19 | the recommended packages above.
20 |
21 | ## Sublime Text 3
22 |
23 | * [babel-sublime](https://packagecontrol.io/packages/Babel)
24 | * [SublimeLinter-flow](https://packagecontrol.io/packages/SublimeLinter-flow)
25 | * [SublimeLinter-contrib-eslint](https://packagecontrol.io/packages/SublimeLinter-contrib-eslint)
26 | * [EditorConfig](https://packagecontrol.io/packages/EditorConfig)
27 |
28 | ## Vim
29 | * [vim-flow](https://github.com/flowtype/vim-flow)
30 | * [vim-jsx](https://github.com/mxw/vim-jsx)
31 | * [syntastic](https://github.com/scrooloose/syntastic) will report linting errors.
32 | * [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim)
33 |
34 |
35 | ## WebStorm / IntelliJ
36 |
37 | The minimum versions required are:
38 |
39 | * WebStorm – version 11
40 | * Intellij – version 15
41 |
42 | Open the project's preferences:
43 |
44 | * Languages & Frameworks
45 | * JavaScript
46 | * **JavaScript language version**: _Flow_
47 | * Libraries
48 | * tick _ECMAScript 6_
49 | * tick _HTML_
50 | * tick _HTML5 / ECMAScript 5_
51 | * Code Quality Tools
52 | * ESLint
53 | * tick the **Enable** checkbox
54 | * **Node interpreter** – default value should be correct
55 | * **ESLint package** – ditto
56 | * **Configuration file** – _Search for .eslintrc_
57 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4 |
5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6 |
7 | Examples of unacceptable behavior by participants include:
8 |
9 | - The use of sexualized language or imagery
10 | - Personal attacks
11 | - Trolling or insulting/derogatory comments
12 | - Public or private harassment
13 | - Publishing other's private information, such as physical or electronic addresses, without explicit permission
14 | - Other unethical or unprofessional conduct
15 |
16 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
17 |
18 | By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
19 |
20 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
21 |
22 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [github@opencredo.com](mailto:github@opencredo.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
23 |
24 | This Code of Conduct is adapted from the Contributor Covenant, version 1.3.0, available from http://contributor-covenant.org/version/1/3/0/
25 |
--------------------------------------------------------------------------------
/src/translations/es.js:
--------------------------------------------------------------------------------
1 | // Spanish translations
2 | export default {
3 | 'aboutPage.title': 'Sobre Nosotros',
4 | 'aboutPage.overview': 'para traducir...',
5 | 'common.form.error.required': 'Este campo es obligatorio',
6 | 'common.form.error.email': 'Correo no válido',
7 | 'common.form.error.max': 'No puede ser más que {max}',
8 | 'common.form.error.maxLength': `No puede tener más de
9 | {maxLength, plural, one {1 carácter} other {{maxLength} caracteres}}`,
10 | 'common.form.error.min': 'Debe ser al menos {min}',
11 | 'common.form.error.minLength': `Debe tener al menos
12 | {minLength, plural, one {1 carácter} other {{minLength} caracteres}}`,
13 | 'landingPage.title': 'Inicio',
14 | 'landingPage.button.clickMe': 'Cliquéame (log)',
15 | 'landingPage.para.pressCtrlH': 'Presione ctrl-h para alternar el panel de Redux Dev Tools.',
16 | 'landingPage.para.autoUpdate': 'Esta página se actualiza automáticamente cuando haces cambios y guardas.',
17 | 'landingPage.para.es7Decorator': `Esta página también demuestra el uso del decorador
18 | @autobind.`,
19 | 'lang.en': 'English',
20 | 'lang.es': 'Español',
21 | 'navigation.aboutUs': 'Sobre Nosotros',
22 | 'navigation.account': 'Cuenta',
23 | 'navigation.faq': 'FAQ',
24 | 'navigation.help': 'Ayuda',
25 | 'navigation.home': 'Opencredo React Boilerplate',
26 | 'navigation.logIn': 'Iniciar Sesión',
27 | 'navigation.logOut': 'Terminar Sesión',
28 | 'navigation.policies': 'Normas',
29 | 'navigation.privacy': 'Privacidad',
30 | 'navigation.terms': 'Términos & Condiciones',
31 | 'profile.edit.title': 'Editar Perfil',
32 | 'profile.form.age.placeholder': 'Edad',
33 | 'profile.form.emailVerified.label': 'Correo verificado',
34 | 'profile.form.email.placeholder': 'correo',
35 | 'profile.form.familyName.placeholder': 'appellido',
36 | 'profile.form.gender.male.label': 'Masculino',
37 | 'profile.form.gender.female.label': 'Femenino',
38 | 'profile.form.givenName.placeholder': 'nombre',
39 | 'profile.form.locale.label': 'Idioma',
40 | 'profile.form.nickname.placeholder': 'nickname',
41 | 'profile.form.notes.label': 'Apuntes',
42 | 'profile.form.reset.label': 'Resetear',
43 | 'profile.form.save.label': 'Guardar',
44 | 'profile.message.updatingUserDetails': 'Actualizando detalles del usuario...',
45 | 'site.message.loggingIn': 'Iniciando sesión...',
46 | 'site.message.loggingOut': 'Terminando sesion...',
47 | 'site.name': 'Opencredo React Boilerplate',
48 | };
49 |
--------------------------------------------------------------------------------
/src/translations/en.js:
--------------------------------------------------------------------------------
1 | // English translations
2 | export default {
3 | 'aboutPage.title': 'About Us',
4 | 'aboutPage.overview': `Currently implemented as a stateless component,
5 | so will not auto-update when changes are made.`,
6 | 'common.form.error.required': 'This field is required',
7 | 'common.form.error.email': 'Email address is invalid',
8 | 'common.form.error.max': 'May not be greater than {max}',
9 | 'common.form.error.maxLength': `May not be more than
10 | {maxLength, plural, one {1 character} other {{maxLength} characters}} long`,
11 | 'common.form.error.min': 'Must be at least {min}',
12 | 'common.form.error.minLength': `Must be at least
13 | {minLength, plural, one {1 character} other {{minLength} characters}} long`,
14 | 'landingPage.title': 'Landing Page',
15 | 'landingPage.button.clickMe': 'Click me (log)',
16 | 'landingPage.para.pressCtrlH': 'Press ctrl-h to toggle Redux Dev Tools (development build only).',
17 | 'landingPage.para.autoUpdate': 'This pages auto-updates when you make changes and save.',
18 | 'landingPage.para.es7Decorator': `This page also demonstrates the use of the
19 | @autobind ES7 decorator.`,
20 | 'lang.en': 'English',
21 | 'lang.es': 'Español',
22 | 'navigation.aboutUs': 'About Us',
23 | 'navigation.account': 'Account',
24 | 'navigation.faq': 'FAQ',
25 | 'navigation.help': 'Help',
26 | 'navigation.home': 'Opencredo React Boilerplate',
27 | 'navigation.logIn': 'Log in',
28 | 'navigation.logOut': 'Log out',
29 | 'navigation.policies': 'Policies',
30 | 'navigation.privacy': 'Privacy',
31 | 'navigation.terms': 'Terms & Conditions',
32 | 'profile.edit.title': 'Edit Profile',
33 | 'profile.form.age.placeholder': 'Age',
34 | 'profile.form.emailVerified.label': 'Email verified',
35 | 'profile.form.email.placeholder': 'email',
36 | 'profile.form.familyName.placeholder': 'family name',
37 | 'profile.form.gender.male.label': 'Male',
38 | 'profile.form.gender.female.label': 'Female',
39 | 'profile.form.givenName.placeholder': 'given name',
40 | 'profile.form.locale.label': 'Locale',
41 | 'profile.form.nickname.placeholder': 'nickname',
42 | 'profile.form.notes.label': 'Notes',
43 | 'profile.form.reset.label': 'Reset',
44 | 'profile.form.save.label': 'Save',
45 | 'profile.message.updatingUserDetails': 'Updating user details...',
46 | 'site.message.loggingIn': 'Logging in...',
47 | 'site.message.loggingOut': 'Logging out...',
48 | 'site.name': 'Opencredo React Boilerplate',
49 | };
50 |
--------------------------------------------------------------------------------
/src/pages/LandingPage/LandingPage.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 | import { FormattedMessage, FormattedHTMLMessage } from 'react-intl';
3 | import { connect } from 'react-redux';
4 | import styles from './LandingPage.scss';
5 | import { Grid, Row, Col, Button } from 'react-bootstrap';
6 | import debug from 'debug';
7 | import { autobind } from 'core-decorators';
8 | import { messages } from './LandingPage.i18n';
9 | import LandingPageHero from './LandingPageHero';
10 | import {
11 | updateDocumentTitle,
12 | resetDocumentTitle,
13 | } from 'redux/modules/document-title/document-title';
14 |
15 | if (__DEBUG__) {
16 | debug.enable('landing-page:*');
17 | }
18 |
19 | const log = debug('landing-page:info');
20 |
21 | export class LandingPage extends React.Component {
22 |
23 | static propTypes = {
24 | isAuthenticated: PropTypes.bool,
25 | dispatch: PropTypes.func,
26 | };
27 |
28 | // executes only on the client
29 | componentDidMount() {
30 | this.props.dispatch(updateDocumentTitle(messages.title));
31 | }
32 |
33 | componentWillUnmount() {
34 | log('remove custom document title');
35 | this.props.dispatch(resetDocumentTitle());
36 | }
37 |
38 | @autobind
39 | handleButtonClick() {
40 | log('button click handler context:', this);
41 | }
42 |
43 | render() {
44 | return (
45 |