Skip to content

Commit

Permalink
Merge pull request #30891 from software-mansion-labs/ts-migration/env…
Browse files Browse the repository at this point in the history
…ironment-badge-component

[TS migration] Migrate 'EnvironmentBadge.js' component to TypeScript
  • Loading branch information
puneetlath authored Nov 21, 2023
2 parents 51781a7 + eb6d7e0 commit c6f9229
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type BadgeProps = {
textStyles?: StyleProp<TextStyle>;

/** Callback to be called on onPress */
onPress: (event?: GestureResponderEvent | KeyboardEvent) => void;
onPress?: (event?: GestureResponderEvent | KeyboardEvent) => void;
};

function Badge({success = false, error = false, pressable = false, text, environment = CONST.ENVIRONMENT.DEV, badgeStyles, textStyles, onPress = () => {}}: BadgeProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function EnvironmentBadge() {
const {environment} = useEnvironment();

// If we are on production, don't show any badge
if (environment === CONST.ENVIRONMENT.PRODUCTION) {
if (environment === CONST.ENVIRONMENT.PRODUCTION || environment === undefined) {
return null;
}

Expand Down

0 comments on commit c6f9229

Please sign in to comment.