From 2fb85590271476a40c3d0d6a9cc4683576ff6074 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Mon, 26 Aug 2024 23:54:10 +0300 Subject: feature(mobile): Allow interacting with images in the app. Fixes #352 --- apps/mobile/lib/hooks.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 apps/mobile/lib/hooks.ts (limited to 'apps/mobile/lib') diff --git a/apps/mobile/lib/hooks.ts b/apps/mobile/lib/hooks.ts new file mode 100644 index 00000000..beeab391 --- /dev/null +++ b/apps/mobile/lib/hooks.ts @@ -0,0 +1,13 @@ +import { ImageURISource } from "react-native"; + +import useAppSettings from "./settings"; + +export function useAssetUrl(assetId: string): ImageURISource { + const { settings } = useAppSettings(); + return { + uri: `${settings.address}/api/assets/${assetId}`, + headers: { + Authorization: `Bearer ${settings.apiKey}`, + }, + }; +} -- cgit v1.2.3-70-g09d2