Revize 8c3203e0
Přidáno uživatelem Schwobik před téměř 2 roky(ů)
src/api/constants.ts | ||
---|---|---|
2 | 2 |
|
3 | 3 |
export const AVATAR_URL = 'https://www.inventariarudolphina.com/static/avatars' |
4 | 4 |
|
5 |
export const IMAGE_URL = 'https://www.inventariarudolphina.com/static/images' |
|
5 |
export const IMAGE_URL = 'https://www.inventariarudolphina.com/static/images' |
|
6 |
|
|
7 |
export const HOME_PAGE_IMG_URL = 'https://www.inventariarudolphina.com/static/home/Rudolf-Aachen-crop.png' |
|
8 |
|
|
9 |
export const ITEM_PREVIEW_IMG_PREFIX_URL = 'https://www.inventariarudolphina.com/static/images/thumb-' |
src/components/listView/ItemPreview.tsx | ||
---|---|---|
3 | 3 |
import { DrawerScreenProps } from "@react-navigation/drawer" |
4 | 4 |
import { RootDrawerParamList } from "../../pages/Navigation" |
5 | 5 |
import { ItemPreviewMissingImage } from "./ItemPreviewMissingImage" |
6 |
import { ITEM_PREVIEW_IMG_PREFIX_URL } from "../../api/constants" |
|
6 | 7 |
|
7 | 8 |
interface ItemPreviewProps { |
8 | 9 |
caption: string |
... | ... | |
30 | 31 |
> |
31 | 32 |
{props.image ? ( |
32 | 33 |
<Image |
33 |
source={ {uri: `http:/147.228.173.159/static/images/thumb-${props.image}`} }
|
|
34 |
source={ {uri: `${ITEM_PREVIEW_IMG_PREFIX_URL}${props.image}`} }
|
|
34 | 35 |
size={ "sm" } |
35 | 36 |
alt={ props.image } |
36 | 37 |
/> |
src/pages/HomePage.tsx | ||
---|---|---|
8 | 8 |
import { DrawerScreenProps } from "@react-navigation/drawer" |
9 | 9 |
import { RootDrawerParamList } from "./Navigation" |
10 | 10 |
import { log } from "../logging/logger" |
11 |
import { HOME_PAGE_IMG_URL } from "../api/constants" |
|
11 | 12 |
// import { Image } from "react-native" |
12 | 13 |
|
13 | 14 |
const HomePage = ({navigation}: DrawerScreenProps<RootDrawerParamList, 'Home'>) => { |
... | ... | |
22 | 23 |
if (data === null || data.length === 0 && !loading) { |
23 | 24 |
dispatch(fetchData()) |
24 | 25 |
} |
25 |
// Image.getSize("http:/147.228.173.159/static/home/Rudolf-Aachen-crop.png", (width, height) => { |
|
26 |
// setAspectRatio(width / height) |
|
27 |
// }) |
|
28 | 26 |
|
29 | 27 |
}, []) |
30 | 28 |
|
... | ... | |
37 | 35 |
<ApplicationHeading/> |
38 | 36 |
<ScrollView mb={5} > |
39 | 37 |
<Image |
40 |
source={ {uri: "http:/147.228.173.159/static/home/Rudolf-Aachen-crop.png"} }
|
|
38 |
source={ {uri: HOME_PAGE_IMG_URL} }
|
|
41 | 39 |
w={"100%"} h={ 200 } |
42 | 40 |
resizeMode={"contain"} |
43 | 41 |
alignSelf={ "center" } |
Také k dispozici: Unified diff
Switched to production
re #10715