Skip to content

Commit

Permalink
Merge pull request #346 from TAMUSHPE/detailing
Browse files Browse the repository at this point in the history
Detailing
  • Loading branch information
JasonIsAzn authored May 19, 2024
2 parents 406f837 + ce396a3 commit aee3712
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 28 deletions.
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "TAMU SHPE",
"slug": "TAMU-SHPE",
"version": "0.6.0",
"version": "0.6.2",
"owner": "tamu-shpe",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand All @@ -16,7 +16,7 @@
[
"expo-image-picker",
{
"photosPermission": "The app can access photos"
"photosPermission": "TAMU SHPE needs to access your photo library to select a profile picture."
}
],
[
Expand All @@ -36,7 +36,7 @@
[
"expo-barcode-scanner",
{
"cameraPermission": "Allow tamu shpe app to access camera."
"cameraPermission": "TAMU SHPE needs to access the camera to scan QR codes."
}
]
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shpe-app",
"version": "0.6.0",
"version": "0.6.1",
"scripts": {
"start": "npx expo start --dev-client",
"test": "jest --coverage=true --verbose --bail --config ./jest.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/HomeDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const HomeDrawerContent = (props: DrawerContentComponentProps) => {
<Text className='text-white text-xl break-words font-semibold'>{userInfo?.publicInfo?.displayName ?? "Name"}</Text>
{(isOfficer || isVerified) && <TwitterSvg color={badgeColor} className="ml-2" />}
</View>
<Text className='text-white text-sm break-words font-semibold'>{`${userInfo?.publicInfo?.points ?? 0} points`}</Text>
<Text className='text-white text-sm break-words font-semibold'>{`${userInfo?.publicInfo?.points?.toFixed(2) ?? 0} points`}</Text>
</View>
</View>
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/navigation/MainStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const MainStack = () => {
headerShown: false
}}
>
<Stack.Screen name="HomeBottomTabs" component={HomeBottomTabs} />
<Stack.Screen name="AdminDashboardStack" component={AdminDashboardStack} />
<Stack.Screen name="HomeBottomTabs" component={HomeBottomTabs} options={{ title: "" }} />
<Stack.Screen name="AdminDashboardStack" component={AdminDashboardStack} options={{ title: "" }} />
</Stack.Group>

{/* Settings Screens */}
Expand Down
2 changes: 2 additions & 0 deletions src/screens/admin/AdminDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const AdminDashboard = ({ navigation }: NativeStackScreenProps<AdminDashboardPar
const committeeCountCheckOnCall = httpsCallable(functions, 'committeeCountCheckOnCall');
const updateAllUserPoints = httpsCallable(functions, 'updateAllUserPoints');
const updateCommitteeCount = httpsCallable(functions, 'updateCommitteeCount');
const updateRanksOnCall = httpsCallable(functions, 'updateRanksOnCall');


return (
Expand Down Expand Up @@ -105,6 +106,7 @@ const AdminDashboard = ({ navigation }: NativeStackScreenProps<AdminDashboardPar
<TouchableOpacity
onPress={() => {
updateAllUserPoints()
updateRanksOnCall()
Alert.alert('Update All User Points', 'Update All User Points has been called')
}}
className='bg-black rounded-md py-4 px-2 items-center justify-center'
Expand Down
42 changes: 26 additions & 16 deletions src/screens/admin/CommitteeEdit.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { View, Text, TextInput, TouchableOpacity, ScrollView, Modal, Pressable, Switch } from 'react-native'
import { View, Text, TextInput, TouchableOpacity, ScrollView, Modal, Pressable, Switch, FlatList } from 'react-native'
import React, { useEffect, useState } from 'react'
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
import { Octicons, FontAwesome } from '@expo/vector-icons';
Expand Down Expand Up @@ -245,6 +245,22 @@ const CommitteeEdit = ({ navigation, route }: CommitteeEditProps) => {
);
};

const renderItem = ({ item }: { item: any }) => {
const [name, logoData] = item;
return (
<TouchableOpacity
className='flex-1 items-center mx-5 my-5'
key={name}
onPress={() => {
setLocalCommitteeData({ ...localCommitteeData, logo: name });
setLogoSelectModal(false);
}}
>
<logoData.LogoComponent width={logoData.width} height={logoData.height} />
</TouchableOpacity>
);
};

return (
<SafeAreaView>
{/* Header */}
Expand Down Expand Up @@ -655,7 +671,7 @@ const CommitteeEdit = ({ navigation, route }: CommitteeEditProps) => {
visible={logoSelectModal}
setVisible={setLogoSelectModal}
>
<View className='flex opacity-100 bg-white rounded-md p-6 space-y-6 w-3/4 h-1/2' style={{ maxWidth: 350 }}>
<View className='flex opacity-100 bg-white rounded-md px-5 py-5 space-y-6 w-[90%] h-1/2'>
<View className='flex-row items-center justify-between'>
<View className='items-center'>
<Text className='text-2xl font-semibold ml-2'>Select a Logo</Text>
Expand All @@ -667,20 +683,14 @@ const CommitteeEdit = ({ navigation, route }: CommitteeEditProps) => {
</View>
</View>

<ScrollView className='bg-gray-400 py-4 rounded-xl'>
{Object.entries(committeeLogos).map(([name, logoData]) => (
<TouchableOpacity
className='items-center py-5'
key={name}
onPress={() => {
setLocalCommitteeData({ ...localCommitteeData, logo: name as keyof typeof committeeLogos });
setLogoSelectModal(false);
}}
>
<logoData.LogoComponent width={logoData.width} height={logoData.height} />
</TouchableOpacity>
))}
</ScrollView>
<FlatList
data={Object.entries(committeeLogos)}
renderItem={renderItem}
keyExtractor={(item) => item[0]}
numColumns={3}
contentContainerStyle={{ padding: 10 }}
style={{ backgroundColor: 'gray', borderRadius: 10 }}
/>
</View>
</DismissibleModal>

Expand Down
4 changes: 2 additions & 2 deletions src/screens/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ScrollView } from 'react-native';
import { ScrollView, View } from 'react-native';
import React, { useEffect, useContext } from 'react';
import { NativeStackScreenProps } from '@react-navigation/native-stack';
import { StatusBar } from 'expo-status-bar';
Expand Down Expand Up @@ -33,7 +33,7 @@ const Home = ({ navigation, route }: NativeStackScreenProps<HomeStackParams>) =>

<MOTMCard navigation={navigation} />


<View className="mb-8" />
</ScrollView>
);
}
Expand Down
7 changes: 7 additions & 0 deletions src/screens/home/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,13 @@ const AboutSettingsScreen = ({ navigation }: NativeStackScreenProps<MainStackPar
subText={`${Platform.OS} ${Platform.Version as string}`}
darkMode={darkMode}
/>

<TouchableOpacity
className='justify-center ml-5'
onPress={() => handleLinkPress("https://jasonisazn.github.io/")}
>
<Text className='text-2xl'>Privacy Policy</Text>
</TouchableOpacity>
</ScrollView>
);
};
Expand Down
7 changes: 5 additions & 2 deletions src/screens/involvement/CommitteesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CommitteesList: React.FC<CommitteesListProps> = ({ navigation }) => {
<ScrollView className='pt-4'>
<View>
{isSuperUser && (
<View className='flex items-center mb-8 w-full'>
<View className='flex items-center w-full'>
<TouchableOpacity
onPress={() => navigation.navigate("CommitteeEdit", { committee: undefined })}
className='flex-row w-[90%] h-28 rounded-xl bg-[#D3D3D3]'
Expand All @@ -62,8 +62,11 @@ const CommitteesList: React.FC<CommitteesListProps> = ({ navigation }) => {
)}

{loading && (
<ActivityIndicator size="large" />
<ActivityIndicator className='mt-8' size="large" />
)}

<View className="mt-8" />

{!loading && committees.map((committee) => (
<CommitteeCard
key={committee.name}
Expand Down
8 changes: 7 additions & 1 deletion src/screens/resources/PointsLeaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const PointsLeaderboard = ({ navigation }: NativeStackScreenProps<ResourcesStack
</TouchableOpacity>
</View>
</View>
<View className='pb-4' />

<ScrollView
onScroll={handleScroll}
Expand Down Expand Up @@ -207,7 +208,12 @@ const PointsLeaderboard = ({ navigation }: NativeStackScreenProps<ResourcesStack
) : (
currentUserInfo?.points ? (
<RankCard key="userCard" userData={currentUserInfo} navigation={navigation} />
) : (<Text className='text-xl font-medium'>You don't any have points.</Text>)
) : (
<View className='flex-col h-20 mx-4 px-4 mt-8 rounded-xl items-center justify-center'
style={{ backgroundColor: colorMapping[currentUserInfo?.rankChange ?? "same"] }}>
<Text className='text-xl font-medium'>You don't have any points</Text>
</View>
)
)}
</View>
)}
Expand Down

0 comments on commit aee3712

Please sign in to comment.