aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/lib/hooks.ts
blob: beeab39157edd8b80ed46c99fbcef687a2b90235 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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}`,
    },
  };
}