Skip to content

Commit

Permalink
chore: Encourage org emails (#4714)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored Oct 11, 2024
1 parent 6005257 commit 30456c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"file-loader": "6.2.0",
"flagsmith": "3.18.0",
"flux-react-dispatcher": "1.2.5",
"free-email-domains": "^1.2.13",
"free-email-domains": "^1.2.14",
"fs-extra": "2.0.0",
"highlight.js": "11.0.1",
"history": "4.10.1",
Expand Down
16 changes: 13 additions & 3 deletions frontend/web/components/pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ import PasswordRequirements from 'components/PasswordRequirements'
import { informationCircleOutline } from 'ionicons/icons'
import { IonIcon } from '@ionic/react'
import classNames from 'classnames'

import freeEmailDomains from 'free-email-domains'
import InfoMessage from 'components/InfoMessage';
const freeEmail = (value)=>{
const domain = value?.split("@")?.[1]
return freeEmailDomains.includes(domain)
}
const HomePage = class extends React.Component {
static contextTypes = {
router: propTypes.object.isRequired,
Expand Down Expand Up @@ -608,6 +613,11 @@ const HomePage = class extends React.Component {
name='email'
id='email'
/>
{freeEmail(email) &&(
<InfoMessage>
Signing up with a work email makes it easier for co-workers to join your Flagsmith organisation.
</InfoMessage>
)}
<InputGroup
title='Password'
data-test='password'
Expand All @@ -628,8 +638,8 @@ const HomePage = class extends React.Component {
id='password'
/>
<PasswordRequirements
password={this.state.password}
onRequirementsMet={this.handleRequirementsMet}
password={this.state.password}
onRequirementsMet={this.handleRequirementsMet}
/>
<div className='form-cta'>
<Button
Expand Down

0 comments on commit 30456c1

Please sign in to comment.