This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: block screen [SGW-3617] #788
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ import { useTranslate } from "../../hooks/useTranslate/useTranslate"; | |
import { extractPassportIdFromEvent } from "../../utils/passportScanning"; | ||
import { useTheme } from "../../context/theme"; | ||
import { useIsFocused } from "@react-navigation/native"; | ||
import { BlockUser } from "../Login/BlockUser"; | ||
|
||
const styles = StyleSheet.create({ | ||
content: { | ||
|
@@ -271,78 +272,88 @@ export const CollectCustomerDetailsScreen: FunctionComponent< | |
|
||
const tCampaignName = c13nt(features?.campaignName ?? ""); | ||
|
||
const [shouldBlock, setShouldBlock] = useState(true); | ||
useEffect(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. block for the first time when user navigates to Screen.Recording.2024-06-04.at.1.49.04.PM.mov |
||
setShouldBlock(true); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<Credits style={{ bottom: size(3) }} /> | ||
<KeyboardAvoidingScrollView> | ||
<TopBackground mode={config.appMode} /> | ||
<View style={styles.content}> | ||
<View style={styles.headerText}> | ||
<AppHeader mode={config.appMode} /> | ||
</View> | ||
{hasMultiInputSelection() && ( | ||
<InputSelection | ||
selectionArray={selectionArray} | ||
currentSelection={selectedIdType} | ||
onInputSelection={onInputSelection} | ||
/> | ||
)} | ||
{messageContent && ( | ||
<View style={styles.bannerWrapper}> | ||
<Banner {...messageContent} /> | ||
</View> | ||
)} | ||
<Card> | ||
{!!tCampaignName && ( | ||
<AppText | ||
style={styles.campaignName} | ||
accessibilityLabel="identity-details-campaign-name" | ||
testID="identity-details-campaign-name" | ||
accessible={true} | ||
{shouldBlock && <BlockUser setShouldBlock={setShouldBlock} />} | ||
{!shouldBlock && ( | ||
<> | ||
<Credits style={{ bottom: size(3) }} /> | ||
<KeyboardAvoidingScrollView> | ||
<TopBackground mode={config.appMode} /> | ||
<View style={styles.content}> | ||
<View style={styles.headerText}> | ||
<AppHeader mode={config.appMode} /> | ||
</View> | ||
{hasMultiInputSelection() && ( | ||
<InputSelection | ||
selectionArray={selectionArray} | ||
currentSelection={selectedIdType} | ||
onInputSelection={onInputSelection} | ||
/> | ||
)} | ||
{messageContent && ( | ||
<View style={styles.bannerWrapper}> | ||
<Banner {...messageContent} /> | ||
</View> | ||
)} | ||
<Card> | ||
{!!tCampaignName && ( | ||
<AppText | ||
style={styles.campaignName} | ||
accessibilityLabel="identity-details-campaign-name" | ||
testID="identity-details-campaign-name" | ||
accessible={true} | ||
> | ||
{tCampaignName} | ||
</AppText> | ||
)} | ||
<AppText> | ||
{`${c13nt( | ||
"checkEligibleItems", | ||
undefined, | ||
i18nt("collectCustomerDetailsScreen", "checkEligibleItems") | ||
)}`} | ||
</AppText> | ||
{getInputComponent()} | ||
</Card> | ||
<TouchableOpacity | ||
onPress={onPressStatistics} | ||
style={styles.statsButton} | ||
> | ||
{tCampaignName} | ||
</AppText> | ||
)} | ||
<AppText> | ||
{`${c13nt( | ||
"checkEligibleItems", | ||
undefined, | ||
i18nt("collectCustomerDetailsScreen", "checkEligibleItems") | ||
)}`} | ||
</AppText> | ||
{getInputComponent()} | ||
</Card> | ||
<TouchableOpacity | ||
onPress={onPressStatistics} | ||
style={styles.statsButton} | ||
> | ||
<MaterialCommunityIcons | ||
style={styles.statsIcon} | ||
name="poll" | ||
size={size(2)} | ||
color={theme.collectCustomerDetails.statsIconColor} | ||
<MaterialCommunityIcons | ||
style={styles.statsIcon} | ||
name="poll" | ||
size={size(2)} | ||
color={theme.collectCustomerDetails.statsIconColor} | ||
/> | ||
<AppText | ||
style={styles.statsText} | ||
accessibilityLabel="go-to-statistics" | ||
testID="go-to-statistics" | ||
accessible={true} | ||
> | ||
{i18nt("collectCustomerDetailsScreen", "goToStatistics")} | ||
</AppText> | ||
</TouchableOpacity> | ||
<FeatureToggler feature="HELP_MODAL"> | ||
<HelpButton onPress={showHelpModal} /> | ||
</FeatureToggler> | ||
</View> | ||
</KeyboardAvoidingScrollView> | ||
{shouldShowCamera && ( | ||
<IdScanner | ||
isScanningEnabled={isScanningEnabled} | ||
onBarCodeScanned={onBarCodeScanned} | ||
onCancel={() => setShouldShowCamera(false)} | ||
barCodeTypes={getBarcodeType()} | ||
/> | ||
<AppText | ||
style={styles.statsText} | ||
accessibilityLabel="go-to-statistics" | ||
testID="go-to-statistics" | ||
accessible={true} | ||
> | ||
{i18nt("collectCustomerDetailsScreen", "goToStatistics")} | ||
</AppText> | ||
</TouchableOpacity> | ||
<FeatureToggler feature="HELP_MODAL"> | ||
<HelpButton onPress={showHelpModal} /> | ||
</FeatureToggler> | ||
</View> | ||
</KeyboardAvoidingScrollView> | ||
{shouldShowCamera && ( | ||
<IdScanner | ||
isScanningEnabled={isScanningEnabled} | ||
onBarCodeScanned={onBarCodeScanned} | ||
onCancel={() => setShouldShowCamera(false)} | ||
barCodeTypes={getBarcodeType()} | ||
/> | ||
)} | ||
</> | ||
)} | ||
</> | ||
); | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this screen is blocked, all tests require additional button click to reach original screen