Page MenuHomePhabricator

D5514.id18006.diff
No OneTemporary

D5514.id18006.diff

diff --git a/native/account/logged-out-modal.react.js b/native/account/logged-out-modal.react.js
--- a/native/account/logged-out-modal.react.js
+++ b/native/account/logged-out-modal.react.js
@@ -2,6 +2,7 @@
import _isEqual from 'lodash/fp/isEqual';
import * as React from 'react';
+import { useContext } from 'react';
import {
View,
StyleSheet,
@@ -41,12 +42,14 @@
derivedDimensionsInfoSelector,
} from '../selectors/dimensions-selectors';
import { splashStyleSelector } from '../splash';
+import { StaffContext } from '../staff/staff-context';
import type { EventSubscription, KeyboardEvent } from '../types/react-native';
import type { ImageStyle } from '../types/styles';
import {
runTiming,
ratchetAlongWithKeyboardHeight,
} from '../utils/animation-utils';
+import { useStaffCanSee } from '../utils/staff-utils';
import {
type StateContainer,
type StateChange,
@@ -114,6 +117,8 @@
+splashStyle: ImageStyle,
// Redux dispatch functions
+dispatch: Dispatch,
+ +staffUserHasBeenLoggedIn: boolean,
+ +staffCanSee: boolean,
...
};
type State = {
@@ -463,6 +468,19 @@
</TouchableOpacity>
);
}
+ let staffUserHasBeenLoggedInIndicator = null;
+ if (this.props.staffCanSee && this.props.staffUserHasBeenLoggedIn) {
+ staffUserHasBeenLoggedInIndicator = (
+ <TouchableOpacity
+ onPress={undefined}
+ style={styles.button}
+ activeOpacity={0.6}
+ >
+ <Text style={styles.buttonText}>STAFF HAS BEEN LOGGED IN</Text>
+ </TouchableOpacity>
+ );
+ }
+
if (this.state.mode === 'siwe') {
panel = (
<SIWEPanel
@@ -490,6 +508,7 @@
const opacityStyle = { opacity: this.buttonOpacity };
buttons = (
<Animated.View style={[styles.buttonContainer, opacityStyle]}>
+ {staffUserHasBeenLoggedInIndicator}
{siweButton}
<TouchableOpacity
onPress={this.onPressLogIn}
@@ -658,6 +677,8 @@
const loggedIn = useSelector(isLoggedIn);
const dimensions = useSelector(derivedDimensionsInfoSelector);
const splashStyle = useSelector(splashStyleSelector);
+ const { staffUserHasBeenLoggedIn } = useContext(StaffContext);
+ const staffCanSee = useStaffCanSee();
const dispatch = useDispatch();
return (
@@ -672,6 +693,8 @@
dimensions={dimensions}
splashStyle={splashStyle}
dispatch={dispatch}
+ staffUserHasBeenLoggedIn={staffUserHasBeenLoggedIn}
+ staffCanSee={staffCanSee}
/>
);
});

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 11:50 AM (10 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596886
Default Alt Text
D5514.id18006.diff (2 KB)

Event Timeline