Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Jan 8, 2024
1 parent 7f40468 commit 32016b1
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components/Section/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ const defaultProps = {

function Section({children, childrenStyles, containerStyles, icon, IconComponent, cardLayout, iconContainerStyles, menuItems, subtitle, subtitleStyles, subtitleMuted, title, titleStyles}) {
const styles = useThemeStyles();
const {isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth} = useWindowDimensions();

return (
<>
<View style={[styles.pageWrapper, styles.cardSection, ...containerStyles, isMobileScreenWidth ? styles.p5 : styles.p8]}>
<View style={[styles.pageWrapper, styles.cardSection, ...containerStyles, isSmallScreenWidth ? styles.p5 : styles.p8]}>
{cardLayout === CARD_LAYOUT.ICON_ON_TOP && (
<IconSection
icon={icon}
Expand Down
2 changes: 0 additions & 2 deletions src/hooks/useWindowDimensions/index.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default function (): WindowDimensions {
const isSmallScreenWidth = true;
const isMediumScreenWidth = false;
const isLargeScreenWidth = false;
const isMobileScreenWidth = true;

return {
windowWidth,
Expand All @@ -21,6 +20,5 @@ export default function (): WindowDimensions {
isSmallScreenWidth,
isMediumScreenWidth,
isLargeScreenWidth,
isMobileScreenWidth,
};
}
2 changes: 0 additions & 2 deletions src/hooks/useWindowDimensions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function (): WindowDimensions {
const isSmallScreenWidth = windowWidth <= variables.mobileResponsiveWidthBreakpoint;
const isMediumScreenWidth = windowWidth > variables.mobileResponsiveWidthBreakpoint && windowWidth <= variables.tabletResponsiveWidthBreakpoint;
const isLargeScreenWidth = windowWidth > variables.tabletResponsiveWidthBreakpoint;
const isMobileScreenWidth = isExtraSmallScreenHeight || isSmallScreenWidth;

return {
windowWidth,
Expand All @@ -23,6 +22,5 @@ export default function (): WindowDimensions {
isSmallScreenWidth,
isMediumScreenWidth,
isLargeScreenWidth,
isMobileScreenWidth,
};
}
1 change: 0 additions & 1 deletion src/hooks/useWindowDimensions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ type WindowDimensions = {
isSmallScreenWidth: boolean;
isMediumScreenWidth: boolean;
isLargeScreenWidth: boolean;
isMobileScreenWidth: boolean;
};

export default WindowDimensions;
4 changes: 2 additions & 2 deletions src/pages/settings/Wallet/WalletPage/WalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
const theme = useTheme();
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isSmallScreenWidth, windowWidth, isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth, windowWidth, isSmallScreenWidth} = useWindowDimensions();
const [shouldShowAddPaymentMenu, setShouldShowAddPaymentMenu] = useState(false);
const [shouldShowDefaultDeleteMenu, setShouldShowDefaultDeleteMenu] = useState(false);
const [shouldShowLoadingSpinner, setShouldShowLoadingSpinner] = useState(false);
Expand Down Expand Up @@ -342,7 +342,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS.ROOT)}
shouldShowBackButton={isSmallScreenWidth}
/>
<View style={[styles.flex1, isMobileScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<View style={[styles.flex1, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<ScrollView>
<OfflineWithFeedback
style={styles.flex1}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/bills/WorkspaceBillsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const propTypes = {

function WorkspaceBillsPage(props) {
const styles = useThemeStyles();
const {isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth} = useWindowDimensions();

return (
<WorkspacePageWithSections
Expand All @@ -35,7 +35,7 @@ function WorkspaceBillsPage(props) {
isCentralPane
>
{(hasVBA, policyID) => (
<View style={[styles.mt6, isMobileScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<View style={[styles.mt6, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasVBA && <WorkspaceBillsNoVBAView policyID={policyID} />}
{hasVBA && <WorkspaceBillsVBAView policyID={policyID} />}
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/card/WorkspaceCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const propTypes = {

function WorkspaceCardPage(props) {
const styles = useThemeStyles();
const {isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth} = useWindowDimensions();

return (
<WorkspacePageWithSections
Expand All @@ -36,7 +36,7 @@ function WorkspaceCardPage(props) {
isCentralPane
>
{(hasVBA, policyID, isUsingECard) => (
<View style={[styles.mt6, isMobileScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<View style={[styles.mt6, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasVBA && <WorkspaceCardNoVBAView policyID={policyID} />}

{hasVBA && !isUsingECard && <WorkspaceCardVBANoECardView />}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/invoices/WorkspaceInvoicesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const propTypes = {

function WorkspaceInvoicesPage(props) {
const styles = useThemeStyles();
const {isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth} = useWindowDimensions();

return (
<WorkspacePageWithSections
Expand All @@ -35,7 +35,7 @@ function WorkspaceInvoicesPage(props) {
isCentralPane
>
{(hasVBA, policyID) => (
<View style={[styles.mt6, isMobileScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<View style={[styles.mt6, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasVBA && <WorkspaceInvoicesNoVBAView policyID={policyID} />}
{hasVBA && <WorkspaceInvoicesVBAView policyID={policyID} />}
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/reimburse/WorkspaceReimburseView.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const defaultProps = {
function WorkspaceReimburseView(props) {
const styles = useThemeStyles();
const [currentRatePerUnit, setCurrentRatePerUnit] = useState('');
const {isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth} = useWindowDimensions();
const viewAllReceiptsUrl = `expenses?policyIDList=${props.policy.id}&billableReimbursable=reimbursable&submitterEmail=%2B%2B`;
const distanceCustomUnit = _.find(lodashGet(props.policy, 'customUnits', {}), (unit) => unit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE);
const distanceCustomRate = _.find(lodashGet(distanceCustomUnit, 'rates', {}), (rate) => rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE);
Expand Down Expand Up @@ -105,7 +105,7 @@ function WorkspaceReimburseView(props) {
}, [props.policy.customUnits, getCurrentRatePerUnitLabel]);

return (
<View style={[styles.mt6, isMobileScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<View style={[styles.mt6, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section
title={translate('workspace.reimburse.captureReceipts')}
icon={Illustrations.MoneyReceipts}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/travel/WorkspaceTravelPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const propTypes = {

function WorkspaceTravelPage(props) {
const styles = useThemeStyles();
const {isMobileScreenWidth} = useWindowDimensions();
const {isSmallScreenWidth} = useWindowDimensions();

return (
<WorkspacePageWithSections
Expand All @@ -35,7 +35,7 @@ function WorkspaceTravelPage(props) {
isCentralPane
>
{(hasVBA, policyID) => (
<View style={[styles.mt6, isMobileScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<View style={[styles.mt6, isSmallScreenWidth ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasVBA && <WorkspaceTravelNoVBAView policyID={policyID} />}
{hasVBA && <WorkspaceTravelVBAView />}
</View>
Expand Down

0 comments on commit 32016b1

Please sign in to comment.