Skip to content

Commit

Permalink
feat(recipes): Add support for company code in login
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal-jain committed May 27, 2019
1 parent 947029f commit 95d31cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/recipes/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const styles = StyleSheet.create({
marginTop: 15
},
formContainer: {
marginTop: 30
marginTop: 30,
paddingTop: 30
},
loginUserInput: {
marginTop: 60,
flexDirection: "row"
},
userInfoWrap: {
Expand Down Expand Up @@ -205,7 +205,10 @@ export default class Login extends React.PureComponent<LoginProps, LoginState> {
footer,
onLoginHelp,
phoneInputProps,
isPhoneValid
isPhoneValid,
onTenantChange,
isTenantInvalid,
tenantInputProps
} = this.props;

const isButtonDisabled = !loginUserValue || !isPhoneValid;
Expand All @@ -222,6 +225,15 @@ export default class Login extends React.PureComponent<LoginProps, LoginState> {
<View style={styles.formContainer}>
{loginPage === LOGIN_PAGE.USER_PAGE && (
<>
<Input
placeholder="Company code"
onChange={onTenantChange}
errorMessage={
isTenantInvalid ? "Please check the company code" : ""
}
inputProps={extraProps}
{...tenantInputProps}
/>
<View style={styles.loginUserInput}>
<View style={styles.countrySelect}>
<Select
Expand Down
3 changes: 3 additions & 0 deletions src/recipes/typings/Login.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export interface LoginProps {
otpLength: number;
phoneInputProps?: InputProps;
isPhoneValid: boolean;
onTenantChange: (value: string) => void;
isTenantInvalid: boolean;
tenantInputProps?: InputProps;
}

export interface LoginState {
Expand Down

0 comments on commit 95d31cf

Please sign in to comment.