|
@@ -5,6 +5,10 @@ import {StackNavigationProp} from "@react-navigation/stack";
|
5
|
5
|
import type {CustomTheme} from "../../../managers/ThemeManager";
|
6
|
6
|
import {Button, Headline, withTheme} from "react-native-paper";
|
7
|
7
|
import {View} from "react-native";
|
|
8
|
+import i18n from "i18n-js";
|
|
9
|
+import {MASCOT_STYLE} from "../../../components/Mascot/Mascot";
|
|
10
|
+import MascotPopup from "../../../components/Mascot/MascotPopup";
|
|
11
|
+import AsyncStorageManager from "../../../managers/AsyncStorageManager";
|
8
|
12
|
|
9
|
13
|
type Props = {
|
10
|
14
|
navigation: StackNavigationProp,
|
|
@@ -12,11 +16,23 @@ type Props = {
|
12
|
16
|
}
|
13
|
17
|
|
14
|
18
|
type State = {
|
15
|
|
-
|
|
19
|
+ mascotDialogVisible: boolean,
|
16
|
20
|
}
|
17
|
21
|
|
18
|
22
|
class GameStartScreen extends React.Component<Props, State> {
|
19
|
23
|
|
|
24
|
+ state = {
|
|
25
|
+ mascotDialogVisible: AsyncStorageManager.getInstance().preferences.gameStartShowBanner.current === "1",
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ hideMascotDialog = () => {
|
|
29
|
+ AsyncStorageManager.getInstance().savePref(
|
|
30
|
+ AsyncStorageManager.getInstance().preferences.gameStartShowBanner.key,
|
|
31
|
+ '0'
|
|
32
|
+ );
|
|
33
|
+ this.setState({mascotDialogVisible: false})
|
|
34
|
+ };
|
|
35
|
+
|
20
|
36
|
render() {
|
21
|
37
|
return (
|
22
|
38
|
<View style={{flex: 1}}>
|
|
@@ -27,6 +43,21 @@ class GameStartScreen extends React.Component<Props, State> {
|
27
|
43
|
>
|
28
|
44
|
PLAY
|
29
|
45
|
</Button>
|
|
46
|
+ <MascotPopup
|
|
47
|
+ visible={this.state.mascotDialogVisible}
|
|
48
|
+ title={i18n.t("screens.game.mascotDialog.title")}
|
|
49
|
+ message={i18n.t("screens.game.mascotDialog.message")}
|
|
50
|
+ icon={"gamepad-variant"}
|
|
51
|
+ buttons={{
|
|
52
|
+ action: null,
|
|
53
|
+ cancel: {
|
|
54
|
+ message: i18n.t("screens.game.mascotDialog.button"),
|
|
55
|
+ icon: "check",
|
|
56
|
+ onPress: this.hideMascotDialog,
|
|
57
|
+ }
|
|
58
|
+ }}
|
|
59
|
+ emotion={MASCOT_STYLE.COOL}
|
|
60
|
+ />
|
30
|
61
|
</View>
|
31
|
62
|
);
|
32
|
63
|
}
|