Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Nov 30, 2023
2 parents 61bc06b + d95b135 commit e875e3c
Show file tree
Hide file tree
Showing 127 changed files with 1,078 additions and 567 deletions.
3 changes: 2 additions & 1 deletion .imgbotconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"ignoredFiles": [
"assets/images/empty-state_background-fade.png" // Caused an issue with colour gradients, https://github.com/Expensify/App/issues/30499
"assets/images/empty-state_background-fade-dark.png", // Caused an issue with colour gradients, https://github.com/Expensify/App/issues/30499
"assets/images/empty-state_background-fade-light.png"
],
"aggressiveCompression": "false"
}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001040507
versionName "1.4.5-7"
versionCode 1001040602
versionName "1.4.6-2"
}

flavorDimensions "default"
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.5</string>
<string>1.4.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.5.7</string>
<string>1.4.6.2</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.5</string>
<string>1.4.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.5.7</string>
<string>1.4.6.2</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.4.5-7",
"version": "1.4.6-2",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
7 changes: 6 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import Onyx from 'react-native-onyx';
import {PickerStateProvider} from 'react-native-picker-select';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import '../wdyr';
import ColorSchemeWrapper from './components/ColorSchemeWrapper';
import ComposeProviders from './components/ComposeProviders';
import CustomStatusBar from './components/CustomStatusBar';
import CustomStatusBarContextProvider from './components/CustomStatusBar/CustomStatusBarContextProvider';
import ErrorBoundary from './components/ErrorBoundary';
import HTMLEngineProvider from './components/HTMLEngineProvider';
import {LocaleContextProvider} from './components/LocaleContextProvider';
Expand Down Expand Up @@ -66,11 +68,14 @@ function App() {
ThemeProvider,
ThemeStylesProvider,
ThemeIllustrationsProvider,
CustomStatusBarContextProvider,
]}
>
<CustomStatusBar />
<ErrorBoundary errorMessage="NewExpensify crash caught by error boundary">
<Expensify />
<ColorSchemeWrapper>
<Expensify />
</ColorSchemeWrapper>
</ErrorBoundary>
</ComposeProviders>
</GestureHandlerRootView>
Expand Down
8 changes: 8 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,14 @@ const CONST = {
DARK: 'dark',
SYSTEM: 'system',
},
COLOR_SCHEME: {
LIGHT: 'light',
DARK: 'dark',
},
STATUS_BAR_STYLE: {
LIGHT_CONTENT: 'light-content',
DARK_CONTENT: 'dark-content',
},
TRANSACTION: {
DEFAULT_MERCHANT: 'Request',
UNKNOWN_MERCHANT: 'Unknown Merchant',
Expand Down
5 changes: 4 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ const ROUTES = {
route: 'settings/profile/contact-methods/:contactMethod/details',
getRoute: (contactMethod: string) => `settings/profile/contact-methods/${encodeURIComponent(contactMethod)}/details` as const,
},
SETTINGS_NEW_CONTACT_METHOD: 'settings/profile/contact-methods/new',
SETTINGS_NEW_CONTACT_METHOD: {
route: 'settings/profile/contact-methods/new',
getRoute: (backTo?: string) => getUrlWithBackToParam('settings/profile/contact-methods/new', backTo),
},
SETTINGS_2FA: {
route: 'settings/security/two-factor-auth',
getRoute: (backTo?: string) => getUrlWithBackToParam('settings/security/two-factor-auth', backTo),
Expand Down
4 changes: 3 additions & 1 deletion src/components/AddressSearch/CurrentLocationButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import useLocalize from '@hooks/useLocalize';
import getButtonState from '@libs/getButtonState';
import colors from '@styles/colors';
import * as StyleUtils from '@styles/StyleUtils';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';

const propTypes = {
Expand All @@ -25,12 +26,13 @@ const defaultProps = {

function CurrentLocationButton({onPress, isDisabled}) {
const styles = useThemeStyles();
const theme = useTheme();
const {translate} = useLocalize();

return (
<PressableWithFeedback
style={[styles.flexRow, styles.pv4, styles.ph3, isDisabled && styles.buttonOpacityDisabled]}
hoverStyle={StyleUtils.getButtonBackgroundColorStyle(getButtonState(true), true)}
hoverStyle={StyleUtils.getButtonBackgroundColorStyle(theme, getButtonState(true), true)}
onPress={onPress}
accessibilityLabel={translate('location.useCurrent')}
disabled={isDisabled}
Expand Down
10 changes: 8 additions & 2 deletions src/components/AddressSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,13 @@ function AddressSearch({
}}
styles={{
textInputContainer: [styles.flexColumn],
listView: [StyleUtils.getGoogleListViewStyle(displayListViewBorder), styles.overflowAuto, styles.borderLeft, styles.borderRight, !isFocused && {height: 0}],
listView: [
StyleUtils.getGoogleListViewStyle(styles, displayListViewBorder),
styles.overflowAuto,
styles.borderLeft,
styles.borderRight,
!isFocused && {height: 0},
],
row: [styles.pv4, styles.ph3, styles.overflowAuto],
description: [styles.googleSearchText],
separator: [styles.googleSearchSeparator],
Expand All @@ -526,7 +532,7 @@ function AddressSearch({
inbetweenCompo={
// We want to show the current location button even if there are no recent destinations
predefinedPlaces.length === 0 && shouldShowCurrentLocationButton ? (
<View style={[StyleUtils.getGoogleListViewStyle(true), styles.overflowAuto, styles.borderLeft, styles.borderRight]}>
<View style={[StyleUtils.getGoogleListViewStyle(styles, true), styles.overflowAuto, styles.borderLeft, styles.borderRight]}>
<CurrentLocationButton
onPress={getCurrentLocation}
isDisabled={network.isOffline}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {ScrollView} from 'react-native-gesture-handler';
import Animated, {Easing, FadeOutDown, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
import * as StyleUtils from '@styles/StyleUtils';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import viewForwardedRef from '@src/types/utils/viewForwardedRef';
Expand Down Expand Up @@ -39,6 +40,7 @@ function BaseAutoCompleteSuggestions<TSuggestion>(
ref: ForwardedRef<View | HTMLDivElement>,
) {
const styles = useThemeStyles();
const theme = useTheme();
const rowHeight = useSharedValue(0);
const scrollRef = useRef<FlashList<TSuggestion>>(null);
/**
Expand All @@ -47,7 +49,7 @@ function BaseAutoCompleteSuggestions<TSuggestion>(
const renderItem = useCallback(
({item, index}: RenderSuggestionMenuItemProps<TSuggestion>): ReactElement => (
<PressableWithFeedback
style={({hovered}) => StyleUtils.getAutoCompleteSuggestionItemStyle(highlightedSuggestionIndex, CONST.AUTO_COMPLETE_SUGGESTER.SUGGESTION_ROW_HEIGHT, hovered, index)}
style={({hovered}) => StyleUtils.getAutoCompleteSuggestionItemStyle(theme, highlightedSuggestionIndex, CONST.AUTO_COMPLETE_SUGGESTER.SUGGESTION_ROW_HEIGHT, hovered, index)}
hoverDimmingValue={1}
onMouseDown={(e) => e.preventDefault()}
onPress={() => onSelect(index)}
Expand All @@ -57,7 +59,7 @@ function BaseAutoCompleteSuggestions<TSuggestion>(
{renderSuggestionMenuItem(item, index)}
</PressableWithFeedback>
),
[highlightedSuggestionIndex, renderSuggestionMenuItem, onSelect, accessibilityLabelExtractor],
[highlightedSuggestionIndex, renderSuggestionMenuItem, onSelect, accessibilityLabelExtractor, theme],
);

const innerHeight = CONST.AUTO_COMPLETE_SUGGESTER.SUGGESTION_ROW_HEIGHT * suggestions.length;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ function Avatar(props) {

const imageStyle =
props.imageStyles && props.imageStyles.length
? [StyleUtils.getAvatarStyle(props.size), ...props.imageStyles, styles.noBorderRadius]
: [StyleUtils.getAvatarStyle(props.size), styles.noBorderRadius];
? [StyleUtils.getAvatarStyle(theme, props.size), ...props.imageStyles, styles.noBorderRadius]
: [StyleUtils.getAvatarStyle(theme, props.size), styles.noBorderRadius];

const iconStyle = props.imageStyles && props.imageStyles.length ? [StyleUtils.getAvatarStyle(props.size), styles.bgTransparent, ...props.imageStyles] : undefined;
const iconStyle = props.imageStyles && props.imageStyles.length ? [StyleUtils.getAvatarStyle(theme, props.size), styles.bgTransparent, ...props.imageStyles] : undefined;

const iconFillColor = isWorkspace ? StyleUtils.getDefaultWorkspaceAvatarColor(props.name).fill : props.fill || theme.icon;
const fallbackAvatar = isWorkspace ? ReportUtils.getDefaultWorkspaceAvatar(props.name) : props.fallbackIcon || Expensicons.FallbackAvatar;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function Badge({success = false, error = false, pressable = false, text, environ
const Wrapper = pressable ? PressableWithoutFeedback : View;

const wrapperStyles: (state: PressableStateCallbackType) => StyleProp<ViewStyle> = useCallback(
({pressed}) => [styles.badge, styles.ml2, StyleUtils.getBadgeColorStyle(success, error, pressed, environment === CONST.ENVIRONMENT.ADHOC), badgeStyles],
[styles.badge, styles.ml2, success, error, environment, badgeStyles],
({pressed}) => [styles.badge, styles.ml2, StyleUtils.getBadgeColorStyle(styles, success, error, pressed, environment === CONST.ENVIRONMENT.ADHOC), badgeStyles],
[success, error, environment, badgeStyles, styles],
);

return (
Expand Down
4 changes: 3 additions & 1 deletion src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {StyleProp, TextStyle, View, ViewStyle} from 'react-native';
import useLocalize from '@hooks/useLocalize';
import getButtonState from '@libs/getButtonState';
import * as StyleUtils from '@styles/StyleUtils';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import Hoverable from './Hoverable';
Expand Down Expand Up @@ -41,6 +42,7 @@ type BannerProps = {

function Banner({text, onClose, onPress, containerStyles, textStyles, shouldRenderHTML = false, shouldShowIcon = false, shouldShowCloseButton = false}: BannerProps) {
const styles = useThemeStyles();
const theme = useTheme();
const {translate} = useLocalize();

return (
Expand All @@ -65,7 +67,7 @@ function Banner({text, onClose, onPress, containerStyles, textStyles, shouldRend
<View style={[styles.mr3]}>
<Icon
src={Expensicons.Exclamation}
fill={StyleUtils.getIconFillColor(getButtonState(shouldHighlight))}
fill={StyleUtils.getIconFillColor(theme, getButtonState(shouldHighlight))}
/>
</View>
)}
Expand Down
4 changes: 3 additions & 1 deletion src/components/BaseMiniContextMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import DomUtils from '@libs/DomUtils';
import getButtonState from '@libs/getButtonState';
import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager';
import * as StyleUtils from '@styles/StyleUtils';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import variables from '@styles/variables';
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';
Expand Down Expand Up @@ -51,6 +52,7 @@ const defaultProps = {
*/
function BaseMiniContextMenuItem(props) {
const styles = useThemeStyles();
const theme = useTheme();
return (
<Tooltip text={props.tooltipText}>
<PressableWithoutFeedback
Expand All @@ -73,7 +75,7 @@ function BaseMiniContextMenuItem(props) {
accessibilityLabel={props.tooltipText}
style={({hovered, pressed}) => [
styles.reportActionContextMenuMiniButton,
StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed, props.isDelayButtonStateComplete)),
StyleUtils.getButtonBackgroundColorStyle(theme, getButtonState(hovered, pressed, props.isDelayButtonStateComplete)),
props.isDelayButtonStateComplete && styles.cursorDefault,
]}
>
Expand Down
7 changes: 3 additions & 4 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Text from '@components/Text';
import withNavigationFallback from '@components/withNavigationFallback';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
import HapticFeedback from '@libs/HapticFeedback';
import themeColors from '@styles/themes/default';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -118,7 +117,7 @@ function Button(
allowBubble = false,

iconRight = Expensicons.ArrowRight,
iconFill = themeColors.textLight,
iconFill,
iconStyles = [],
iconRightStyles = [],

Expand Down Expand Up @@ -214,7 +213,7 @@ function Button(
<View style={[styles.mr1, iconStyles]}>
<Icon
src={icon}
fill={iconFill || theme.textLight}
fill={iconFill ?? theme.textLight}
small={small}
/>
</View>
Expand All @@ -225,7 +224,7 @@ function Button(
<View style={[styles.justifyContentCenter, styles.ml1, iconRightStyles]}>
<Icon
src={iconRight}
fill={iconFill || theme.textLight}
fill={iconFill ?? theme.textLight}
small={small}
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function Checkbox(
{children ?? (
<View
style={[
StyleUtils.getCheckboxContainerStyle(containerSize, containerBorderRadius),
StyleUtils.getCheckboxContainerStyle(theme, containerSize, containerBorderRadius),
containerStyle,
isChecked && styles.checkedContainer,
hasError && styles.borderColorDanger,
Expand Down
5 changes: 5 additions & 0 deletions src/components/ColorSchemeWrapper/index.native.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function ColorSchemeWrapper({children}: React.PropsWithChildren) {
return children;
}

export default ColorSchemeWrapper;
13 changes: 13 additions & 0 deletions src/components/ColorSchemeWrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import {View} from 'react-native';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';

function ColorSchemeWrapper({children}: React.PropsWithChildren): React.ReactElement {
const theme = useTheme();
const themeStyles = useThemeStyles();

return <View style={[themeStyles.flex1, themeStyles.colorSchemeStyle(theme.colorScheme)]}>{children}</View>;
}

export default ColorSchemeWrapper;
4 changes: 3 additions & 1 deletion src/components/ContextMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useWindowDimensions from '@hooks/useWindowDimensions';
import getButtonState from '@libs/getButtonState';
import getContextMenuItemStyles from '@styles/getContextMenuItemStyles';
import * as StyleUtils from '@styles/StyleUtils';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import BaseMiniContextMenuItem from './BaseMiniContextMenuItem';
import Icon from './Icon';
Expand Down Expand Up @@ -54,6 +55,7 @@ const defaultProps = {

function ContextMenuItem({onPress, successIcon, successText, icon, text, isMini, description, isAnonymousAction, isFocused, innerRef}) {
const styles = useThemeStyles();
const theme = useTheme();
const {windowWidth} = useWindowDimensions();
const [isThrottledButtonActive, setThrottledButtonInactive] = useThrottledButtonState();

Expand Down Expand Up @@ -85,7 +87,7 @@ function ContextMenuItem({onPress, successIcon, successText, icon, text, isMini,
<Icon
small
src={itemIcon}
fill={StyleUtils.getIconFillColor(getButtonState(hovered, pressed, !isThrottledButtonActive))}
fill={StyleUtils.getIconFillColor(theme, getButtonState(hovered, pressed, !isThrottledButtonActive))}
/>
)}
</BaseMiniContextMenuItem>
Expand Down
11 changes: 11 additions & 0 deletions src/components/CustomStatusBar/CustomStatusBarContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {createContext} from 'react';

type CustomStatusBarContextType = {
isRootStatusBarDisabled: boolean;
disableRootStatusBar: (isDisabled: boolean) => void;
};

const CustomStatusBarContext = createContext<CustomStatusBarContextType>({isRootStatusBarDisabled: false, disableRootStatusBar: () => undefined});

export default CustomStatusBarContext;
export {type CustomStatusBarContextType};
Loading

0 comments on commit e875e3c

Please sign in to comment.