Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial card bug fixed & event card update #95

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions controller/Home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getApp, firebase } from 'firebase/app'
import { getFirestore, doc, getDoc } from 'firebase/firestore'
import { getFirestore, doc, getDoc, orderBy, query, getDocs, collection } from 'firebase/firestore'
import AsyncStorage from '@react-native-async-storage/async-storage'

/**
Expand Down Expand Up @@ -72,6 +72,12 @@ async function getNetFlowByIP (ip) {
}
}

/**
* Get National Central University Calendar Link
*
* @returns {string} calendar link
*/

async function getCalender () {
const app = getApp()
const db = getFirestore(app)
Expand All @@ -80,14 +86,20 @@ async function getCalender () {
return querySnapshot.data().calendarLink
}

/**
* Get all ncu app team announcements
*
* @returns {Array} A array of announcements.
*/
async function getTutorial () {
const app = getApp()
const db = getFirestore(app)
const Doc = doc(db, 'other/tutorial')
const querySnapshot = await getDoc(Doc)
const tutorialRef = query(collection(db, 'NCU-APP corner'), orderBy('upload', 'desc'))
const querySnapshot = await getDocs(tutorialRef)

const result = []
Object.keys(querySnapshot.data()).forEach((i) => {
result.push(querySnapshot.data()[i])
querySnapshot.forEach((doc) => {
result.push({ ...doc.data() })
})
return result
}
Expand Down
26 changes: 0 additions & 26 deletions controller/Profile.js

This file was deleted.

46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,48 @@
"@expo/ngrok": "^4.1.0",
"@expo/vector-icons": "^13.0.0",
"@gorhom/bottom-sheet": "^4.5.1",
"@react-native-async-storage/async-storage": "^1.17.11",
"@react-native-community/datetimepicker": "6.5.2",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-community/datetimepicker": "7.2.0",
"@react-native-community/hooks": "^3.0.0",
"@react-navigation/bottom-tabs": "^6.4.1",
"@react-navigation/native": "^6.0.14",
"@react-navigation/native-stack": "^6.9.2",
"@react-navigation/stack": "^6.3.14",
"@types/react-native": "~0.70.6",
"axios": "^1.2.0",
"expo": "^47.0.14",
"expo-barcode-scanner": "~12.1.0",
"expo-build-properties": "~0.4.1",
"expo-constants": "~14.0.2",
"expo-image-picker": "~14.0.2",
"expo-linear-gradient": "~12.0.1",
"expo-linking": "~3.3.1",
"expo-location": "~15.0.1",
"expo": "^49.0.20",
"expo-barcode-scanner": "~12.5.3",
"expo-build-properties": "~0.8.3",
"expo-constants": "~14.4.2",
"expo-image-picker": "~14.3.2",
"expo-linear-gradient": "~12.3.0",
"expo-linking": "~5.0.2",
"expo-location": "~16.1.0",
"expo-push-notification-helper": "^0.4.0",
"expo-status-bar": "~1.4.4",
"expo-updates": "~0.15.6",
"expo-status-bar": "~1.6.0",
"expo-updates": "~0.18.17",
"firebase": "^9.17.1",
"fuse.js": "^6.6.2",
"jssha": "^3.3.0",
"native-base": "^3.4.22",
"qs": "^6.11.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.8",
"react-native-gesture-handler": "~2.8.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-google-maps-directions": "^2.1.1",
"react-native-maps": "^1.3.2",
"react-native-maps": "1.7.1",
"react-native-modal-datetime-picker": "^14.0.0",
"react-native-pager-view": "6.0.1",
"react-native-pager-view": "6.2.0",
"react-native-paper": "^4.12.5",
"react-native-popup-dialog": "^0.18.3",
"react-native-qrcode-svg": "^6.2.0",
"react-native-reanimated": "~2.12.0",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "~3.18.0",
"react-native-svg": "^13.4.0",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
"react-native-tab-view": "^3.5.1",
"react-native-webview": "11.23.1",
"react-native-webview": "13.2.2",
"url": "^0.11.0"
},
"devDependencies": {
Expand Down
13 changes: 12 additions & 1 deletion screens/Home/components/forHome/EventCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@ import styles from '../../styles_folder/Styles_EventCard'

export function EventCard ({ showNow }) {
return (
<Box w={'100%'} h={210} borderRadius={10} borderColor='#E5EBF1' safeArea>
<Box w={'100%'} borderRadius={10} borderColor='#E5EBF1' safeArea>
<Box>
<Text fontSize="lg" bold>你即將參加的活動</Text>
</Box>
{showNow.length == 0 ?
// no event
(
<Box h={45} style={{ marginTop: 20, alignSelf: 'center' }}>
<Text style={{ alignSelf: 'center' }}>你最近沒有參加任何活動</Text>
</Box>
)
: (
// have recent event
<FlatList
h={150}
nestedScrollEnabled
horizontal
data={showNow}
Expand Down Expand Up @@ -98,6 +108,7 @@ export function EventCard ({ showNow }) {
</Box>
)}
/>
)}
</Box>
)
}
Expand Down
Loading