aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/profile/BadgeTutorialScreen.tsx3
-rw-r--r--src/components/profile/ProfileHeader.tsx14
2 files changed, 15 insertions, 2 deletions
diff --git a/src/components/profile/BadgeTutorialScreen.tsx b/src/components/profile/BadgeTutorialScreen.tsx
index 45831fc6..30aced42 100644
--- a/src/components/profile/BadgeTutorialScreen.tsx
+++ b/src/components/profile/BadgeTutorialScreen.tsx
@@ -8,7 +8,7 @@ import {
View,
} from 'react-native';
import {PROFILE_CUTOUT_TOP_Y} from '../../constants';
-import {normalize} from '../../utils';
+import {normalize, setHasSeenBadgeTutorial} from '../../utils';
import {UniversityIcon} from './';
import {UniversityIconProps} from './UniversityIcon';
@@ -31,6 +31,7 @@ const BadgeTutorialScreen: React.FC<BadgeTutorialScreenProps> = ({
presentationStyle="overFullScreen">
<TouchableOpacity
onPress={() => {
+ setHasSeenBadgeTutorial();
setShowBadgeTutorial(false);
setShowModal(false);
}}
diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx
index 5d5b695e..665ce0a0 100644
--- a/src/components/profile/ProfileHeader.tsx
+++ b/src/components/profile/ProfileHeader.tsx
@@ -1,4 +1,5 @@
-import React, {useLayoutEffect, useRef, useState} from 'react';
+import AsyncStorage from '@react-native-community/async-storage';
+import React, {useEffect, useLayoutEffect, useRef, useState} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {useSelector, useStore} from 'react-redux';
@@ -50,6 +51,17 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
const childRef = useRef(null);
const [measure, setMeasure] = useState(null);
const [showBadgeTutorial, setShowBadgeTutorial] = useState(false);
+
+ useEffect(() => {
+ const getBadgeTutorialAsync = async () => {
+ const res = await AsyncStorage.getItem('hasSeenBadgeTutorial');
+ if (res === 'true') {
+ setShowBadgeTutorial(false);
+ }
+ };
+ getBadgeTutorialAsync();
+ });
+
useLayoutEffect(() => {
setTimeout(() => {
measureStuff();