Skip to content

Commit

Permalink
Code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Nov 17, 2023
1 parent 6be9344 commit 9dbe365
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/ExpensifyWordmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ const logoComponents = {
[CONST.ENVIRONMENT.ADHOC]: AdHocLogo,
};

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

return (
<>
<View
style={[
StyleUtils.getSignInWordmarkWidthStyle(environment ?? '', isSmallScreenWidth),
StyleUtils.getSignInWordmarkWidthStyle(environment, isSmallScreenWidth),
StyleUtils.getHeight(isSmallScreenWidth ? variables.signInLogoHeightSmallScreen : variables.signInLogoHeight),
isSmallScreenWidth && (environment === CONST.ENVIRONMENT.DEV || environment === CONST.ENVIRONMENT.STAGING) ? styles.ml3 : {},
style,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/StyleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function getBorderColorStyle(borderColor: string): ViewStyle {
/**
* Returns the width style for the wordmark logo on the sign in page
*/
function getSignInWordmarkWidthStyle(environment: string, isSmallScreenWidth: boolean): ViewStyle {
function getSignInWordmarkWidthStyle(environment: ValueOf<typeof CONST.ENVIRONMENT> | undefined, isSmallScreenWidth: boolean): ViewStyle {
if (environment === CONST.ENVIRONMENT.DEV) {
return isSmallScreenWidth ? {width: variables.signInLogoWidthPill} : {width: variables.signInLogoWidthLargeScreenPill};
}
Expand Down

0 comments on commit 9dbe365

Please sign in to comment.