Skip to content

Commit

Permalink
added workspace options in NewRoomWorkspaceSelector.
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Gupta <[email protected]>
  • Loading branch information
Krishna2323 committed Feb 11, 2024
1 parent a64a9fa commit b1ed060
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 9 additions & 7 deletions src/pages/workspace/NewRoomPage/NewRoomWorkspaceSelector.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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';
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';
Expand Down Expand Up @@ -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(() => {
Expand All @@ -77,14 +79,14 @@ function NewRoomWorkspaceSelector(props) {
style={[styles.pb0]}
includePaddingTop={false}
includeSafeAreaPaddingBottom={false}
testID="ValueSelectorModal"
testID={NewRoomWorkspaceSelector.displayName}
>
<HeaderWithBackButton
title={translate('workspace.common.workspace')}
onBackButtonPress={() => {}}
onBackButtonPress={Navigation.goBack}
/>
<SelectionList
sections={workspaceOptions}
sections={[{data: workspaceOptions}]}
value={policyID}
onSelectRow={setPolicyID}
initiallyFocusedOptionKey={policyID}
Expand Down
18 changes: 8 additions & 10 deletions src/pages/workspace/NewRoomPage/WorkspaceNewRoomPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,16 +377,14 @@ function WorkspaceNewRoomPage(props) {
shouldShowTooltips={false}
/>
</View>
<MenuItemWithTopDescription
// shouldShowRightIcon={!isReadOnly}
title={'taxRateTitle'}
description={'policyTaxRates.name'}
style={[styles.moneyRequestMenuItem]}
titleStyle={styles.flex1}
onPress={() => Navigation.navigate(ROUTES.NEW_ROOM_WORKSPACE_SELECTOR)}
// disabled={didConfirm}
// interactive={!isReadOnly}
/>
<View style={[styles.flex1]}>
<MenuItemWithTopDescription
shouldShowRightIcon
title={`Workspace 77`}

Check failure on line 383 in src/pages/workspace/NewRoomPage/WorkspaceNewRoomPage.js

View workflow job for this annotation

GitHub Actions / lint

Curly braces are unnecessary here
description={'Description'}

Check failure on line 384 in src/pages/workspace/NewRoomPage/WorkspaceNewRoomPage.js

View workflow job for this annotation

GitHub Actions / lint

Curly braces are unnecessary here
onPress={() => Navigation.navigate(ROUTES.NEW_ROOM_WORKSPACE_SELECTOR)}
/>
</View>
</FormProvider>

{isSmallScreenWidth && <OfflineIndicator />}
Expand Down

0 comments on commit b1ed060

Please sign in to comment.