diff options
| author | MohamedBassem <me@mbassem.com> | 2024-08-26 23:54:10 +0300 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-08-26 23:55:18 +0300 |
| commit | 2fb85590271476a40c3d0d6a9cc4683576ff6074 (patch) | |
| tree | 3f575cdb847f7f639552a42b38dd3f6c1e13de56 /apps/mobile/lib | |
| parent | 7593982d9cf997e607ebbd72cb9970a1010f4565 (diff) | |
| download | karakeep-2fb85590271476a40c3d0d6a9cc4683576ff6074.tar.zst | |
feature(mobile): Allow interacting with images in the app. Fixes #352
Diffstat (limited to 'apps/mobile/lib')
| -rw-r--r-- | apps/mobile/lib/hooks.ts | 13 |
1 files changed, 13 insertions, 0 deletions
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}`, + }, + }; +} |
