dpv007 commited on
Commit
edd7115
·
1 Parent(s): 2a83bb2

fix: bin viewer bottom padding overlap

Browse files
keystone-app/app/(tabs)/library.tsx CHANGED
@@ -12,7 +12,7 @@ import {
12
  Animated,
13
  TouchableWithoutFeedback,
14
  } from 'react-native';
15
- import { SafeAreaView } from 'react-native-safe-area-context';
16
  import * as MediaLibrary from 'expo-media-library';
17
  import { Image } from 'expo-image';
18
  import { StatusBar } from 'expo-status-bar';
@@ -47,6 +47,7 @@ function SkeletonAlbum() {
47
  }
48
 
49
  export default function LibraryScreen() {
 
50
  const [albums, setAlbums] = useState<AlbumWithCover[]>([]);
51
  const [isLoading, setIsLoading] = useState(true);
52
  const [hasPermission, setHasPermission] = useState(false);
@@ -325,7 +326,7 @@ export default function LibraryScreen() {
325
  cachePolicy="memory-disk"
326
  />
327
  {viewerAsset && isViewerFromBin && (
328
- <View style={{ position: 'absolute', bottom: 0, left: 0, right: 0, flexDirection: 'row', justifyContent: 'space-around', backgroundColor: 'rgba(0,0,0,0.8)', paddingVertical: 16, paddingBottom: 32 }}>
329
  <TouchableOpacity onPress={() => setShowRestoreMenu(true)} style={{ alignItems: 'center' }}>
330
  <MaterialIcons name="restore" size={26} color="#1a73e8" />
331
  <Text style={{ color: '#1a73e8', fontSize: 13, marginTop: 4 }}>Restore</Text>
 
12
  Animated,
13
  TouchableWithoutFeedback,
14
  } from 'react-native';
15
+ import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
16
  import * as MediaLibrary from 'expo-media-library';
17
  import { Image } from 'expo-image';
18
  import { StatusBar } from 'expo-status-bar';
 
47
  }
48
 
49
  export default function LibraryScreen() {
50
+ const insets = useSafeAreaInsets();
51
  const [albums, setAlbums] = useState<AlbumWithCover[]>([]);
52
  const [isLoading, setIsLoading] = useState(true);
53
  const [hasPermission, setHasPermission] = useState(false);
 
326
  cachePolicy="memory-disk"
327
  />
328
  {viewerAsset && isViewerFromBin && (
329
+ <View style={{ position: 'absolute', bottom: 0, left: 0, right: 0, flexDirection: 'row', justifyContent: 'space-around', backgroundColor: 'rgba(0,0,0,0.8)', paddingVertical: 16, paddingBottom: insets.bottom + 16 }}>
330
  <TouchableOpacity onPress={() => setShowRestoreMenu(true)} style={{ alignItems: 'center' }}>
331
  <MaterialIcons name="restore" size={26} color="#1a73e8" />
332
  <Text style={{ color: '#1a73e8', fontSize: 13, marginTop: 4 }}>Restore</Text>