Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify global create menu material top tab2 #1

Draft
wants to merge 32 commits into
base: andrew-scan
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
32380b4
Install react-navigation-bottom-tabs
MaciejSWM Jul 28, 2023
aa28ffa
Tab navigator for New Chat screens
MaciejSWM Jul 28, 2023
1105c34
Change keyboard shortcut to open New Chat instead of New Group
MaciejSWM Jul 28, 2023
8f11527
Translations for New Chat
MaciejSWM Jul 28, 2023
6ae6b66
Multiple option selector as button
MaciejSWM Jul 28, 2023
81c515d
Button toggle component for New Chat modal
MaciejSWM Jul 28, 2023
b0936bf
Styling of button
MaciejSWM Jul 28, 2023
00a1f06
Simplify FAB
MaciejSWM Jul 28, 2023
1ab0037
Add Button Toggle
MaciejSWM Jul 28, 2023
c98f9d0
Change keyboard shortcut key
MaciejSWM Jul 28, 2023
370403a
Merge branch 'andrew-scan' into simplify-global-create-menu-material-…
MaciejSWM Jul 31, 2023
63e8c3b
WIP navigation
MaciejSWM Jul 31, 2023
b03db84
Switch case for all route types
MaciejSWM Jul 31, 2023
78a21be
WIP Material Top Tab navigation
MaciejSWM Jul 31, 2023
d959c6a
Hide Tab Navigator behind beta flag
MaciejSWM Aug 1, 2023
005ff32
Merge remote-tracking branch 'upstream/andrew-scan' into simplify-glo…
MaciejSWM Aug 1, 2023
fead367
Delete split bill option
MaciejSWM Aug 1, 2023
1805b32
Button pill options
MaciejSWM Aug 1, 2023
effe947
Translate Add to split
MaciejSWM Aug 1, 2023
dc4039f
Destructure props
MaciejSWM Aug 1, 2023
9759331
Rename
MaciejSWM Aug 1, 2023
85bdcc9
Fix typo
MaciejSWM Aug 1, 2023
371e7af
Button pill selection
MaciejSWM Aug 1, 2023
7a1ad6b
Fix translation; Compact code style
MaciejSWM Aug 1, 2023
7cf93a6
On click navigate to request
MaciejSWM Aug 1, 2023
8db20c7
Delete split bill button
MaciejSWM Aug 1, 2023
29aec32
Merge branch 'simplify-global-create-menu-request-money-multiple' int…
MaciejSWM Aug 1, 2023
0f40047
Update version to 1.3.48-3
OSBotify Aug 1, 2023
f1db5d9
Always use Split component
MaciejSWM Aug 1, 2023
d128d19
Merge branch 'main' into simplify-global-create-menu-material-top-tab2
MaciejSWM Aug 1, 2023
3624178
Fix merge - packages
MaciejSWM Aug 1, 2023
7b4da52
Merge branch 'andrew-scan' into simplify-global-create-menu-material-…
MaciejSWM Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001034802
versionName "1.3.48-2"
versionCode 1001034803
versionName "1.3.48-3"
}

