Skip to content

Commit cc78893

Browse files
committed
feat: add style for image viewer
1 parent 89db2ea commit cc78893

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

app/_layout.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
import { Slot } from "expo-router";
1+
import { useEffect } from "react";
2+
import { usePathname, useGlobalSearchParams, Slot } from "expo-router";
23

3-
export default function HomeLayout() {
4+
import "../global.css";
5+
6+
export default function Layout() {
7+
const pathname = usePathname();
8+
const params = useGlobalSearchParams();
9+
10+
// Track the location in your analytics provider here.
11+
useEffect(() => {
12+
console.log({ pathname, params });
13+
}, [pathname, params]);
14+
15+
// Export all the children routes in the most basic way.
416
return <Slot />;
517
}

app/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default function App() {
9191

9292
return (
9393
<GestureHandlerRootView style={styles.container}>
94-
<View style={styles.imageContainer}>
94+
<View style={styles.imageContainer} className="justify-around">
9595
<View ref={imageRef} collapsable={false}>
9696
<ImageViewer
9797
placeholderImageSource={PlaceholderImage}

components/ImageViewer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ export default function ImageViewer({ placeholderImageSource, selectedImage }) {
55
? { uri: selectedImage }
66
: placeholderImageSource;
77

8-
return <Image source={imageSource} style={styles.image} />;
8+
return <Image className="w-96" source={imageSource} style={styles.image} />;
99
}
1010

1111
const styles = StyleSheet.create({
1212
image: {
13-
width: 320,
14-
height: 440,
1513
borderRadius: 18,
1614
},
1715
});

0 commit comments

Comments
 (0)