diff --git a/apps/mobile/src/App.tsx b/apps/mobile/src/App.tsx
index 6df52aa8b..636c936a4 100644
--- a/apps/mobile/src/App.tsx
+++ b/apps/mobile/src/App.tsx
@@ -32,12 +32,12 @@ import SearchProvider from './components/Search/SearchContext';
import { AnnouncementProvider } from './contexts/AnnouncementContext';
import BottomSheetModalProvider from './contexts/BottomSheetModalContext';
import ManageWalletProvider from './contexts/ManageWalletContext';
+import SanityDataProvider from './contexts/SanityDataContext';
import SyncTokensProvider from './contexts/SyncTokensContext';
import ToastProvider from './contexts/ToastContext';
import { TokenStateManagerProvider } from './contexts/TokenStateManagerContext';
import { magic } from './magic';
import { useCacheIntroVideo } from './screens/Onboarding/useCacheIntroVideo';
-import SanityDataProvider from './contexts/SanityDataContext';
SplashScreen.preventAutoHideAsync();
diff --git a/apps/mobile/src/components/ClaimMintUpsellBanner.tsx b/apps/mobile/src/components/ClaimMintUpsellBanner.tsx
index 94ce20c97..e09c73645 100644
--- a/apps/mobile/src/components/ClaimMintUpsellBanner.tsx
+++ b/apps/mobile/src/components/ClaimMintUpsellBanner.tsx
@@ -49,7 +49,14 @@ export function ClaimMintUpsellBanner({ queryRef }: Props) {
}, [setIsUpsellMintBannerDismissed]);
const handleClaimPress = useCallback(() => {
- showBottomSheetModal({ content: });
+ showBottomSheetModal({
+ content: (
+
+ ),
+ });
}, [hideBottomSheetModal, showBottomSheetModal]);
const user = query.viewer?.user;
diff --git a/apps/mobile/src/components/Mint/MintCampaign/MintCampaignBottomSheet.tsx b/apps/mobile/src/components/Mint/MintCampaign/MintCampaignBottomSheet.tsx
index 5c52b6f9b..211baec11 100644
--- a/apps/mobile/src/components/Mint/MintCampaign/MintCampaignBottomSheet.tsx
+++ b/apps/mobile/src/components/Mint/MintCampaign/MintCampaignBottomSheet.tsx
@@ -8,7 +8,7 @@ import MintCampaignPreTransaction from './MintCampaignPreTransaction';
type Props = {
onClose?: () => void;
- projectInternalId?: string;
+ projectInternalId: string;
};
export default function MintCampaignBottomSheet({ onClose, projectInternalId }: Props) {
@@ -21,7 +21,6 @@ export default function MintCampaignBottomSheet({ onClose, projectInternalId }:
const projectData = useMemo(() => {
return data?.mintProjects.find((document) => document.internalId === projectInternalId);
}, [data, projectInternalId]);
- console.log({ projectData });
if (!projectData) {
// TODO decide best way to handle missing data
diff --git a/apps/mobile/src/components/Mint/MintCampaign/MintCampaignPreTransaction.tsx b/apps/mobile/src/components/Mint/MintCampaign/MintCampaignPreTransaction.tsx
index 912115785..3a8c0e9e4 100644
--- a/apps/mobile/src/components/Mint/MintCampaign/MintCampaignPreTransaction.tsx
+++ b/apps/mobile/src/components/Mint/MintCampaign/MintCampaignPreTransaction.tsx
@@ -54,7 +54,7 @@ export default function MintCampaignPreTransaction({
const { claimMint, isClamingMint } = useHighlightClaimMint();
- const [, setClaimCodeLocalStorage] = usePersistedState(`${projectInternalId}_claim_code`, '');
+ const [, setClaimCodeLocalStorage] = usePersistedState(`${projectInternalId}-claim-code`, '');
const handlePress = useCallback(
async (recipientWalletId: string) => {
diff --git a/apps/mobile/src/components/MintLinkButton.tsx b/apps/mobile/src/components/MintLinkButton.tsx
index 811625f1f..010ec550f 100644
--- a/apps/mobile/src/components/MintLinkButton.tsx
+++ b/apps/mobile/src/components/MintLinkButton.tsx
@@ -148,7 +148,14 @@ export function MintLinkButton({
const handlePress = useCallback(() => {
if (isRadiance) {
- showBottomSheetModal({ content: });
+ showBottomSheetModal({
+ content: (
+
+ ),
+ });
} else {
Linking.openURL(mintURL);
}
diff --git a/apps/mobile/src/components/Notification/Notifications/AnnouncementNotification.tsx b/apps/mobile/src/components/Notification/Notifications/AnnouncementNotification.tsx
index db6f52480..b58c86d56 100644
--- a/apps/mobile/src/components/Notification/Notifications/AnnouncementNotification.tsx
+++ b/apps/mobile/src/components/Notification/Notifications/AnnouncementNotification.tsx
@@ -17,10 +17,11 @@ export default function AnnouncementNotification() {
const { announcement, markAnnouncementAsSeen, dismissAnnouncement } = useAnnouncementContext();
const { showBottomSheetModal } = useBottomSheetModalActions();
const handlePress = useCallback(() => {
+ if (!announcement) return;
showBottomSheetModal({
- content: ,
+ content: ,
});
- }, [announcement?.internal_id, showBottomSheetModal]);
+ }, [announcement, showBottomSheetModal]);
const handleDismissPress = useCallback(() => {
dismissAnnouncement();
}, [dismissAnnouncement]);
diff --git a/apps/mobile/src/components/Notification/Notifications/GalleryAnnouncement.tsx b/apps/mobile/src/components/Notification/Notifications/GalleryAnnouncement.tsx
index 1730b3386..9e81bf334 100644
--- a/apps/mobile/src/components/Notification/Notifications/GalleryAnnouncement.tsx
+++ b/apps/mobile/src/components/Notification/Notifications/GalleryAnnouncement.tsx
@@ -49,7 +49,14 @@ export function GalleryAnnouncement({ queryRef, notificationRef }: Props) {
const { showBottomSheetModal, hideBottomSheetModal } = useBottomSheetModalActions();
const handlePress = useCallback(() => {
if (internalId === 'apr-2024-mchx-collab') {
- showBottomSheetModal({ content: });
+ showBottomSheetModal({
+ content: (
+
+ ),
+ });
return;
}
if (!ctaLink) return;
diff --git a/apps/mobile/src/contexts/AnnouncementContext.tsx b/apps/mobile/src/contexts/AnnouncementContext.tsx
index 50d2c972c..b42dbc9e6 100644
--- a/apps/mobile/src/contexts/AnnouncementContext.tsx
+++ b/apps/mobile/src/contexts/AnnouncementContext.tsx
@@ -78,7 +78,7 @@ export const AnnouncementProvider = ({ children }: { children: ReactNode[] }) =>
const fetchAnnouncement = useCallback(async () => {
try {
const result = await fetchSanityContent(
- `*[_type == "announcementNotification" && active == true] {
+ `*[_type == "announcementNotification" && active == true && (platform == "Mobile" || platform == "All")] {
internal_id,
active,
title,
diff --git a/apps/mobile/src/contexts/SanityDataContext.tsx b/apps/mobile/src/contexts/SanityDataContext.tsx
index d48e0a583..a0962989d 100644
--- a/apps/mobile/src/contexts/SanityDataContext.tsx
+++ b/apps/mobile/src/contexts/SanityDataContext.tsx
@@ -7,6 +7,7 @@ import {
useMemo,
useState,
} from 'react';
+import { useReportError } from 'shared/contexts/ErrorReportingContext';
import { fetchSanityContent } from 'src/utils/sanity';
import { useEffectOnAppForeground } from 'src/utils/useEffectOnAppForeground';
@@ -45,8 +46,8 @@ export function useSanityDataContext() {
export default function SanityDataProvider({ children }: { children: ReactNode }) {
const [data, setData] = useState(null);
+ const reportError = useReportError();
const fetchData = useCallback(async () => {
- console.log('fetching');
try {
const result = await fetchSanityContent(`
*[_type == "mintProject"] {
@@ -67,9 +68,12 @@ export default function SanityDataProvider({ children }: { children: ReactNode }
setData({ mintProjects: result });
}
} catch (error) {
- console.error(error);
+ if (error instanceof Error) {
+ reportError(error);
+ }
+ reportError('An error occurred while fetching sanity data');
}
- }, []);
+ }, [reportError]);
useEffectOnAppForeground(fetchData);
diff --git a/apps/mobile/src/screens/SettingsScreen/DebugBottomSheetModal.tsx b/apps/mobile/src/screens/SettingsScreen/DebugBottomSheetModal.tsx
index a72fd5899..837b6c49c 100644
--- a/apps/mobile/src/screens/SettingsScreen/DebugBottomSheetModal.tsx
+++ b/apps/mobile/src/screens/SettingsScreen/DebugBottomSheetModal.tsx
@@ -23,12 +23,7 @@ export default function DebugBottomSheetModal() {
}, []);
const handleClearStorage = useCallback(() => {
- AsyncStorage.multiRemove([
- MARFA_2023_SUBMITTED_FORM_KEY,
- MCHX_CLAIM_CODE_KEY,
- `hasSeenAnnouncement-oxen-farcon-2024`,
- `hasDismissedAnnouncement-oxen-farcon-2024`,
- ]);
+ AsyncStorage.multiRemove([MARFA_2023_SUBMITTED_FORM_KEY, MCHX_CLAIM_CODE_KEY]);
}, []);
return (
diff --git a/apps/mobile/src/screens/SettingsScreen/SettingsScreen.tsx b/apps/mobile/src/screens/SettingsScreen/SettingsScreen.tsx
index 2bd15c525..83523d15b 100644
--- a/apps/mobile/src/screens/SettingsScreen/SettingsScreen.tsx
+++ b/apps/mobile/src/screens/SettingsScreen/SettingsScreen.tsx
@@ -76,7 +76,14 @@ export function SettingsScreen() {
}, [navigation]);
const handleDebugMintPress = useCallback(() => {
- showBottomSheetModal({ content: });
+ showBottomSheetModal({
+ content: (
+
+ ),
+ });
}, [hideBottomSheetModal, showBottomSheetModal]);
const [logout, isLoggingOut] = useLogout();