Skip to content

Commit

Permalink
axios + some padding bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
zachvlat committed Apr 15, 2024
1 parent 17951f6 commit 5770a4d
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "WingetNite",
"slug": "wingetnite",
"version": "2.5.0",
"version": "4.0.0",
"orientation": "portrait",
"icon": "./assets/android/android/play_store_512.png",
"userInterfaceStyle": "dark",
Expand All @@ -18,7 +18,7 @@
"supportsTablet": true
},
"android": {
"versionCode": 3,
"versionCode": 4,
"adaptiveIcon": {
"foregroundImage": "./assets/android/android/res/mipmap-xxxhdpi/ic_launcher_foreground.png",
"backgroundImage": "./assets/android/android/res/mipmap-xxxhdpi/ic_launcher_background.png",
Expand Down
29 changes: 25 additions & 4 deletions components/Flatpakapps.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import React from 'react';
import { ScrollView } from 'react-native';
import React, { useState, useEffect } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import Appcard from './Appcard';
import appData from '../appData.json';
import axios from 'axios';

export default function Flatpakapps() {
const [appData, setAppData] = useState([]);

useEffect(() => {
fetchData();
}, []);

const fetchData = async () => {
try {
const response = await axios.get('https://raw.githubusercontent.com/zachvlat/wingetNite/master/appData.json');
setAppData(response.data);
} catch (error) {
console.error('Error fetching data:', error);
}
};

return (
<ScrollView>
<ScrollView contentContainerStyle={styles.scrollView}>
{appData.map((app, index) => (
<Appcard
key={index}
Expand All @@ -16,3 +31,9 @@ export default function Flatpakapps() {
</ScrollView>
);
}

const styles = StyleSheet.create({
scrollView: {
paddingBottom: 80,
},
});
34 changes: 29 additions & 5 deletions components/Wingetapps.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
import React from 'react';
import { ScrollView } from 'react-native';
import React, { useState, useEffect } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import Appcard from './Appcard';
import appData from '../appData.json';
import axios from 'axios';

export default function Wingetapps() {
const [appData, setAppData] = useState([]);

useEffect(() => {
fetchData();
}, []);

const fetchData = async () => {
try {
const response = await axios.get('https://raw.githubusercontent.com/zachvlat/wingetNite/master/appData.json');
setAppData(response.data);
} catch (error) {
console.error('Error fetching data:', error);
}
};

return (
<ScrollView>
<ScrollView contentContainerStyle={styles.scrollView}>
{appData.map((app, index) => (
<Appcard key={index} {...app} />
<Appcard
key={index}
{...app}
/>
))}
</ScrollView>
);
}

const styles = StyleSheet.create({
scrollView: {
paddingBottom: 80,
},
});
35 changes: 32 additions & 3 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@expo/webpack-config": "^19.0.0",
"axios": "^1.6.8",
"eas-cli": "^5.9.0",
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
Expand Down

0 comments on commit 5770a4d

Please sign in to comment.