Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added: #10

Merged
merged 1 commit into from
Jul 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/PinCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type IProps = {
titleConfirmFailed: string
subtitleError: string
colorPassword?: string
colorPasswordError?: string
numbersButtonOverlayColor?: string
buttonDeleteComponent?: any
titleComponent?: any
Expand All @@ -62,6 +63,8 @@ export type IProps = {
styleColorTitleError?: string
styleColorSubtitle?: string
styleColorSubtitleError?: string
styleColorButtonTitle?: string
styleColorButtonTitleSelected?: string
}

export type IState = {
Expand Down Expand Up @@ -174,7 +177,7 @@ class PinCode extends React.PureComponent<IProps, IState> {
}}>
<Text style={[this.props.styleTextButton ? this.props.styleTextButton : styles.text, {
opacity: opacity,
color: this.state.textButtonSelected === text ? colors.white : colors.grey
color: this.state.textButtonSelected === text ? (this.props.styleColorButtonTitleSelected ? this.props.styleColorButtonTitleSelected : colors.white) : (this.props.styleColorButtonTitle ? this.props.styleColorButtonTitle : colors.grey)
}]}>{text}</Text>
</TouchableHighlight>
)}
Expand Down Expand Up @@ -252,7 +255,7 @@ class PinCode extends React.PureComponent<IProps, IState> {
opacity: [lengthSup ? 1 : 0.5],
height: [lengthSup ? 8 : 4],
width: [lengthSup ? 8 : 4],
color: [showError ? colors.alert : (this.props.colorPassword ? this.props.colorPassword : colors.turquoise)],
color: [showError ? (this.props.colorPasswordError ? this.props.colorPasswordError : colors.alert) : (this.props.colorPassword ? this.props.colorPassword : colors.turquoise)],
borderRadius: [lengthSup ? 4 : 2],
marginRight: [lengthSup ? 8 : 10],
marginLeft: [lengthSup ? 8 : 10],
Expand Down
12 changes: 10 additions & 2 deletions src/PinCodeChoose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type IProps = {
titleConfirmFailed?: string
subtitleError?: string
colorPassword?: string
colorPasswordError?: string
numbersButtonOverlayColor?: string
buttonDeleteComponent: any
titleComponent: any
Expand All @@ -46,6 +47,8 @@ export type IProps = {
styleDeleteButtonIcon?: string
styleDeleteButtonSize?: number
styleDeleteButtonText?: StyleProp<TextStyle>
styleColorButtonTitle?: string
styleColorButtonTitleSelected?: string
}

export type IState = {
Expand Down Expand Up @@ -98,6 +101,7 @@ class PinCodeChoose extends React.PureComponent<IProps, IState> {
titleConfirmFailed={this.props.titleConfirmFailed || 'Your entries did not match'}
subtitleError={this.props.subtitleError || 'Please try again'}
colorPassword={this.props.colorPassword || undefined}
colorPasswordError={this.props.colorPasswordError || undefined}
numbersButtonOverlayColor={this.props.numbersButtonOverlayColor || undefined}
buttonDeleteComponent={this.props.buttonDeleteComponent || null}
titleComponent={this.props.titleComponent || null}
Expand All @@ -121,7 +125,8 @@ class PinCodeChoose extends React.PureComponent<IProps, IState> {
styleColorSubtitleError={this.props.styleColorSubtitleError}
styleDeleteButtonIcon={this.props.styleDeleteButtonIcon}
styleDeleteButtonSize={this.props.styleDeleteButtonSize}
styleDeleteButtonText={this.props.styleDeleteButtonText}/>}
styleDeleteButtonText={this.props.styleDeleteButtonText}
styleColorButtonTitle={this.props.styleColorButtonTitle}/>}
{this.state.status === PinStatus.confirm &&
<PinCode
endProcess={this.endProcessConfirm}
Expand All @@ -137,6 +142,7 @@ class PinCodeChoose extends React.PureComponent<IProps, IState> {
titleConfirmFailed={this.props.titleConfirmFailed || 'Your entries did not match'}
subtitleError={this.props.subtitleError || 'Please try again'}
colorPassword={this.props.colorPassword || undefined}
colorPasswordError={this.props.colorPasswordError || undefined}
numbersButtonOverlayColor={this.props.numbersButtonOverlayColor || undefined}
buttonDeleteComponent={this.props.buttonDeleteComponent || null}
titleComponent={this.props.titleComponent || null}
Expand All @@ -160,7 +166,9 @@ class PinCodeChoose extends React.PureComponent<IProps, IState> {
styleDeleteButtonColorHideUnderlay={this.props.styleDeleteButtonColorHideUnderlay}
styleDeleteButtonIcon={this.props.styleDeleteButtonIcon}
styleDeleteButtonSize={this.props.styleDeleteButtonSize}
styleDeleteButtonText={this.props.styleDeleteButtonText}/>}
styleDeleteButtonText={this.props.styleDeleteButtonText}
styleColorButtonTitle={this.props.styleColorButtonTitle}
styleColorButtonTitleSelected={this.props.styleColorButtonTitleSelected}/>}
</View>
)
}
Expand Down
8 changes: 7 additions & 1 deletion src/PinCodeEnter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type IProps = {
titleConfirmFailed?: string
subtitleError?: string
colorPassword?: string
colorPasswordError?: string
numbersButtonOverlayColor?: string
buttonDeleteComponent: any
titleComponent: any
Expand Down Expand Up @@ -55,6 +56,8 @@ export type IProps = {
styleDeleteButtonIcon?: string
styleDeleteButtonSize?: number
styleDeleteButtonText?: StyleProp<TextStyle>
styleColorButtonTitle?: string
styleColorButtonTitleSelected?: string
}

export type IState = {
Expand Down Expand Up @@ -152,6 +155,7 @@ class PinCodeEnter extends React.PureComponent<IProps, IState> {
titleConfirmFailed={this.props.titleConfirmFailed || 'Your entries did not match'}
subtitleError={this.props.subtitleError || 'Please try again'}
colorPassword={this.props.colorPassword || undefined}
colorPasswordError={this.props.colorPasswordError || undefined}
numbersButtonOverlayColor={this.props.numbersButtonOverlayColor || undefined}
buttonDeleteComponent={this.props.buttonDeleteComponent || null}
titleComponent={this.props.titleComponent || null}
Expand All @@ -175,7 +179,9 @@ class PinCodeEnter extends React.PureComponent<IProps, IState> {
styleColorTitleError={this.props.styleColorTitleError}
styleColorSubtitle={this.props.styleColorSubtitle}
styleColorSubtitleError={this.props.styleColorSubtitleError}
styleDeleteButtonText={this.props.styleDeleteButtonText}/>
styleDeleteButtonText={this.props.styleDeleteButtonText}
styleColorButtonTitle={this.props.styleColorButtonTitle}
styleColorButtonTitleSelected={this.props.styleColorButtonTitleSelected}/>
</View>
)
}
Expand Down