import React, { useState, useEffect } from
'react'
;
import { Text, View, StyleSheet, Pressable } from
'react-native'
;
import { DarkTheme, Surface } from
'react-native-paper'
;
const SurfaceExample = () => {
const [HideSurface, setHideSurface] = useState(
true
);
const [events] = useState([
'Singing show from 7pm to 8pm '
,
'Drama show from 8pm to 9pm'
,
'Online Get-Together from 10pm to 11pm'
,;
]);
let c = 0;
return
(
<View>
<Pressable onPress={() => setHideSurface(
false
)}>
<Text style={styles.text}> Upcoming events</Text>
</Pressable>
{HideSurface ? (
<></>
) : (
events.map((event) => {
return
(
<Surface style={styles.surface} theme={DarkTheme} key={c++}>
<Text style={styles.surfaceText}>{event}</Text>
</Surface>
);;
})
)}
</View>
);;
};
export
default
SurfaceExample;
const styles = StyleSheet.create({
text: {
fontSize: 30,
fontWeight:
'bold'
,
margin: 20,
},
surface: {
margin: 25,
padding: 10,
height: 80,
width: 150,
elevation: 6,
borderRadius: 4,
},
surfaceText: {
color:
'white'
,
},
});