Skip to content

Commit

Permalink
fix: Fix import config button crash (#512)
Browse files Browse the repository at this point in the history
* fix: Fix import config button crash

* Update version in package-lock

Co-authored-by: luandro <luandro@gmail.com>
  • Loading branch information
gmaclennan and luandro committed Feb 11, 2021
1 parent 5873ce2 commit 6093c3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion 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 src/frontend/screens/Settings/ProjectConfig.js
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
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 6093c3e

Please sign in to comment.