From e992ac478fe8901fe2f6af5bb6298ecc4752c67a Mon Sep 17 00:00:00 2001
From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com>
Date: Mon, 19 Feb 2024 17:07:30 +0100
Subject: [PATCH 1/7] update Share code and Status buttons
---
src/pages/settings/InitialSettingsPage.js | 46 ++++++++++++++++++++---
src/styles/index.ts | 15 ++++++++
2 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js
index 941cdb2f0643..d3868d18cb4e 100755
--- a/src/pages/settings/InitialSettingsPage.js
+++ b/src/pages/settings/InitialSettingsPage.js
@@ -11,11 +11,14 @@ import cardPropTypes from '@components/cardPropTypes';
import ConfirmModal from '@components/ConfirmModal';
import CurrentUserPersonalDetailsSkeletonView from '@components/CurrentUserPersonalDetailsSkeletonView';
import HeaderPageLayout from '@components/HeaderPageLayout';
+import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import MenuItem from '@components/MenuItem';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {withNetwork} from '@components/OnyxProvider';
+import {PressableWithFeedback} from '@components/Pressable';
import Text from '@components/Text';
+import Tooltip from '@components/Tooltip';
import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsDefaultProps, withCurrentUserPersonalDetailsPropTypes} from '@components/withCurrentUserPersonalDetails';
import withLocalize, {withLocalizePropTypes} from '@components/withLocalize';
import useLocalize from '@hooks/useLocalize';
@@ -31,6 +34,7 @@ import Navigation from '@libs/Navigation/Navigation';
import * as UserUtils from '@libs/UserUtils';
import walletTermsPropTypes from '@pages/EnablePayments/walletTermsPropTypes';
import * as ReportActionContextMenu from '@pages/home/report/ContextMenu/ReportActionContextMenu';
+import variables from '@styles/variables';
import * as Link from '@userActions/Link';
import * as PaymentMethods from '@userActions/PaymentMethods';
import * as PersonalDetails from '@userActions/PersonalDetails';
@@ -100,6 +104,7 @@ function InitialSettingsPage(props) {
const popoverAnchor = useRef(null);
const {translate} = useLocalize();
const activeRoute = useNavigationState(getTopmostSettingsCentralPaneName);
+ const emojiCode = lodashGet(props, 'currentUserPersonalDetails.status.emojiCode', '');
const [shouldShowSignoutConfirmModal, setShouldShowSignoutConfirmModal] = useState(false);
@@ -151,11 +156,6 @@ function InitialSettingsPage(props) {
? 'error'
: null,
},
- {
- translationKey: 'common.shareCode',
- icon: Expensicons.QrCode,
- routeName: ROUTES.SETTINGS_SHARE_CODE,
- },
{
translationKey: 'common.preferences',
icon: Expensicons.Gear,
@@ -332,6 +332,42 @@ function InitialSettingsPage(props) {
) : (
<>
+
+
+ Navigation.navigate(ROUTES.SETTINGS_SHARE_CODE)}
+ >
+
+
+
+
+
+
+ Navigation.navigate(ROUTES.SETTINGS_STATUS)}
+ >
+
+ {emojiCode ? (
+ {emojiCode}
+ ) : (
+
+ )}
+
+
+
+
bottom: -8,
},
+ primaryMediumIcon: {
+ alignItems: 'center',
+ backgroundColor: theme.buttonDefaultBG,
+ borderRadius: 20,
+ color: theme.textReversed,
+ height: 40,
+ width: 40,
+ justifyContent: 'center',
+ },
+
+ primaryMediumText: {
+ fontSize: variables.iconSizeNormal,
+ lineHeight: variables.iconSizeNormal,
+ },
+
workspaceOwnerAvatarWrapper: {
margin: 6,
},
From 6d3b7bc4216a2ae1c560e945b8d1299564b8c278 Mon Sep 17 00:00:00 2001
From: Jakub Kosmydel <104823336+kosmydel@users.noreply.github.com>
Date: Tue, 20 Feb 2024 16:38:02 +0100
Subject: [PATCH 2/7] move sharecode to RHP
---
src/components/QRShare/index.tsx | 9 +-
.../AppNavigator/ModalStackNavigators.tsx | 2 +-
.../FULL_SCREEN_TO_RHP_MAPPING.ts | 1 +
src/libs/Navigation/linkingConfig/config.ts | 7 +-
src/libs/Navigation/types.ts | 2 +-
src/pages/ShareCodePage.tsx | 96 ++++++++-----------
src/styles/index.ts | 1 -
7 files changed, 47 insertions(+), 71 deletions(-)
diff --git a/src/components/QRShare/index.tsx b/src/components/QRShare/index.tsx
index 45a4a4fd4964..c7e9e7637a6c 100644
--- a/src/components/QRShare/index.tsx
+++ b/src/components/QRShare/index.tsx
@@ -9,15 +9,12 @@ import QRCode from '@components/QRCode';
import Text from '@components/Text';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
-import useWindowDimensions from '@hooks/useWindowDimensions';
import variables from '@styles/variables';
-import CONST from '@src/CONST';
import type {QRShareHandle, QRShareProps} from './types';
function QRShare({url, title, subtitle, logo, logoRatio, logoMarginRatio}: QRShareProps, ref: ForwardedRef) {
const styles = useThemeStyles();
const theme = useTheme();
- const {isSmallScreenWidth} = useWindowDimensions();
const [qrCodeSize, setQrCodeSize] = useState(1);
const svgRef = useRef