Skip to content

Commit

Permalink
Merge pull request #45 from software-mansion-labs/@cdOut/ideal-nav-fi…
Browse files Browse the repository at this point in the history
…xes-3
  • Loading branch information
cdOut authored Jan 30, 2024
2 parents 51fa161 + e471bff commit 6966b00
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 33 deletions.
1 change: 1 addition & 0 deletions src/components/AvatarCropModal/AvatarCropModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ function AvatarCropModal({imageUri = '', imageName = '', imageType = '', onClose
isVisible={isVisible}
type={CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED}
onModalHide={resetState}
shouldUseCustomBackdrop
>
<ScreenWrapper
style={[styles.pb0]}
Expand Down
1 change: 0 additions & 1 deletion src/pages/WorkspaceSwitcherPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ function WorkspaceSwitcherPage({policies}) {
textIconLeft={MagnifyingGlass}
// It has to be set to null or -1 to avoid focus on any element at the beggining
initiallyFocusedOptionKey={null}
shouldUseStyleForChildren={false}
/>
) : (
<WorkspaceCardCreateAWorkspace />
Expand Down
50 changes: 20 additions & 30 deletions src/pages/settings/InitialSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import * as Expensicons from '@components/Icon/Expensicons';
import MenuItem from '@components/MenuItem';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {withNetwork} from '@components/OnyxProvider';
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
import Text from '@components/Text';
import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsDefaultProps, withCurrentUserPersonalDetailsPropTypes} from '@components/withCurrentUserPersonalDetails';
import withLocalize, {withLocalizePropTypes} from '@components/withLocalize';
Expand Down Expand Up @@ -111,10 +110,6 @@ function InitialSettingsPage(props) {
setShouldShowSignoutConfirmModal(value);
};

const openProfileSettings = () => {
Navigation.navigate(ROUTES.SETTINGS_PROFILE);
};

const signOut = useCallback(
(shouldForceSignout = false) => {
if (!props.network.isOffline || shouldForceSignout) {
Expand Down Expand Up @@ -303,33 +298,28 @@ function InitialSettingsPage(props) {
<CurrentUserPersonalDetailsSkeletonView avatarSize={CONST.AVATAR_SIZE.XLARGE} />
) : (
<>
<PressableWithoutFeedback
<OfflineWithFeedback
pendingAction={lodashGet(props.currentUserPersonalDetails, 'pendingFields.avatar', null)}
style={styles.mb3}
disabled={isExecuting}
onPress={singleExecution(openProfileSettings)}
accessibilityLabel={translate('common.profile')}
role={CONST.ROLE.BUTTON}
>
<OfflineWithFeedback pendingAction={lodashGet(props.currentUserPersonalDetails, 'pendingFields.avatar', null)}>
<AvatarWithImagePicker
isUsingDefaultAvatar={UserUtils.isDefaultAvatar(lodashGet(currentUserDetails, 'avatar', ''))}
source={UserUtils.getAvatar(avatarURL, accountID)}
onImageSelected={PersonalDetails.updateAvatar}
onImageRemoved={PersonalDetails.deleteAvatar}
size={CONST.AVATAR_SIZE.XLARGE}
avatarStyle={styles.avatarXLarge}
pendingAction={lodashGet(props.currentUserPersonalDetails, 'pendingFields.avatar', null)}
errors={lodashGet(props.currentUserPersonalDetails, 'errorFields.avatar', null)}
errorRowStyles={[styles.mt6]}
onErrorClose={PersonalDetails.clearAvatarErrors}
previewSource={UserUtils.getFullSizeAvatar(avatarURL, accountID)}
originalFileName={currentUserDetails.originalFileName}
headerTitle={props.translate('profilePage.profileAvatar')}
style={[styles.mh5]}
fallbackIcon={lodashGet(currentUserDetails, 'fallbackIcon')}
/>
</OfflineWithFeedback>
</PressableWithoutFeedback>
<AvatarWithImagePicker
isUsingDefaultAvatar={UserUtils.isDefaultAvatar(lodashGet(currentUserDetails, 'avatar', ''))}
source={UserUtils.getAvatar(avatarURL, accountID)}
onImageSelected={PersonalDetails.updateAvatar}
onImageRemoved={PersonalDetails.deleteAvatar}
size={CONST.AVATAR_SIZE.XLARGE}
avatarStyle={styles.avatarXLarge}
pendingAction={lodashGet(props.currentUserPersonalDetails, 'pendingFields.avatar', null)}
errors={lodashGet(props.currentUserPersonalDetails, 'errorFields.avatar', null)}
errorRowStyles={[styles.mt6]}
onErrorClose={PersonalDetails.clearAvatarErrors}
previewSource={UserUtils.getFullSizeAvatar(avatarURL, accountID)}
originalFileName={currentUserDetails.originalFileName}
headerTitle={props.translate('profilePage.profileAvatar')}
style={[styles.mh5]}
fallbackIcon={lodashGet(currentUserDetails, 'fallbackIcon')}
/>
</OfflineWithFeedback>
<Text
style={[styles.textHeadline, styles.pre, styles.textAlignCenter]}
numberOfLines={1}
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceInitialPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ function WorkspaceInitialPage(props) {
brickRoadIndicator={item.brickRoadIndicator}
wrapperStyle={styles.sectionMenuItem}
focused={activeRoute && activeRoute.startsWith(item.routeName)}
hoverAndPressStyle={styles.hoveredComponentBG}
isPaneMenu
/>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/reimburse/WorkspaceReimburseView.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function WorkspaceReimburseView(props) {
description={translate('workspace.reimburse.trackDistanceRate')}
shouldShowRightIcon
onPress={() => Navigation.navigate(ROUTES.WORKSPACE_RATE_AND_UNIT.getRoute(props.policy.id))}
wrapperStyle={[styles.mhn5, styles.wAuto]}
wrapperStyle={[styles.mt3, styles.ph8, styles.mhn8, styles.wAuto]}
brickRoadIndicator={(lodashGet(distanceCustomUnit, 'errors') || lodashGet(distanceCustomRate, 'errors')) && CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR}
/>
</OfflineWithFeedback>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3191,7 +3191,7 @@ const styles = (theme: ThemeColors) =>
},

searchInputStyle: {
color: colors.productDark800,
color: theme.textSupporting,
fontSize: 13,
lineHeight: 16,
},
Expand Down
4 changes: 4 additions & 0 deletions src/styles/utils/spacing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export default {
marginHorizontal: -20,
},

mhn8: {
marginHorizontal: -32,
},

mv0: {
marginVertical: 0,
},
Expand Down

0 comments on commit 6966b00

Please sign in to comment.