Skip to content

Commit

Permalink
32- allow logo on login page to be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mnicole committed Oct 3, 2018
1 parent 6107097 commit 5ebb44a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
8 changes: 4 additions & 4 deletions GITWORKFLOW.md
Expand Up @@ -35,7 +35,7 @@ git commit -m "#12 Add red button component" # creates a commit with the message
##### Creating Feature Branches

```
git checkout stage
git checkout develop
git pull
git flow feature start #ISSUE_ID-DESCRIBE-THE-BRANCH
Expand Down Expand Up @@ -64,7 +64,7 @@ git flow feature rebase -i
# Important - force your changes because you are rewriting all of the hashes
git push origin feature/YOUR-BRANCH --force
# if your branch is ready to merge, use git flow feature finish to merge it back to stage. this puts you on stage and then you can push your changes
# if your branch is ready to merge, use git flow feature finish to merge it back to develop. this puts you on develop and then you can push your changes
git flow feature finish YOUR-BRANCH
git push
```
Expand All @@ -76,14 +76,14 @@ Your PR will be merged by a user with merge access after it gets approved by at
```
git checkout master
git pull
git checkout stage
git checkout develop
git pull
git flow release start '1.x.x'
npm version TAG #use the appropriate tag for your release (major, minor, patch)
git flow release finish 1.x.x # when prompted, tag should be the release version
git push --tags
git push origin stage
git push origin develop
git push origin master
```

Expand Down
7 changes: 4 additions & 3 deletions _stories/molecules/LoginForm/README.md
@@ -1,9 +1,9 @@
**NOTE:** The minimum DS version required for this component to render properly is: **1.3.5**

The `<LoginForm>`, as the name implies, renders a formthat can be customized to look like any of [these prototypes](http://ds.gumgum.com/stable/#gds-account-modal).
This component can display the Product logo (underneath GumGum's logo), a Cap with text above the form fields and a link for password recovery. The form inputs and submit buttons must be provided.
The `<LoginForm>`, as the name implies, renders a form that can be customized to look like any of [these prototypes](http://ds.gumgum.com/stable/#gds-account-modal).
This component can display the Product name (underneath GumGum's logo), a Cap with text above the form fields and a link for password recovery. If you do not want to show GumGum's logo, you can pass the prop `hideLogo`. The form inputs and submit buttons must be provided.

All of its atoms (except GumGum's logo) are optional.
All of its atoms are optional.

Form values can be accessed on submission with the `onSubmit` callback.

Expand All @@ -13,6 +13,7 @@ prop name | description
------------|------------
capText | Text to display in the cap between the logo and form.
logoText | Product name, shown right below GumGum's logo
hideLogo | Boolean indicating whether or not you would like to hide GumGum's logo
onSubmit | (Required) function called on form submition
recoveryFn | Callback used to redirect to a password recovery page
recoveryText | Text to show for password recovery, defauts to "Forgot your password?"
Expand Down
1 change: 1 addition & 0 deletions _stories/molecules/LoginForm/index.js
Expand Up @@ -14,6 +14,7 @@ const component = () => (
<LoginForm
capText={text('Cap Text', 'Welcome')}
logoText={text('Logo Text', 'Storybook')}
hideLogo={boolean('Hide Logo', false)}
onSubmit={action('Form Submit')}
recoveryFn={action('Recovery Action')}
recoveryText={text('Recovery Text', 'Forgot Password?')}>
Expand Down
1 change: 1 addition & 0 deletions _tests/molecules/__snapshots__/LoginForm.test.js.snap
Expand Up @@ -3,6 +3,7 @@
exports[`Expect <LoginForm> to render 1`] = `
<LoginForm
capText="Text"
hideLogo={false}
logoText="Logo Text"
onSubmit={[Function]}
recoveryFn={[Function]}
Expand Down
21 changes: 17 additions & 4 deletions components/molecules/LoginForm.jsx
@@ -1,10 +1,21 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';

const wrapperStyle = { position: 'relative' };

const LoginForm = ({ capText, children, logoText, onSubmit, recoveryFn, recoveryText }) => (
<div className="gds-account-modal gds-account-modal--logo" style={wrapperStyle}>
const LoginForm = ({
capText,
children,
hideLogo,
logoText,
onSubmit,
recoveryFn,
recoveryText
}) => (
<div
className={cx('gds-account-modal', { 'gds-account-modal--logo': !hideLogo })}
style={wrapperStyle}>
<div className="gds-account-modal__form gds-card -p-t-3-sm -p-t-0">
{logoText && <div className="gds-account-modal__logo-product">{logoText}</div>}
{capText && (
Expand All @@ -29,7 +40,8 @@ LoginForm.displayName = 'LoginForm';
LoginForm.defaultProps = {
capText: '',
logoText: '',
recoveryText: 'Forgot your password?'
recoveryText: 'Forgot your password?',
hideLogo: false
};

LoginForm.propTypes = {
Expand All @@ -38,7 +50,8 @@ LoginForm.propTypes = {
logoText: PropTypes.string,
onSubmit: PropTypes.func.isRequired,
recoveryFn: PropTypes.func,
recoveryText: PropTypes.string
recoveryText: PropTypes.string,
hideLogo: PropTypes.bool
};

export default LoginForm;
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -18,6 +18,7 @@
"prepare": "npm run build",
"lint": "eslint ./components --color",
"test": "NODE_ENV='test' jest",
"test:updateSnapshot": "NODE_ENV='test' jest --updateSnapshot",
"test:watch": "NODE_ENV='test' jest --watch",
"preclean": "rimraf node_modules",
"clean": "yarn cache clean && yarn install",
Expand Down

0 comments on commit 5ebb44a

Please sign in to comment.