Skip to content

Commit 9dbe365

Browse files
committed
Code improvements
1 parent 6be9344 commit 9dbe365

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/ExpensifyWordmark.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ const logoComponents = {
2525
[CONST.ENVIRONMENT.ADHOC]: AdHocLogo,
2626
};
2727

28-
function ExpensifyWordmark({isSmallScreenWidth, style = {}}: ExpensifyWordmarkProps) {
28+
function ExpensifyWordmark({isSmallScreenWidth, style}: ExpensifyWordmarkProps) {
2929
const theme = useTheme();
3030
const styles = useThemeStyles();
3131
const {environment} = useEnvironment();
3232
// PascalCase is required for React components, so capitalize the const here
33-
const LogoComponent = (environment && logoComponents[environment]) ?? AdHocLogo;
33+
const LogoComponent = environment ? logoComponents[environment] : AdHocLogo;
3434

3535
return (
3636
<>
3737
<View
3838
style={[
39-
StyleUtils.getSignInWordmarkWidthStyle(environment ?? '', isSmallScreenWidth),
39+
StyleUtils.getSignInWordmarkWidthStyle(environment, isSmallScreenWidth),
4040
StyleUtils.getHeight(isSmallScreenWidth ? variables.signInLogoHeightSmallScreen : variables.signInLogoHeight),
4141
isSmallScreenWidth && (environment === CONST.ENVIRONMENT.DEV || environment === CONST.ENVIRONMENT.STAGING) ? styles.ml3 : {},
4242
style,

src/styles/StyleUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ function getBorderColorStyle(borderColor: string): ViewStyle {
462462
/**
463463
* Returns the width style for the wordmark logo on the sign in page
464464
*/
465-
function getSignInWordmarkWidthStyle(environment: string, isSmallScreenWidth: boolean): ViewStyle {
465+
function getSignInWordmarkWidthStyle(environment: ValueOf<typeof CONST.ENVIRONMENT> | undefined, isSmallScreenWidth: boolean): ViewStyle {
466466
if (environment === CONST.ENVIRONMENT.DEV) {
467467
return isSmallScreenWidth ? {width: variables.signInLogoWidthPill} : {width: variables.signInLogoWidthLargeScreenPill};
468468
}

0 commit comments

Comments
 (0)