From b1ed06016cd4fd42b9c54ac0d3064032ff936d39 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 12 Feb 2024 01:33:52 +0530 Subject: [PATCH] added workspace options in NewRoomWorkspaceSelector. Signed-off-by: Krishna Gupta --- .../NewRoomPage/NewRoomWorkspaceSelector.js | 16 +++++++++------- .../NewRoomPage/WorkspaceNewRoomPage.js | 18 ++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/pages/workspace/NewRoomPage/NewRoomWorkspaceSelector.js b/src/pages/workspace/NewRoomPage/NewRoomWorkspaceSelector.js index c64cb2568c9e..33bc64498f84 100644 --- a/src/pages/workspace/NewRoomPage/NewRoomWorkspaceSelector.js +++ b/src/pages/workspace/NewRoomPage/NewRoomWorkspaceSelector.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import {useMemo, useState} from 'react'; +import React, {useMemo, useState} from 'react'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; @@ -7,6 +7,7 @@ import ScreenWrapper from '@components/ScreenWrapper'; import SelectionList from '@components/SelectionList'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -57,12 +58,13 @@ function NewRoomWorkspaceSelector(props) { _.map( _.filter(PolicyUtils.getActivePolicies(props.policies), (policy) => policy.type !== CONST.POLICY.TYPE.PERSONAL), (policy) => ({ - label: policy.name, - key: policy.id, value: policy.id, + keyForList: policy.id, + text: policy.name, + isSelected: props.activePolicyID === policy.id, }), ), - [props.policies], + [props.policies, props.activePolicyID], ); const [policyID, setPolicyID] = useState(() => { @@ -77,14 +79,14 @@ function NewRoomWorkspaceSelector(props) { style={[styles.pb0]} includePaddingTop={false} includeSafeAreaPaddingBottom={false} - testID="ValueSelectorModal" + testID={NewRoomWorkspaceSelector.displayName} > {}} + onBackButtonPress={Navigation.goBack} /> - Navigation.navigate(ROUTES.NEW_ROOM_WORKSPACE_SELECTOR)} - // disabled={didConfirm} - // interactive={!isReadOnly} - /> + + Navigation.navigate(ROUTES.NEW_ROOM_WORKSPACE_SELECTOR)} + /> + {isSmallScreenWidth && }