Skip to content

Commit

Permalink
fix: Fix import config button crash
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Feb 8, 2021
1 parent 53c5655 commit 7ff3117
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/frontend/screens/Settings/ProjectConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const ProjectConfig = () => {
variant="outlined"
onPress={handleImportPress}
>
<FormattedMessage {...m.importConfig} />
{t(m.importConfig) /* Button component expects string children */}
</Button>
</View>
);
Expand Down
17 changes: 10 additions & 7 deletions src/frontend/sharedComponents/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ const Button = ({
onPress={disabled ? undefined : onPress}
>
<View style={styles.touchable}>
{typeof children === "string" ? (
<Text style={[styles.textBase, textStyle]}>
{children.toUpperCase()}
</Text>
) : (
children
)}
{
typeof children === "string" ? (
<Text style={[styles.textBase, textStyle]}>
{children.toUpperCase()}
</Text>
) : (
children
)
// TODO: Handle <FormattedMessage> as children (wrapping in <Text>)
}
</View>
</TouchableNativeFeedback>
</View>
Expand Down

0 comments on commit 7ff3117

Please sign in to comment.