Revize 5cee436e
Přidáno uživatelem Fantič před více než 1 rok
src/components/plan/CastlePlanView.tsx | ||
---|---|---|
10 | 10 |
import { PlanImage, Room } from '../../types/plan'; |
11 | 11 |
import Svg, { SvgXml } from 'react-native-svg'; |
12 | 12 |
|
13 |
const CastlePlanView = (props: { mapImage: PlanImage, roomList: Room[], selectedRoom?: Room }) => { |
|
13 |
const CastlePlanView = (props: { mapImage: PlanImage, roomList: Room[], selectedRoom?: Room, fullScreenMode?: boolean }) => {
|
|
14 | 14 |
|
15 | 15 |
const DEFAULT_SCALE = 1 |
16 | 16 |
const MIN_SCALE = 0.95 |
17 | 17 |
|
18 | 18 |
const MAP_VIEW_SIZE = { |
19 |
height : 400,
|
|
20 |
width : "100%"
|
|
19 |
height: 500,
|
|
20 |
width: "100%" |
|
21 | 21 |
} |
22 | 22 |
|
23 |
const { mapImage, roomList, selectedRoom } = props; |
|
23 |
const { mapImage, roomList, selectedRoom, fullScreenMode } = props;
|
|
24 | 24 |
|
25 | 25 |
const panRef = useRef<React.ReactElement>(); |
26 | 26 |
const pinchRef = useRef<React.ReactElement>(); |
... | ... | |
68 | 68 |
}; |
69 | 69 |
}); |
70 | 70 |
|
71 |
console.log(fullScreenMode) |
|
72 |
|
|
73 |
console.log(Dimensions.get('window').height) |
|
74 |
console.log(Dimensions.get('window').width) |
|
75 |
|
|
71 | 76 |
return ( |
72 | 77 |
// container |
73 |
<Box width={MAP_VIEW_SIZE.width} height={MAP_VIEW_SIZE.height} style={{ borderColor: "#F5F5F", borderWidth: 1, overflow: "hidden" }}> |
|
78 |
<Box |
|
79 |
width={!fullScreenMode ? MAP_VIEW_SIZE.width : Dimensions.get('window').width - 5} |
|
80 |
height={!fullScreenMode ? MAP_VIEW_SIZE.height : Dimensions.get('window').height - 62.5} |
|
81 |
// @ts-ignore |
|
82 |
style={ |
|
83 |
fullScreenMode ? { |
|
84 |
marginTop: 2.5, |
|
85 |
marginLeft: 2.5, |
|
86 |
marginRight: 2.5, |
|
87 |
} |
|
88 |
: |
|
89 |
{ borderColor: "#F5F5F", borderWidth: 1, overflow: "hidden" } |
|
90 |
}> |
|
74 | 91 |
<PinchGestureHandler |
75 | 92 |
ref={pinchRef} |
76 | 93 |
// @ts-ignore |
Také k dispozici: Unified diff
re #10871: PlanViewPage: fullScreenMode