diff --git a/apps/mobile/app/components/auth/signup.tsx b/apps/mobile/app/components/auth/signup.tsx index e49e9692b..f525d4bcf 100644 --- a/apps/mobile/app/components/auth/signup.tsx +++ b/apps/mobile/app/components/auth/signup.tsx @@ -324,7 +324,9 @@ export const Signup = ({ = 1000000) { @@ -604,7 +606,8 @@ function SummarySlide({ {Object.keys(stats.monthlyStats).map((item) => ( ( { const path = await viewShotRef.current?.capture?.(); + console.log(path, "shared path"); Share.open({ url: path }).catch(() => {}); @@ -924,9 +930,16 @@ export const Wrapped = ({ navigation, route }: NavigationProps<"Wrapped">) => { const { width } = useWindowDimensions(); const [loading, setLoading] = useState(true); const [wrapped, setWrapped] = useState(null); + const wrappedRef = useStoredRef( + "wrapped-" + dayjs().year(), + null + ); const [showPresentation, setShowPresentation] = useState(false); const [messageIndex, setMessageIndex] = useState(0); const insets = useGlobalSafeAreaInsets(); + const dimensions = useSettingStore((state) => state.dimensions); + const [slides, setSlides] = useState([]); + useNavigationFocus(navigation, { focusOnInit: true }); useEffect(() => { let interval: NodeJS.Timeout; @@ -941,152 +954,102 @@ export const Wrapped = ({ navigation, route }: NavigationProps<"Wrapped">) => { }; }, [loading]); - async function loadWrapped() { - setLoading(true); - try { - const wrappedData = await db.wrapped.get(); - setWrapped(wrappedData); - setShowPresentation(true); - } catch (error) { - console.error("Error loading wrapped:", error); - } finally { - setLoading(false); - } - } - useEffect(() => { + async function loadWrapped() { + setLoading(true); + try { + if (!wrappedRef.current) { + wrappedRef.current = await db.wrapped.get(); + console.log("CACHE NOT FOUND"); + } + setWrapped(wrappedRef.current); + console.log("WRAP LOADED"); + setShowPresentation(true); + setSlides(() => { + const slides: React.ReactNode[] = []; + if (!wrappedRef.current) return []; + const wrapped = wrappedRef.current as WrappedStats; + + slides.push(); + slides.push( + + ); + + if (wrapped.totalWords > 0) { + slides.push( + + ); + } + + if ( + wrapped.mostNotesCreatedInMonth || + wrapped.mostNotesCreatedInDay + ) { + slides.push( + + ); + } + + // if (wrapped.mostUsedTags && wrapped.mostUsedTags.length > 0) { + // slides.push( + // + // ); + // } + + // if (wrapped.mostActiveNotebooks && wrapped.mostActiveNotebooks.length > 0) { + // slides.push( + // + // ); + // } + + // if (wrapped.totalAttachments > 0) { + // slides.push( + // + // ); + // } + + slides.push( + + ); + return slides; + }); + } catch (error) { + console.error("Error loading wrapped:", error); + } finally { + setLoading(false); + } + } loadWrapped(); }, []); - // Build slides array - const slides: React.ReactNode[] = []; - if (wrapped && showPresentation) { - slides.push(); - slides.push( - - ); - - if (wrapped.totalWords > 0) { - slides.push( - - ); - } - - if (wrapped.mostNotesCreatedInMonth || wrapped.mostNotesCreatedInDay) { - slides.push( - - ); - } - - // if (wrapped.mostUsedTags && wrapped.mostUsedTags.length > 0) { - // slides.push( - // - // ); - // } - - // if (wrapped.mostActiveNotebooks && wrapped.mostActiveNotebooks.length > 0) { - // slides.push( - // - // ); - // } - - // if (wrapped.totalAttachments > 0) { - // slides.push( - // - // ); - // } - - slides.push(); - } - - if (showPresentation && wrapped) { - return ( - - - { - setShowPresentation(false); - Navigation.goBack(); - }} - /> - - - - item} - /> - - ); - } - return ( ) => { }} > - - - - + - {loadingMessages[messageIndex]} - + { + setShowPresentation(false); + Navigation.goBack(); + }} + /> + + item} + /> + + ) : ( + + + + + {loadingMessages[messageIndex]} + + - + )} ); }; @@ -1134,10 +1145,10 @@ export const Wrapped = ({ navigation, route }: NavigationProps<"Wrapped">) => { export function PolkadotBackground({ width, height, - spacing = 20, + spacing = 50, dotSize = 3, - dotColor = "#E5E5E5", - opacity = 0.3 + dotColor = "#ececec", + opacity = 0.1 }: { width: number; height: number; @@ -1162,6 +1173,7 @@ export function PolkadotBackground({ opacity: opacity } ]} + pointerEvents="none" > {Array.from({ length: rows }).map((_, row) => Array.from({ length: cols }).map((_, col) => ( @@ -1175,7 +1187,7 @@ export function PolkadotBackground({ height: dotSize, borderRadius: dotSize / 2, backgroundColor: dotColor, - opacity: 0.3 + opacity: 1 }} /> )) @@ -1184,8 +1196,4 @@ export function PolkadotBackground({ ); } -const styles = StyleSheet.create({ - container: { overflow: "hidden", position: "absolute" } -}); - export default Wrapped; diff --git a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj index 34f579ef6..d394ad426 100644 --- a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj +++ b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj @@ -1104,7 +1104,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = "3.3.10"; + MARKETING_VERSION = 3.3.10; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1210,7 +1210,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = "3.3.10"; + MARKETING_VERSION = 3.3.10; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", @@ -1379,7 +1379,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = "3.3.10"; + MARKETING_VERSION = 3.3.10; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget; @@ -1423,7 +1423,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = "3.3.10"; + MARKETING_VERSION = 3.3.10; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1534,7 +1534,7 @@ "@executable_path/../../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)"; - MARKETING_VERSION = "3.3.10"; + MARKETING_VERSION = 3.3.10; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share; @@ -1647,7 +1647,7 @@ "@executable_path/../../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)"; - MARKETING_VERSION = "3.3.10"; + MARKETING_VERSION = 3.3.10; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/apps/mobile/ios/Podfile.lock b/apps/mobile/ios/Podfile.lock index 763d601ef..5f8f7ff1c 100644 --- a/apps/mobile/ios/Podfile.lock +++ b/apps/mobile/ios/Podfile.lock @@ -2246,6 +2246,34 @@ PODS: - Yoga - react-native-upload (6.28.0): - React + - react-native-view-shot (4.0.3): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga - react-native-webview (13.16.0): - boost - DoubleConversion @@ -3465,6 +3493,7 @@ DEPENDENCIES: - "react-native-sodium (from `../node_modules/@ammarahmed/react-native-sodium`)" - react-native-theme-switch-animation (from `../node_modules/react-native-theme-switch-animation`) - "react-native-upload (from `../node_modules/@ammarahmed/react-native-upload`)" + - react-native-view-shot (from `../node_modules/react-native-view-shot`) - react-native-webview (from `../node_modules/react-native-webview`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) - React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`) @@ -3680,6 +3709,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-theme-switch-animation" react-native-upload: :path: "../node_modules/@ammarahmed/react-native-upload" + react-native-view-shot: + :path: "../node_modules/react-native-view-shot" react-native-webview: :path: "../node_modules/react-native-webview" React-NativeModulesApple: @@ -3881,6 +3912,7 @@ SPEC CHECKSUMS: react-native-sodium: 066f76e46c9be13e9260521e3fa994937c4cdab4 react-native-theme-switch-animation: 449d6db7a760f55740505e7403ae8061debc9a7e react-native-upload: ddf12a152c62fcafa202ef0404d3d46333a6a6a6 + react-native-view-shot: 6c008e58f4720de58370848201c5d4a082c6d4ca react-native-webview: 654f794a7686b47491cf43aa67f7f428bea00eed React-NativeModulesApple: 46690a0fe94ec28fc6fc686ec797b911d251ded0 React-oscompat: 95875e81f5d4b3c7b2c888d5bd2c9d83450d8bdb diff --git a/apps/mobile/package-lock.json b/apps/mobile/package-lock.json index d69598dbc..42af91cdd 100644 --- a/apps/mobile/package-lock.json +++ b/apps/mobile/package-lock.json @@ -1,12 +1,12 @@ { "name": "@notesnook/mobile", - "version": "3.3.10-beta.4", + "version": "3.3.10-beta.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@notesnook/mobile", - "version": "3.3.10-beta.4", + "version": "3.3.10-beta.5", "hasInstallScript": true, "license": "GPL-3.0-or-later", "dependencies": {