Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritz078 committed Feb 28, 2019
1 parent 87e20f2 commit 0f6cd10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/components/InfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,19 @@ class InfoCard extends React.Component<InfoCardProps, InfoCardState> {
};

private getFooter = () => {
const { linkText, onPress, expandable } = this.props;
const { linkText, onPress, expandable, disabled } = this.props;
const { isOpen } = this.state;

if (expandable) {
return (
<Touchable
onPress={() =>
this.setState({
isOpen: !isOpen
})
onPress={
!disabled
? () =>
this.setState({
isOpen: !isOpen
})
: undefined
}
>
<View style={styles.bottomSection}>
Expand All @@ -74,9 +77,11 @@ class InfoCard extends React.Component<InfoCardProps, InfoCardState> {

return (
!!linkText && (
<Touchable onPress={onPress}>
<Touchable disabled={disabled} onPress={onPress}>
<View style={styles.bottomSection}>
<Text color={colors.violet.base}>{linkText}</Text>
<Text color={disabled ? colors.gray.base : colors.violet.base}>
{linkText}
</Text>
</View>
</Touchable>
)
Expand Down
1 change: 1 addition & 0 deletions src/components/typings/InfoCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface InfoCardProps {
topSection?: any;
heading?: any;
};
disabled?: boolean;
}

export interface InfoCardState {
Expand Down

0 comments on commit 0f6cd10

Please sign in to comment.