splits {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.48.2</string>
<string>1.3.48.3</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.3.48.2</string>
<string>1.3.48.3</string>
</dict>
</plist>
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.48-2",
"version": "1.3.48-3",
"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 Expand Up @@ -119,7 +119,6 @@
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.52",
"react-native-pager-view": "^6.2.0",
"react-native-pdf": "^6.6.2",
"react-native-performance": "^4.0.0",
"react-native-permissions": "^3.0.1",
Expand Down
6 changes: 4 additions & 2 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ const CONST = {
},
type: KEYBOARD_SHORTCUT_NAVIGATION_TYPE,
},
NEW_GROUP: {
descriptionKey: 'newGroup',
NEW_CHAT: {
descriptionKey: 'newChat',
shortcutKey: 'K',
modifiers: ['CTRL', 'SHIFT'],
trigger: {
Expand Down Expand Up @@ -2550,6 +2550,8 @@ const CONST = {
RECEIPT_TAB_ID: 'ReceiptTab',
MANUAL: 'manual',
SCAN: 'scan',
NEW_CHAT: 'chat',
NEW_ROOM: 'room',
},
};

Expand Down
4 changes: 2 additions & 2 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ export default {
SETTINGS_2FA_CODES: 'settings/security/two-factor-auth/codes',
SETTINGS_2FA_VERIFY: 'settings/security/two-factor-auth/verify',
SETTINGS_2FA_SUCCESS: 'settings/security/two-factor-auth/success',
NEW_GROUP: 'new/group',
NEW: 'new/:tab',
NEW_CHAT: 'new/chat',
NEW_ROOM: 'new/room',
NEW_TASK,
REPORT,
REPORT_WITH_ID: 'r/:reportID?',
Expand Down Expand Up @@ -155,7 +156,6 @@ export default {
WORKSPACE_INVOICES: 'workspace/:policyID/invoices',
WORKSPACE_TRAVEL: 'workspace/:policyID/travel',
WORKSPACE_MEMBERS: 'workspace/:policyID/members',
WORKSPACE_NEW_ROOM: 'workspace/new-room',
getWorkspaceInitialRoute: (policyID) => `workspace/${policyID}`,
getWorkspaceInviteRoute: (policyID) => `workspace/${policyID}/invite`,
getWorkspaceInviteMessageRoute: (policyID) => `workspace/${policyID}/invite-message`,
Expand Down
11 changes: 10 additions & 1 deletion src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const propTypes = {
/** medium sized button */
medium: PropTypes.bool,

/** Center the text and the icon */
centered: PropTypes.bool,

/** Indicates whether the button should be disabled and in the loading state */
isLoading: PropTypes.bool,

Expand Down Expand Up @@ -96,6 +99,9 @@ const propTypes = {
/** Whether we should use the danger theme color */
danger: PropTypes.bool,

/** Whether the background of the button should be transparent */
transparent: PropTypes.bool,

/** Children to replace all inner contents of button */
children: PropTypes.node,

Expand Down Expand Up @@ -135,6 +141,7 @@ const defaultProps = {
small: false,
large: false,
medium: false,
centered: false,
onPress: () => {},
onLongPress: () => {},
onPressIn: () => {},
Expand All @@ -148,6 +155,7 @@ const defaultProps = {
shouldUseDefaultHover: false,
success: false,
danger: false,
transparent: false,
children: null,
shouldRemoveRightBorderRadius: false,
shouldRemoveLeftBorderRadius: false,
Expand Down Expand Up @@ -225,7 +233,7 @@ class Button extends Component {

if (this.props.icon || this.props.shouldShowRightIcon) {
return (
<View style={[styles.justifyContentBetween, styles.flexRow]}>
<View style={[styles.justifyContentBetween, styles.flexRow, this.props.centered && styles.justifyContentCenter]}>
<View style={[styles.alignItemsCenter, styles.flexRow, styles.flexShrink1]}>
{this.props.icon && (
<View style={[styles.mr1, ...this.props.iconStyles]}>
Expand Down Expand Up @@ -292,6 +300,7 @@ class Button extends Component {
this.props.large ? styles.buttonLarge : undefined,
this.props.success ? styles.buttonSuccess : undefined,
this.props.danger ? styles.buttonDanger : undefined,
this.props.transparent ? styles.buttonTransparent : undefined,
this.props.isDisabled && (this.props.success || this.props.danger) ? styles.buttonOpacityDisabled : undefined,
this.props.isDisabled && !this.props.danger && !this.props.success ? styles.buttonDisabled : undefined,
this.props.shouldRemoveRightBorderRadius ? styles.noRightBorderRadius : undefined,
Expand Down
24 changes: 22 additions & 2 deletions src/components/OptionRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {View, StyleSheet, InteractionManager} from 'react-native';
import styles from '../styles/styles';
import * as StyleUtils from '../styles/StyleUtils';
import optionPropTypes from './optionPropTypes';
import Button from './Button';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import MultipleAvatars from './MultipleAvatars';
Expand Down Expand Up @@ -39,6 +40,15 @@ const propTypes = {
/** Whether we should show the selected state */
showSelectedState: PropTypes.bool,

/** Whether to show a button pill instead of a tickbox */
shouldShowSelectedStateAsButton: PropTypes.bool,

/** Text for button pill */
selectedStateButtonText: PropTypes.string,

/** Callback to fire when the multiple selector (tickbox or button) is clicked */
onSelectedStatePressed: PropTypes.func,

/** Whether this item is selected */
isSelected: PropTypes.bool,

Expand All @@ -65,6 +75,9 @@ const propTypes = {
const defaultProps = {
hoverStyle: styles.sidebarLinkHover,
showSelectedState: false,
shouldShowSelectedStateAsButton: false,
selectedStateButtonText: 'Select',
onSelectedStatePressed: undefined,
isSelected: false,
boldStyle: false,
showTitleTooltip: false,
Expand Down Expand Up @@ -149,7 +162,6 @@ class OptionRow extends Component {
pendingAction={this.props.option.pendingAction}
errors={this.props.option.allReportErrors}
shouldShowErrorMessages={false}
needsOffscreenAlphaCompositing
>
<Hoverable>
{(hovered) => (
Expand Down Expand Up @@ -248,7 +260,15 @@ class OptionRow extends Component {
/>
</View>
)}
{this.props.showSelectedState && <SelectCircle isChecked={this.props.isSelected} />}
{this.props.showSelectedState && (this.props.shouldShowSelectedStateAsButton && !this.props.isSelected) ?
<Button text={this.props.selectedStateButtonText} onPress={() => this.props.onSelectedStatePressed(this.props.option)} small /> :
<PressableWithFeedback
onPress={() => this.props.onSelectedStatePressed(this.props.option)}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.CHECKBOX}
>
<SelectCircle isChecked={this.props.isSelected} />
</PressableWithFeedback>
}
</View>
</View>
{Boolean(this.props.option.customIcon) && (
Expand Down
3 changes: 3 additions & 0 deletions src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ class BaseOptionsList extends Component {
onSelectRow={this.props.onSelectRow}
isSelected={Boolean(_.find(this.props.selectedOptions, (option) => option.accountID === item.accountID))}
showSelectedState={this.props.canSelectMultipleOptions}
shouldShowSelectedStateAsButton={this.props.shouldShowMultipleOptionSelectorAsButton}
selectedStateButtonText={this.props.multipleOptionSelectorButtonText}
onSelectedStatePressed={this.props.onAddToSelection}
boldStyle={this.props.boldStyle}
isDisabled={isDisabled}
shouldHaveOptionSeparator={index > 0 && this.props.shouldHaveOptionSeparator}
Expand Down
3 changes: 3 additions & 0 deletions src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ class BaseOptionsSelector extends Component {
focusedIndex={this.state.focusedIndex}
selectedOptions={this.props.selectedOptions}
canSelectMultipleOptions={this.props.canSelectMultipleOptions}
shouldShowMultipleOptionSelectorAsButton={this.props.shouldShowMultipleOptionSelectorAsButton}
multipleOptionSelectorButtonText={this.props.multipleOptionSelectorButtonText}
onAddToSelection={this.props.onAddToSelection}
hideSectionHeaders={this.props.hideSectionHeaders}
headerMessage={this.props.headerMessage}
boldStyle={this.props.boldStyle}
Expand Down
9 changes: 9 additions & 0 deletions src/components/OptionsSelector/optionsSelectorPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ const propTypes = {
/** Whether we can select multiple options */
canSelectMultipleOptions: PropTypes.bool,

/** Whether to show a button pill instead of a standard tickbox */
shouldShowMultipleOptionSelectorAsButton: PropTypes.bool,

/** Text for button pill */
multipleOptionSelectorButtonText: PropTypes.string,

/** Callback to fire when the multiple selector (tickbox or button) is clicked */
onAddToSelection: PropTypes.func,

/** Whether any section headers should be visible */
hideSectionHeaders: PropTypes.bool,

Expand Down
17 changes: 15 additions & 2 deletions src/components/TabSelector/TabSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ const defaultProps = {
onTabPress: () => {},
};

const getIcon = (route) => (route === CONST.TAB.MANUAL ? Expensicons.Pencil : Expensicons.Receipt);
const getIcon = (route) => {
switch (route) {
case CONST.TAB.MANUAL:
return Expensicons.Pencil;
case CONST.TAB.SCAN:
return Expensicons.Receipt;
case CONST.TAB.NEW_CHAT:
return Expensicons.User;
case CONST.TAB.NEW_ROOM:
return Expensicons.Hashtag;
default:
return Expensicons.DotIndicator
}
}

function TabSelector({state, navigation, onTabPress}) {
const {translate} = useLocalize();
Expand Down Expand Up @@ -58,7 +71,7 @@ function TabSelector({state, navigation, onTabPress}) {
/>
);
})}
</View>
</View>
);
}

Expand Down
13 changes: 10 additions & 3 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,15 @@ export default {
},
},
sidebarScreen: {
fabAction: 'New chat',
chat: 'Chat',
room: 'Room',
newChat: 'New chat',
newGroup: 'New group',
newRoom: 'New room',
fabNewChat: 'Send message',
fabNewChatExplained: 'Send message (Floating action)',
buttonSearch: 'Search',
buttonMySettings: 'My settings',
fabNewChat: 'New chat (Floating action)',
chatPinned: 'Chat pinned',
draftedMessage: 'Drafted message',
listOfChatMessages: 'List of chat messages',
Expand All @@ -346,6 +348,8 @@ export default {
tabSelector: {
manual: 'Manual',
scan: 'Scan',
chat: 'Chat',
room: 'Room',
},
receipt: {
upload: 'Upload receipt',
Expand Down Expand Up @@ -383,6 +387,7 @@ export default {
payElsewhere: 'Pay elsewhere',
settlePaypalMe: ({formattedAmount}) => `Pay ${formattedAmount} with PayPal.me`,
requestAmount: ({amount}) => `request ${amount}`,
addToSplit: 'Add to split',
splitAmount: ({amount}) => `split ${amount}`,
amountEach: ({amount}) => `${amount} each`,
payerOwesAmount: ({payer, amount}) => `${payer} owes ${amount}`,
Expand Down Expand Up @@ -835,6 +840,8 @@ export default {
localTime: 'Local time',
},
newChatPage: {
addToGroup: 'Add to group',
createChat: 'Create chat',
createGroup: 'Create group',
},
yearPickerPage: {
Expand Down Expand Up @@ -1372,7 +1379,7 @@ export default {
openShortcutDialog: 'Opens the keyboard shortcuts dialog',
escape: 'Escape dialogs',
search: 'Open search dialog',
newGroup: 'New group screen',
newChat: 'New chat screen',
copy: 'Copy comment',
},
},
Expand Down
Loading
Loading