Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions apps/main-app/ts/components/LoadingSpinnerOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,23 @@ import { ReactNode } from "react";
import { StyleSheet, View } from "react-native";

import BoxedRefreshIndicator from "./ui/BoxedRefreshIndicator";
import { Overlay } from "./ui/Overlay";

const styles = StyleSheet.create({
container: {
flex: 1
},
overlay: {
position: "absolute",
top: 0,
bottom: 0,
left: 0,
right: 0,
zIndex: 1,
justifyContent: "center"
},
content: {
zIndex: 0
},
textCaption: {
padding: 24
}
Expand All @@ -39,13 +53,19 @@ const LoadingSpinnerOverlay = ({
const theme = useIOTheme();

return (
<Overlay
backgroundColor={hexToRgba(
IOColors[theme["appBackground-primary"]],
loadingOpacity
)}
foreground={
isLoading && (
<View style={styles.container} testID="overlayComponent">
{isLoading && (
<View
style={[
styles.overlay,
{
backgroundColor: hexToRgba(
IOColors[theme["appBackground-primary"]],
loadingOpacity
)
}
]}
>
<BoxedRefreshIndicator
action={
onCancel && (
Expand All @@ -71,11 +91,10 @@ const LoadingSpinnerOverlay = ({
</View>
}
/>
)
}
>
{children}
</Overlay>
</View>
)}
<View style={[styles.container, styles.content]}>{children}</View>
</View>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exports[`LoadingSpinnerOverlay Should match all-properties and loading snapshot
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -24,7 +23,6 @@ exports[`LoadingSpinnerOverlay Should match all-properties and loading snapshot
},
{
"backgroundColor": "rgba(255,255,255,0.65)",
"opacity": 1,
},
]
}
Expand Down Expand Up @@ -569,7 +567,6 @@ exports[`LoadingSpinnerOverlay Should match base loading snapshot 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -580,7 +577,6 @@ exports[`LoadingSpinnerOverlay Should match base loading snapshot 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,0.7)",
"opacity": 1,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exports[`WebviewComponent tests snapshot for component 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -24,7 +23,6 @@ exports[`WebviewComponent tests snapshot for component 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,0.7)",
"opacity": 1,
},
]
}
Expand Down
63 changes: 0 additions & 63 deletions apps/main-app/ts/components/ui/Overlay.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions apps/main-app/ts/components/ui/__test__/Overlay.test.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ exports[`CieIdLoginWebView Should match the snapshot 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -50,7 +49,6 @@ exports[`CieIdLoginWebView Should match the snapshot 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,0.7)",
"opacity": 1,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ exports[`CieIdLoginScreen Should match snapshot 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -50,7 +49,6 @@ exports[`CieIdLoginScreen Should match snapshot 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,0.7)",
"opacity": 1,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ exports[`ItwIpzsPrivacyScreen should match the snapshot (L3 disabled) 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -222,7 +221,6 @@ exports[`ItwIpzsPrivacyScreen should match the snapshot (L3 disabled) 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,1)",
"opacity": 1,
},
]
}
Expand Down Expand Up @@ -1778,7 +1776,6 @@ exports[`ItwIpzsPrivacyScreen should match the snapshot (L3 enabled) 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -1789,7 +1786,6 @@ exports[`ItwIpzsPrivacyScreen should match the snapshot (L3 enabled) 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,1)",
"opacity": 1,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exports[`PdfViewer should match the snapshot 1`] = `
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -24,7 +23,6 @@ exports[`PdfViewer should match the snapshot 1`] = `
},
{
"backgroundColor": "rgba(255,255,255,0.7)",
"opacity": 1,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ exports[`MessageAttachment Should match the snapshot when everything went fine 1
style={
[
{
"backgroundColor": "#FFFFFF",
"bottom": 0,
"justifyContent": "center",
"left": 0,
Expand All @@ -222,7 +221,6 @@ exports[`MessageAttachment Should match the snapshot when everything went fine 1
},
{
"backgroundColor": "rgba(255,255,255,0.7)",
"opacity": 1,
},
]
}
Expand Down