Commit 628289fc authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

Merge branch 'it18218640' into 'master'

get color activities response

See merge request !74
parents b723dee2 10092a64
...@@ -15,7 +15,7 @@ const Stack = createNativeStackNavigator(); ...@@ -15,7 +15,7 @@ const Stack = createNativeStackNavigator();
const AppRouter = () => { const AppRouter = () => {
return ( return (
<NavigationContainer> <NavigationContainer>
<Stack.Navigator initialRouteName="Splash"> <Stack.Navigator initialRouteName="Start">
<Stack.Screen <Stack.Screen
options={{headerShown: false}} options={{headerShown: false}}
name="Home" name="Home"
......
...@@ -6,46 +6,42 @@ import { StyleSheet, View, Text, Pressable, SafeAreaView, ScrollView, Image, Ima ...@@ -6,46 +6,42 @@ import { StyleSheet, View, Text, Pressable, SafeAreaView, ScrollView, Image, Ima
import ImageButton from "../component/ImageButton"; import ImageButton from "../component/ImageButton";
import ColorActivity from "../component/colorActivity"; import ColorActivity from "../component/colorActivity";
// const {width,height} = Dimensions.get('screen'); const webUrel = "http://192.168.8.101:5000/getColorActivities";
const webUrel = "http://192.168.8.101:5000/ru";
export default function Color(){ export default function Color(){
const[names,setNames] = useState([]); const[datas,setData] = useState([]);
const navigation = useNavigation(); const navigation = useNavigation();
function getColorActivities() {
axios
.get(webUrel)
.then((response) => {
setData(response.data);
console.log(response.data);
})
.catch((err) => {
setNotify({
isOpen: true,
message: err.message,
type: "warning",
});
});
}
React.useEffect(() => { React.useEffect(() => {
getColorActivities()
const unsubscribe = navigation.addListener("focus", () => { const unsubscribe = navigation.addListener("focus", () => {
// The screen is focused
// Call any action
Orientation.unlockAllOrientations(); Orientation.unlockAllOrientations();
Orientation.lockToPortrait(); Orientation.lockToPortrait();
}); });
// Return the function to unsubscribe from the event so it gets removed on unmount
return unsubscribe; return unsubscribe;
}, [navigation]); }, [navigation]);
// function getSMSReport() {
// axios
// .get(webUrel)
// .then((response) => {
// console.log(response.data);
// // setNames(response.data)
// })
// .catch((err) => {
// console.log(err);
// });
// }
// useEffect(() =>{
// getSMSReport();
// })
return ( return (
<SafeAreaView> <SafeAreaView>
...@@ -59,26 +55,6 @@ const[names,setNames] = useState([]); ...@@ -59,26 +55,6 @@ const[names,setNames] = useState([]);
</ImageBackground> </ImageBackground>
</View> </View>
</View> </View>
<ColorActivity>
</ColorActivity>
{/* <ColorActivity>
</ColorActivity>
<ColorActivity>
</ColorActivity>
<ColorActivity>
</ColorActivity>
<ColorActivity>
</ColorActivity> */}
</ScrollView> </ScrollView>
</SafeAreaView> </SafeAreaView>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment