Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2858,7 +2858,7 @@ PODS:
- ReactCommon/turbomodule/core
- SocketRocket
- Yoga
- react-native-view-shot (4.0.3):
- react-native-view-shot (5.1.1):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -5082,7 +5082,7 @@ SPEC CHECKSUMS:
react-native-render-html: 5afc4751f1a98621b3009432ef84c47019dcb2bd
react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460
react-native-shake: a701ed43830d9d7940893f4f7b837970d322ae63
react-native-view-shot: 6c008e58f4720de58370848201c5d4a082c6d4ca
react-native-view-shot: 39463aa6cfaeab0a3533cc63f869d52d025ef2ff
react-native-webview: 654f794a7686b47491cf43aa67f7f428bea00eed
React-NativeModulesApple: 70b1879ac2b642ef784fb6d43360c40803b0a142
React-networking: 49160c13f35f3eb93791d062c330caea323bde87
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"react-native-share": "12.0.9",
"react-native-svg": "15.15.3",
"react-native-url-polyfill": "2.0.0",
"react-native-view-shot": "4.0.3",
"react-native-view-shot": "5.1.1",
"react-native-vimeo-iframe": "1.2.1",
"react-native-webview": "13.16.0",
"react-native-worklets": "0.8.3",
Expand Down
4 changes: 2 additions & 2 deletions src/app/Components/ShareSheet/ShareSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ import { useRef, useState } from "react"
import { KeyboardAwareScrollView } from "react-native-keyboard-controller"
import Keys from "react-native-keys"
import Share, { Social } from "react-native-share"
import ViewShot from "react-native-view-shot"
import { ViewShotRef } from "react-native-view-shot"
import { useTracking } from "react-tracking"

export const ShareSheet = () => {
const { isVisible, item: data, hideShareSheet } = useShareSheet()
const isArtwork = data?.type === "artwork"
const showWhatsAppItem = useCanOpenURL("whatsapp://send?phone=+491898")
const toast = useToast()
const shotRef = useRef<ViewShot>(null)
const shotRef = useRef<ViewShotRef>(null)
const [isImageReady, setIsImageReady] = useState(false)
const showInstagramStoriesItem =
useCanOpenURL("instagram://user?username=instagram") && data?.type !== "sale"
Expand Down
4 changes: 2 additions & 2 deletions src/app/Scenes/Artwork/Components/InstagramStoryViewShot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useOffscreenStyle } from "app/utils/hooks"
import { useDevToggle } from "app/utils/hooks/useDevToggle"
import { useSizeToFitScreen } from "app/utils/useSizeToFit"
import React, { Ref } from "react"
import ViewShot from "react-native-view-shot"
import ViewShot, { ViewShotRef } from "react-native-view-shot"

/**
* This component is used to generate an image to share in Instagram Stories.
Expand All @@ -20,7 +20,7 @@ const InstagramStoryBackgroundDimensions = {
const BottomLabelHeight = 350 // in pixels, before we scale it

export interface InstagramStoryViewShotProps {
shotRef?: Ref<ViewShot>
shotRef?: Ref<ViewShotRef>
href: string
artist: string
title?: string
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"noFallthroughCasesInSwitch": true, // avoid accidental fallthrough.
"noUnusedLocals": true, // what it says.
"noUnusedParameters": true, // what it says.
"paths": {
// react-native-view-shot's `exports` map points the "react-native" condition at its raw
// `src/index.tsx`, so tsc type-checks the library source (skipLibCheck only covers `.d.ts`)
// and our noUnusedLocals flags its unused imports. Point tsc at the shipped declarations
// instead; Metro still bundles the react-native source. Remove once upstream is clean.
"react-native-view-shot": ["../node_modules/react-native-view-shot/lib/index.d.ts"]
},
Comment on lines +13 to +19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comment explaining the what, but "Remove once upstream is clean" has no way to be actioned. Add a link to the upstream issue (or open one) so the next person bumping this knows what to check.

Two notes on the approach:

  • This makes tsc read lib/index.d.ts while Metro and Jest bundle src/index.tsx. Fine as long as lib/ is emitted from that same source, but it's a divergence to be aware of if the library's build ever changes.
  • The repo already patches 12 packages (.yarn/patches/), so a yarn patch removing the unused imports from the library's src/index.tsx is an alternative that keeps tsc and Metro on the same file. Trade-off is patch maintenance on every bump, so the tsconfig override is a reasonable call — just flagging the option.

Also worth confirming this paths block didn't disturb baseUrl: "src" resolution for app/… imports. TypeScript falls back to baseUrl when no paths pattern matches, so it should be fine, but yarn type-check passing is the proof.

"skipLibCheck": true, // temporary disable typechecking node_modules to use Charts lib. Victory is actively migrating to TS and the types for now are a mess.
"types": ["jest"]
},
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13606,7 +13606,7 @@ __metadata:
react-native-share: "npm:12.0.9"
react-native-svg: "npm:15.15.3"
react-native-url-polyfill: "npm:2.0.0"
react-native-view-shot: "npm:4.0.3"
react-native-view-shot: "npm:5.1.1"
react-native-vimeo-iframe: "npm:1.2.1"
react-native-webview: "npm:13.16.0"
react-native-worklets: "npm:0.8.3"
Expand Down Expand Up @@ -21835,15 +21835,15 @@ __metadata:
languageName: node
linkType: hard

"react-native-view-shot@npm:4.0.3":
version: 4.0.3
resolution: "react-native-view-shot@npm:4.0.3"
"react-native-view-shot@npm:5.1.1":
version: 5.1.1
resolution: "react-native-view-shot@npm:5.1.1"
dependencies:
html2canvas: "npm:^1.4.1"
peerDependencies:
react: "*"
react-native: "*"
checksum: 10c0/e172507eb7de8760a8a557a5e8632bdc248b60b89770cc941690c8fe6c788d28be1efd8259236fbc768eba3b33aaec8b7a833476b566dfef5b754618060edbec
react: ">=18.0.0"
react-native: ">=0.76.0"
checksum: 10c0/9806856d51d582e3c09da4127ad1a2876401d3e63b14ecb7e0d6ae56f92036b61d424d1f4dc0c15eac497b09ce3037e414a8b05f23a912f7572ec887417c56d3
languageName: node
linkType: hard

Expand Down
Loading