Skip to content

Commit

Permalink
implement ReferralDetailsPageIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Jan 11, 2024
1 parent 7b89001 commit 63cbf53
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 14 deletions.
18 changes: 18 additions & 0 deletions src/components/ReferralDetailsPageIcon/index.native.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import Icon from '@components/Icon';
import {PaymentHands} from '@components/Icon/Illustrations';
import useWindowDimensions from '@hooks/useWindowDimensions';

function ReferralDetailsPageIcon() {
const {windowWidth} = useWindowDimensions();

return (
<Icon
src={PaymentHands}
width={windowWidth}
height={232}
/>
);
}

export default ReferralDetailsPageIcon;
18 changes: 18 additions & 0 deletions src/components/ReferralDetailsPageIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import Icon from '@components/Icon';
import {PaymentHands} from '@components/Icon/Illustrations';
import useWindowDimensions from '@hooks/useWindowDimensions';

function ReferralDetailsPageIcon() {
const {windowWidth} = useWindowDimensions();

return (
<Icon
src={PaymentHands}
width={windowWidth * 2}
height={232}
/>
);
}

export default ReferralDetailsPageIcon;
16 changes: 2 additions & 14 deletions src/pages/ReferralDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import ContextMenuItem from '@components/ContextMenuItem';
import HeaderPageLayout from '@components/HeaderPageLayout';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import {PaymentHands} from '@components/Icon/Illustrations';
import MenuItem from '@components/MenuItem';
import ReferralDetailsPageIcon from '@components/ReferralDetailsPageIcon';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useSingleExecution from '@hooks/useSingleExecution';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Clipboard from '@libs/Clipboard';
import getPlatform from '@libs/getPlatform';
import * as Link from '@userActions/Link';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -45,12 +42,9 @@ const defaultProps = {
function ReferralDetailsPage({route, account}) {
const theme = useTheme();
const styles = useThemeStyles();
const {windowWidth} = useWindowDimensions();
const {translate} = useLocalize();
const popoverAnchor = useRef(null);
const {isExecuting, singleExecution} = useSingleExecution();
const platform = getPlatform();
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;
let {contentType} = route.params;

if (!_.includes(_.values(CONST.REFERRAL_PROGRAM.CONTENT_TYPES), contentType)) {
Expand All @@ -66,13 +60,7 @@ function ReferralDetailsPage({route, account}) {
return (
<HeaderPageLayout
title={translate('common.referral')}
headerContent={
<Icon
src={PaymentHands}
width={isNative ? windowWidth : windowWidth * 2}
height={232}
/>
}
headerContent={<ReferralDetailsPageIcon />}
headerContainerStyles={[styles.staticHeaderImage, styles.justifyContentEnd]}
backgroundColor={theme.PAGE_THEMES[SCREENS.RIGHT_MODAL.REFERRAL].backgroundColor}
>
Expand Down

0 comments on commit 63cbf53

Please sign in to comment.