diff options
Diffstat (limited to 'apps/mobile/lib/hooks.ts')
| -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}`, + }, + }; +} |
