Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Aug 29, 2024
1 parent 2057f8a commit 4df965d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
6 changes: 5 additions & 1 deletion src/pages/workspace/WorkspacePageWithSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ type WorkspacePageWithSectionsProps = WithPolicyAndFullscreenLoadingProps &
/** Whether to show the not found page */
shouldShowNotFoundPage?: boolean;

/** Whether to include safe area padding bottom or not */
includeSafeAreaPaddingBottom?: boolean;

/** Policy values needed in the component */
policy: OnyxEntry<Policy>;

Expand Down Expand Up @@ -120,6 +123,7 @@ function WorkspacePageWithSections({
user,
shouldShowLoading = true,
shouldShowOfflineIndicatorInWideScreen = false,
includeSafeAreaPaddingBottom = false,
shouldShowNonAdmin = false,
headerContent,
testID,
Expand Down Expand Up @@ -169,7 +173,7 @@ function WorkspacePageWithSections({

return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
includeSafeAreaPaddingBottom={includeSafeAreaPaddingBottom}
shouldEnablePickerAvoiding={false}
shouldEnableMaxHeight
testID={testID ?? WorkspacePageWithSections.displayName}
Expand Down
17 changes: 6 additions & 11 deletions src/pages/workspace/companyCards/WorkspaceCompanyCardsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {useOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -62,7 +61,7 @@ function WorkspaceCompanyCardsList({policyID, cardsList, selectedFeed}: Workspac

const renderListHeader = useCallback(
() => (
<View style={[styles.flexRow, styles.justifyContentBetween, styles.mh5, styles.gap5, styles.p4]}>
<View style={[styles.flexRow, styles.appBG, styles.justifyContentBetween, styles.mh5, styles.gap5, styles.p4]}>
<Text
numberOfLines={1}
style={[styles.textLabelSupporting, styles.lh16]}
Expand All @@ -81,25 +80,21 @@ function WorkspaceCompanyCardsList({policyID, cardsList, selectedFeed}: Workspac
);

return (
<ScreenWrapper
shouldEnablePickerAvoiding={false}
shouldShowOfflineIndicatorInWideScreen
shouldEnableMaxHeight
testID={WorkspaceCompanyCardsList.displayName}
>
<View style={styles.flex1}>
<WorkspaceCompanyCardsListHeaderButtons
policyID={policyID}
selectedFeed={selectedFeed}
/>
<FlatList
contentContainerStyle={styles.flexGrow1}
data={sortedCards}
renderItem={renderItem}
ListHeaderComponent={renderListHeader}
stickyHeaderIndices={[0]}
scrollIndicatorInsets={{right: Number.MIN_VALUE}}
/>
</ScreenWrapper>
</View>
);
}

WorkspaceCompanyCardsList.displayName = 'WorkspaceCompanyCardsList';

export default WorkspaceCompanyCardsList;
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function WorkspaceCompanyCardsListHeaderButtons({policyID, selectedFeed}: Worksp
const cardFeeds = mockedFeeds ?? {};

return (
<View style={[styles.w100, styles.ph5, !shouldUseNarrowLayout && [styles.pv2, styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween]]}>
<View style={[styles.w100, styles.ph5, !shouldUseNarrowLayout ? [styles.pv2, styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween] : styles.pb2]}>
<PressableWithFeedback
onPress={() => Navigation.navigate(ROUTES.WORKSPACE_COMPANY_CARDS_SELECT_FEED.getRoute(policyID))}
style={[styles.flexRow, styles.alignItemsCenter, styles.gap3, styles.ml4, shouldUseNarrowLayout && styles.mb3]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function WorkspaceCompanyCardsListRow({cardholder, name, cardNumber}: WorkspaceC
type={CONST.ICON_TYPE_AVATAR}
size={CONST.AVATAR_SIZE.DEFAULT}
/>
<View style={styles.flex1}>
<View>
<Text
numberOfLines={1}
style={[styles.optionDisplayName, styles.textStrong, styles.pre]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ function WorkspaceCompanyCardPage({route}: WorkspaceCompanyCardPageProps) {
featureName={CONST.POLICY.MORE_FEATURES.ARE_COMPANY_CARDS_ENABLED}
>
<WorkspacePageWithSections
shouldUseScrollView
icon={Illustrations.CompanyCard}
headerText={translate('workspace.common.companyCards')}
route={route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_COMPANY_CARDS}
shouldShowOfflineIndicatorInWideScreen
includeSafeAreaPaddingBottom
>
<WorkspaceCompanyCardsList
cardsList={cardsList}
Expand Down

0 comments on commit 4df965d

Please sign in to comment.