Skip to content

Commit

Permalink
Merge branch 'main' into WorkspaceSwitcherPage_list_refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorawski committed Apr 15, 2024
2 parents 5bef68f + 1cb6e00 commit 91415e8
Show file tree
Hide file tree
Showing 20 changed files with 350 additions and 305 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001046206
versionName "1.4.62-6"
versionCode 1001046207
versionName "1.4.62-7"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.62.6</string>
<string>1.4.62.7</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.62.6</string>
<string>1.4.62.7</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>1.4.62</string>
<key>CFBundleVersion</key>
<string>1.4.62.6</string>
<string>1.4.62.7</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
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.62-6",
"version": "1.4.62-7",
"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
6 changes: 3 additions & 3 deletions src/components/SelectionList/InviteMemberListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import BaseListItem from './BaseListItem';
import type {InviteMemberListItemProps} from './types';
import type {InviteMemberListItemProps, ListItem} from './types';

function InviteMemberListItem({
function InviteMemberListItem<TItem extends ListItem>({
item,
isFocused,
showTooltip,
Expand All @@ -26,7 +26,7 @@ function InviteMemberListItem({
onDismissError,
shouldPreventDefaultFocusOnSelectRow,
rightHandSideComponent,
}: InviteMemberListItemProps) {
}: InviteMemberListItemProps<TItem>) {
const styles = useThemeStyles();
const theme = useTheme();
const StyleUtils = useStyleUtils();
Expand Down
4 changes: 2 additions & 2 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ type UserListItemProps<TItem extends ListItem> = ListItemProps<TItem> & {
FooterComponent?: ReactElement;
};

type RadioListItemProps<TItem extends ListItem> = ListItemProps<TItem>;

type InviteMemberListItemProps<TItem extends ListItem> = UserListItemProps<TItem>;

type RadioListItemProps<TItem extends ListItem> = ListItemProps<TItem>;

type TableListItemProps<TItem extends ListItem> = ListItemProps<TItem>;

type ValidListItem = typeof RadioListItem | typeof UserListItem | typeof TableListItem | typeof InviteMemberListItem;
Expand Down
37 changes: 37 additions & 0 deletions src/hooks/useStyledSafeAreaInsets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// eslint-disable-next-line no-restricted-imports
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import useStyleUtils from './useStyleUtils';

/**
* Custom hook to get the styled safe area insets.
* This hook utilizes the `SafeAreaInsetsContext` to retrieve the current safe area insets
* and applies styling adjustments using the `useStyleUtils` hook.
*
* @returns An object containing the styled safe area insets and additional styles.
* @returns .paddingTop The top padding adjusted for safe area.
* @returns .paddingBottom The bottom padding adjusted for safe area.
* @returns .insets The safe area insets object or undefined if not available.
* @returns .safeAreaPaddingBottomStyle An object containing the bottom padding style adjusted for safe area.
*
* @example
* // How to use this hook in a component
* function MyComponent() {
* const { paddingTop, paddingBottom, safeAreaPaddingBottomStyle } = useStyledSafeAreaInsets();
*
* // Use these values to style your component accordingly
* }
*/
function useStyledSafeAreaInsets() {
const StyleUtils = useStyleUtils();
const insets = useSafeAreaInsets();

const {paddingTop, paddingBottom} = StyleUtils.getSafeAreaPadding(insets ?? undefined);
return {
paddingTop,
paddingBottom,
insets: insets ?? undefined,
safeAreaPaddingBottomStyle: {paddingBottom},
};
}

export default useStyledSafeAreaInsets;
24 changes: 12 additions & 12 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,18 +593,18 @@ export default {
addReceipt: 'Add receipt',
},
quickAction: {
scanReceipt: 'Scan Receipt',
recordDistance: 'Record Distance',
requestMoney: 'Request Money',
splitBill: 'Split Bill',
splitScan: 'Split Receipt',
splitDistance: 'Split Distance',
trackManual: 'Track Expense',
trackScan: 'Track Receipt',
trackDistance: 'Track Distance',
sendMoney: 'Send Money',
assignTask: 'Assign Task',
shortcut: 'Shortcut',
scanReceipt: 'Scan receipt',
recordDistance: 'Record distance',
requestMoney: 'Request money',
splitBill: 'Split bill',
splitScan: 'Split receipt',
splitDistance: 'Split distance',
sendMoney: 'Send money',
assignTask: 'Assign task',
header: 'Quick action',
trackManual: 'Track manual',
trackScan: 'Track scan',
trackDistance: 'Track distance',
},
iou: {
amount: 'Amount',
Expand Down
24 changes: 12 additions & 12 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,18 @@ export default {
addReceipt: 'Añadir recibo',
},
quickAction: {
scanReceipt: 'Escanear Recibo',
recordDistance: 'Grabar Distancia',
requestMoney: 'Solicitar Dinero',
splitBill: 'Dividir Cuenta',
splitScan: 'Dividir Recibo',
splitDistance: 'Dividir Distancia',
sendMoney: 'Enviar Dinero',
assignTask: 'Assignar Tarea',
shortcut: 'Acceso Directo',
trackManual: 'Crear Gasto',
trackScan: 'Crear Recibo',
trackDistance: 'Crear Gasto por desplazamiento',
scanReceipt: 'Escanear recibo',
recordDistance: 'Grabar distancia',
requestMoney: 'Solicitar dinero',
splitBill: 'Dividir cuenta',
splitScan: 'Dividir recibo',
splitDistance: 'Dividir distancia',
sendMoney: 'Enviar dinero',
assignTask: 'Assignar tarea',
header: 'Acción rápida',
trackManual: 'Crear gasto',
trackScan: 'Crear gasto por recibo',
trackDistance: 'Crear gasto por desplazamiento',
},
iou: {
amount: 'Importe',
Expand Down
15 changes: 14 additions & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,18 @@ function formatSectionsFromSearchTerm(
};
}

/**
* Helper method to get the `keyForList` for the first option in the OptionsList
*/
function getFirstKeyForList(data?: Option[] | null) {
if (!data?.length) {
return '';
}

const firstNonEmptyDataObj = data[0];

return firstNonEmptyDataObj.keyForList ? firstNonEmptyDataObj.keyForList : '';
}
/**
* Filters options based on the search input value
*/
Expand Down Expand Up @@ -2341,6 +2353,7 @@ export {
createOptionFromReport,
getReportOption,
getTaxRatesSection,
getFirstKeyForList,
};

export type {MemberForList, CategorySection, CategoryTreeSection, Options, OptionList, SearchOption, PayeePersonalDetails, Category, TaxRatesOption};
export type {MemberForList, CategorySection, CategoryTreeSection, Options, OptionList, SearchOption, PayeePersonalDetails, Category, TaxRatesOption, Option};
Loading

0 comments on commit 91415e8

Please sign in to comment.