From ac7c6b0ef6e1aa99d08a88374a9b7944d217542d Mon Sep 17 00:00:00 2001
From: Carlos Martins <cmartins@expensify.com>
Date: Wed, 17 Aug 2022 16:50:01 -0600
Subject: [PATCH] rm loading, add not found

---
 src/pages/workspace/WorkspaceSettingsPage.js | 128 +++++++++----------
 1 file changed, 63 insertions(+), 65 deletions(-)

diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js
index 3b20f0e86c39..2763b616d8c9 100644
--- a/src/pages/workspace/WorkspaceSettingsPage.js
+++ b/src/pages/workspace/WorkspaceSettingsPage.js
@@ -18,9 +18,9 @@ import Picker from '../../components/Picker';
 import TextInput from '../../components/TextInput';
 import FixedFooter from '../../components/FixedFooter';
 import WorkspacePageWithSections from './WorkspacePageWithSections';
-import FullScreenLoadingIndicator from '../../components/FullscreenLoadingIndicator';
 import withFullPolicy, {fullPolicyPropTypes, fullPolicyDefaultProps} from './withFullPolicy';
 import {withNetwork} from '../../components/OnyxProvider';
+import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView';
 
 const propTypes = {
     ...fullPolicyPropTypes,
@@ -96,73 +96,71 @@ class WorkspaceSettingsPage extends React.Component {
     }
 
     render() {
-        if (_.isEmpty(this.props.policy)) {
-            return <FullScreenLoadingIndicator />;
-        }
-
         return (
-            <WorkspacePageWithSections
-                headerText={this.props.translate('workspace.common.settings')}
-                route={this.props.route}
-                guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_SETTINGS}
-                footer={(
-                    <FixedFooter style={[styles.w100]}>
-                        <Button
-                            success
-                            isLoading={this.props.policy.isPolicyUpdating}
-                            text={this.props.translate('workspace.editor.save')}
-                            onPress={this.submit}
-                            pressOnEnter
-                        />
-                    </FixedFooter>
-                )}
-            >
-                {hasVBA => (
-                    <View style={[styles.pageWrapper, styles.flex1, styles.alignItemsStretch]}>
-                        <AvatarWithImagePicker
-                            isUploading={this.props.policy.isAvatarUploading}
-                            avatarURL={this.state.previewAvatarURL}
-                            size={CONST.AVATAR_SIZE.LARGE}
-                            DefaultAvatar={() => (
-                                <Icon
-                                    src={Expensicons.Workspace}
-                                    height={80}
-                                    width={80}
-                                    fill={defaultTheme.iconSuccessFill}
-                                />
-                            )}
-                            fallbackIcon={Expensicons.FallbackWorkspaceAvatar}
-                            style={[styles.mb3]}
-                            anchorPosition={{top: 172, right: 18}}
-                            isUsingDefaultAvatar={!this.state.previewAvatarURL}
-                            onImageSelected={this.uploadAvatar}
-                            onImageRemoved={this.removeAvatar}
-                        />
-
-                        <TextInput
-                            label={this.props.translate('workspace.editor.nameInputLabel')}
-                            containerStyles={[styles.mt4]}
-                            onChangeText={name => this.setState({name})}
-                            value={this.state.name}
-                            hasError={!this.state.name.trim().length}
-                            errorText={this.state.name.trim().length ? '' : this.props.translate('workspace.editor.nameIsRequiredError')}
-                        />
-
-                        <View style={[styles.mt4]}>
-                            <Picker
-                                label={this.props.translate('workspace.editor.currencyInputLabel')}
-                                onInputChange={currency => this.setState({currency})}
-                                items={this.getCurrencyItems()}
-                                value={this.state.currency}
-                                isDisabled={hasVBA}
+            <FullPageNotFoundView shouldShow={_.isEmpty(this.props.policy)}>
+                <WorkspacePageWithSections
+                    headerText={this.props.translate('workspace.common.settings')}
+                    route={this.props.route}
+                    guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_SETTINGS}
+                    footer={(
+                        <FixedFooter style={[styles.w100]}>
+                            <Button
+                                success
+                                isLoading={this.props.policy.isPolicyUpdating}
+                                text={this.props.translate('workspace.editor.save')}
+                                onPress={this.submit}
+                                pressOnEnter
+                            />
+                        </FixedFooter>
+                    )}
+                >
+                    {hasVBA => (
+                        <View style={[styles.pageWrapper, styles.flex1, styles.alignItemsStretch]}>
+                            <AvatarWithImagePicker
+                                isUploading={this.props.policy.isAvatarUploading}
+                                avatarURL={this.state.previewAvatarURL}
+                                size={CONST.AVATAR_SIZE.LARGE}
+                                DefaultAvatar={() => (
+                                    <Icon
+                                        src={Expensicons.Workspace}
+                                        height={80}
+                                        width={80}
+                                        fill={defaultTheme.iconSuccessFill}
+                                    />
+                                )}
+                                fallbackIcon={Expensicons.FallbackWorkspaceAvatar}
+                                style={[styles.mb3]}
+                                anchorPosition={{top: 172, right: 18}}
+                                isUsingDefaultAvatar={!this.state.previewAvatarURL}
+                                onImageSelected={this.uploadAvatar}
+                                onImageRemoved={this.removeAvatar}
                             />
+
+                            <TextInput
+                                label={this.props.translate('workspace.editor.nameInputLabel')}
+                                containerStyles={[styles.mt4]}
+                                onChangeText={name => this.setState({name})}
+                                value={this.state.name}
+                                hasError={!this.state.name.trim().length}
+                                errorText={this.state.name.trim().length ? '' : this.props.translate('workspace.editor.nameIsRequiredError')}
+                            />
+
+                            <View style={[styles.mt4]}>
+                                <Picker
+                                    label={this.props.translate('workspace.editor.currencyInputLabel')}
+                                    onInputChange={currency => this.setState({currency})}
+                                    items={this.getCurrencyItems()}
+                                    value={this.state.currency}
+                                    isDisabled={hasVBA}
+                                />
+                            </View>
+                            <Text style={[styles.textLabel, styles.colorMuted, styles.mt2]}>
+                                {this.props.translate('workspace.editor.currencyInputHelpText')}
+                            </Text>
                         </View>
-                        <Text style={[styles.textLabel, styles.colorMuted, styles.mt2]}>
-                            {this.props.translate('workspace.editor.currencyInputHelpText')}
-                        </Text>
-                    </View>
-                )}
-            </WorkspacePageWithSections>
+                    )}
+                </WorkspacePageWithSections>
+            </FullPageNotFoundView>
         );
     }
 }
