Skip to content

Commit

Permalink
Add blur view long press instructions on list screen
Browse files Browse the repository at this point in the history
  • Loading branch information
wyne committed Nov 13, 2023
1 parent 21521de commit 42c24ca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"redux-persist": "^6.0.0",
"semver": "^7.5.4",
"typescript": "^5.1.6",
"expo-sharing": "~11.5.0"
"expo-sharing": "~11.5.0",
"expo-blur": "~12.4.1"
},
"devDependencies": {
"@babel/core": "^7.19.3",
Expand Down
11 changes: 10 additions & 1 deletion src/screens/ListScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { memo, useEffect } from 'react';
import { StyleSheet } from 'react-native';
import { StyleSheet, Text, View } from 'react-native';
import Animated, { Layout, Easing } from 'react-native-reanimated';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import { ParamListBase } from '@react-navigation/native';
import { useAppSelector, useAppDispatch } from '../../redux/hooks';
import { BlurView } from 'expo-blur';

import { asyncCreateGame, selectAllGames } from '../../redux/GamesSlice';
import GameListItem from '../components/GameListItem';
Expand Down Expand Up @@ -34,6 +35,7 @@ const ListScreen: React.FunctionComponent<Props> = ({ navigation }) => {
return (
<SafeAreaView edges={['bottom', 'left', 'right']} style={{ backgroundColor: 'white', flex: 1 }}>
<Animated.FlatList
ListFooterComponent={<View style={{ paddingBottom: 25 }}></View>}
itemLayoutAnimation={Layout.easing(Easing.ease)}
style={styles.list}
data={gameList}
Expand All @@ -43,6 +45,13 @@ const ListScreen: React.FunctionComponent<Props> = ({ navigation }) => {
keyExtractor={item => item.id}
>
</Animated.FlatList>
<BlurView intensity={20} style={{
position: 'absolute', bottom: 0, left: 0, right: 0, height: 60,
justifyContent: 'flex-start', alignItems: 'center',
borderTopWidth: 1, borderColor: '#ccc',
}}>
<Text style={{ paddingTop: 10, color: '#555', fontSize: 12 }}>Long press for more options.</Text>
</BlurView>
</SafeAreaView>
);
};
Expand Down

0 comments on commit 42c24ca

Please sign in to comment.