Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
chore(deps): upgrade expo to version 51
Browse files Browse the repository at this point in the history
  • Loading branch information
Asiern committed Jul 23, 2024
1 parent a5f6d3a commit 900522b
Show file tree
Hide file tree
Showing 15 changed files with 2,322 additions and 3,306 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/commit-msg

This file was deleted.

23 changes: 0 additions & 23 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@ import AsyncStorage from "@react-native-async-storage/async-storage";
import crashlytics from "@react-native-firebase/crashlytics";
import { version } from "./package.json";

// Ads Consent
import { AdsConsent, AdsConsentStatus } from "react-native-google-mobile-ads";

async function requestConsent() {
const consentInfo = await AdsConsent.requestInfoUpdate();

// Check if user requires consent
if (
consentInfo.isConsentFormAvailable &&
(consentInfo.status === AdsConsentStatus.UNKNOWN ||
consentInfo.status === AdsConsentStatus.REQUIRED)
) {
// Show a Google-rendered form
const formResult = await AdsConsent.showForm();

console.log(
"User consent obtained: ",
formResult.status === AdsConsentStatus.OBTAINED
);
}
}

// Translations (i18n)
import "./app/locale/i18n";

Expand Down Expand Up @@ -65,7 +43,6 @@ export default function App(): JSX.Element {
const prepare = async () => {
try {
crashlytics().log("AppLoading");
await requestConsent();
await SplashScreen.preventAutoHideAsync();
await loadAsync({
Poppins: require("./app/assets/fonts/Poppins-Regular.ttf"),
Expand Down
17 changes: 3 additions & 14 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "SpeedrunHub",
"slug": "speedruncomapp",
"platforms": ["ios", "android"],
"version": "2.0.3",
"version": "2.0.4",
"orientation": "portrait",
"icon": "./app/assets/trophy.png",
"splash": {
Expand All @@ -25,7 +25,7 @@
"githubUrl": "https://github.com/Asiern/SpeedrunHub",
"android": {
"package": "com.asiern.speedrun2",
"versionCode": 7,
"versionCode": 8,
"permissions": [],
"googleServicesFile": "./google-services.json"
},
Expand All @@ -43,18 +43,7 @@
["@react-native-firebase/crashlytics"],
["@react-native-firebase/app"],
"expo-localization",
[
"expo-build-properties",
{
"android": {
"extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }"
}
}
]
"expo-font"
]
},
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-5820949657654069~3334705233",
"delay_app_measurement_init": true
}
}
15 changes: 4 additions & 11 deletions app/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export interface ButtonProps {

function Button({
label,
variant,
variant = "default",
onPress,
shadow,
icon,
centerContent,
shadow = false,
icon = null,
centerContent = false,
style,
disabled = false,
iconPosition = "left",
Expand Down Expand Up @@ -89,13 +89,6 @@ function Button({
);
}

Button.defaultProps = {
variant: "default",
shadow: false,
icon: null,
centerContent: false,
};

const styles = StyleSheet.create({
container: {
borderRadius: 15,
Expand Down
7 changes: 0 additions & 7 deletions app/constants/ads.ts

This file was deleted.

19 changes: 0 additions & 19 deletions app/screens/game/GameInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import { InfoContainer } from "./Info";
import { CategoriesContainer } from "./Categories";
import { VariablesContainer } from "./Variables";
import { LeaderboardContainer } from "./Leaderboard";
import {
BannerAd,
BannerAdSize,
TestIds,
} from "react-native-google-mobile-ads";
import { ADS_IDS } from "../../constants/ads";

interface IGameInfo {
game: game;
Expand Down Expand Up @@ -82,19 +76,6 @@ function GameInfo({ game }: IGameInfo): JSX.Element {
}
/>
<InfoContainer {...{ game }} />
<View
style={{
marginVertical: 10,
justifyContent: "center",
alignContent: "center",
alignItems: "center",
}}
>
<BannerAd
size={BannerAdSize.BANNER}
unitId={__DEV__ ? TestIds.BANNER : ADS_IDS.GameInfo}
/>
</View>
<CategoriesContainer {...{ game, category, setCategory }} />
<VariablesContainer
{...{ category, selectedVariables, setSelectedVariables }}
Expand Down
18 changes: 0 additions & 18 deletions app/screens/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ import React, { useCallback, useState } from "react";
import { StyleSheet, View } from "react-native";
import { useNavigation } from "@react-navigation/native";
import Constants from "expo-constants";
import {
BannerAd,
BannerAdSize,
TestIds,
} from "react-native-google-mobile-ads";

import HomeHeader from "./HomeHeader";
import SearchBar from "../../components/SearchBar";
import { ScrollView } from "react-native-gesture-handler";
import GameList from "./GameList";
import Following from "./Following";
import { ADS_IDS } from "../../constants/ads";

export default function Home(): JSX.Element {
const navigator = useNavigation();
Expand All @@ -37,18 +31,6 @@ export default function Home(): JSX.Element {
</View>
<GameList />
<Following />
<View
style={{
justifyContent: "center",
alignItems: "center",
marginTop: 10,
}}
>
<BannerAd
size={BannerAdSize.LARGE_BANNER}
unitId={__DEV__ ? TestIds.BANNER : ADS_IDS.Home}
/>
</View>
</ScrollView>
);
}
Expand Down
16 changes: 0 additions & 16 deletions app/screens/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ import Constants from "expo-constants";
import { CARD_HEIGHT, CARD_WIDTH } from "./GameCard";
import { PersonalBestsContainer } from "./PersonalBestsContainer";
import { MainNavigatorParamList } from "../../navigation/MainNavigator";
import {
BannerAd,
BannerAdSize,
TestIds,
} from "react-native-google-mobile-ads";
import { ADS_IDS } from "../../constants/ads";

const { width } = Dimensions.get("screen");

Expand Down Expand Up @@ -88,12 +82,6 @@ export function Profile(props: ProfileProps): JSX.Element {
variant="primary"
/> */}
</View>
<View style={styles.banner}>
<BannerAd
size={BannerAdSize.BANNER}
unitId={__DEV__ ? TestIds.BANNER : ADS_IDS.Profile}
/>
</View>
<PersonalBestsContainer user={user} />
</ScrollView>
);
Expand Down Expand Up @@ -132,8 +120,4 @@ const styles = StyleSheet.create({
paddingHorizontal: 30,
paddingBottom: 10,
},
banner: {
justifyContent: "center",
alignItems: "center",
},
});
13 changes: 5 additions & 8 deletions app/screens/search/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ interface IFilter {
variant?: "add" | "remove";
}

/**
Set the default variant of the Filter component to "add".
*/
FilterComponent.defaultProps = {
variant: "add",
};

export const Filter = memo(FilterComponent);

function FilterComponent({ label, onPress, variant }: IFilter): JSX.Element {
function FilterComponent({
label,
onPress,
variant = "add",
}: IFilter): JSX.Element {
const { config } = useConfig();
const { theme } = config;
const { t } = useTranslation();
Expand Down
18 changes: 0 additions & 18 deletions app/screens/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ import {
import Game from "./Game";
import Constants from "expo-constants";
import { MainNavigatorParamList } from "../../navigation/MainNavigator";
import {
BannerAd,
BannerAdSize,
TestIds,
} from "react-native-google-mobile-ads";
import { ADS_IDS } from "../../constants/ads";
import crashlytics from "@react-native-firebase/crashlytics";

const INITIAL_FILTERS: string[] = ["games"];
Expand Down Expand Up @@ -121,18 +115,6 @@ export default function Search(props: SearchProps): JSX.Element {
search(setUsers, setGames, searchQuery ?? "", filters);
}}
/>
<View
style={{
marginVertical: 10,
justifyContent: "center",
alignItems: "center",
}}
>
<BannerAd
size={BannerAdSize.BANNER}
unitId={__DEV__ ? TestIds.BANNER : ADS_IDS.Search}
/>
</View>
<ScrollView>
<View style={{ paddingHorizontal: 30 }}>
{loading && <ActivityIndicator />}
Expand Down
13 changes: 0 additions & 13 deletions app/screens/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { useNavigation } from "@react-navigation/native";
import { Button, Header } from "../../components";
import Constants from "expo-constants";
import { useConfig } from "../../hooks";
import {
BannerAd,
BannerAdSize,
TestIds,
} from "react-native-google-mobile-ads";
import { ADS_IDS } from "../../constants/ads";
import crashlytics from "@react-native-firebase/crashlytics";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -116,13 +110,6 @@ export function Settings(): JSX.Element {
/>
</View>
</View>

<View style={{ justifyContent: "center", alignItems: "center" }}>
<BannerAd
size={BannerAdSize.LARGE_BANNER}
unitId={__DEV__ ? TestIds.BANNER : ADS_IDS.Settings}
/>
</View>
</ScrollView>
);
}
Loading

0 comments on commit 900522b

Please sign in to comment.