Skip to content

Commit

Permalink
Merge pull request #469 from TAMUSHPE/dev
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
JasonIsAzn authored Aug 29, 2024
2 parents d1774b4 + 7e19ce5 commit bfe2258
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 42 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": "TAMU SHPE",
"slug": "TAMU-SHPE",
"version": "1.0.9",
"version": "1.0.10",
"owner": "tamu-shpe",
"orientation": "portrait",
"icon": "./assets/icon.png",
Expand Down Expand Up @@ -54,7 +54,7 @@
"permissions": [
"android.permission.RECORD_AUDIO"
],
"versionCode": 68,
"versionCode": 70,
"userInterfaceStyle": "automatic"
},
"ios": {
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": "1.0.9",
"version": "1.0.10",
"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/screens/events/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EventCard = ({ event, navigation }: { event: SHPEEvent, navigation: any })
<Text className={`text-md font-semibold ${darkMode ? "text-white" : "text-black"}`}>{formatDate(event.startTime?.toDate()!)}</Text>
</View>

{hasPrivileges && event.noPoints && (
{hasPrivileges && (
<View className='h-full items-center justify-center mx-2'>
<TouchableOpacity
onPress={() => { navigation.navigate("QRCode", { event: event }) }}
Expand Down
11 changes: 1 addition & 10 deletions src/screens/events/EventInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ const EventInfo = ({ navigation }: EventProps) => {
const getEventButtonState = (event: SHPEEvent, userEventLog: SHPEEventLog | null): EventButtonState => {
const now = new Date();

//Event does not give points
if (!event?.noPoints){
return EventButtonState.NO_POINTS;
}

// Event has not started
if (now < new Date(startTime!.toDate().getTime() - (startTimeBuffer || 0))) {
return EventButtonState.NOT_STARTED;
Expand Down Expand Up @@ -229,7 +224,7 @@ const EventInfo = ({ navigation }: EventProps) => {
</View>
</SafeAreaView>

{hasPrivileges && event.noPoints && (
{hasPrivileges && (
<TouchableOpacity
onPress={() => {
navigation.navigate("QRCode", { event: event })
Expand Down Expand Up @@ -369,9 +364,6 @@ const EventInfo = ({ navigation }: EventProps) => {
{eventButtonState === EventButtonState.SIGN_OUT && (
<Text className='text-center text-white text-2xl font-bold'>Sign Out</Text>
)}
{eventButtonState === EventButtonState.NO_POINTS && (
<Text className={`text-center ${darkMode ? 'text-grey-light' : 'text-grey-dark'} text-xl`}>This event does not give points</Text>
)}
{eventButtonState === EventButtonState.NOT_STARTED && (
<Text className={`text-center ${darkMode ? 'text-grey-light' : 'text-grey-dark'} text-xl`}>This event has not started</Text>
)}
Expand Down Expand Up @@ -479,7 +471,6 @@ enum EventButtonState {
RECEIVED_POINTS = "You receive points for this event",
SIGN_OUT = "Sign out of this event",
SIGN_IN = "Sign in",
NO_POINTS = "No Points for this event"
}

export type EventInfoScreenRouteProp = RouteProp<EventsStackParams, "EventInfo">;
Expand Down
2 changes: 1 addition & 1 deletion src/screens/events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ const Events = ({ navigation }: EventsProps) => {
<Text className='text-md font-semibold text-white'>{formatTime(event.startTime?.toDate()!)}</Text>
</View>
</LinearGradient>
{hasPrivileges && event.noPoints && (
{hasPrivileges && (
<TouchableOpacity
onPress={() => { navigation.navigate("QRCode", { event: event }) }}
className='absolute right-0 top-0 p-2 m-2 rounded-full'
Expand Down
23 changes: 0 additions & 23 deletions src/screens/events/SetSpecificEventDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const SetSpecificEventDetails = ({ navigation }: EventProps) => {
const [endTimeBuffer, setEndTimeBuffer] = useState<number | undefined>(event.endTimeBuffer ?? 20 * 60000);
const [hiddenEvent, setHiddenEvent] = useState<boolean | undefined>(event.hiddenEvent ?? undefined);
const [isGeneral, setIsGeneral] = useState<boolean>(event.general ?? false);
const [noPoints, setNoPoints] = useState<boolean | undefined>(event.noPoints ?? undefined);


const eventTypeNotification = ["Study Hours", "Workshop", "Volunteer Event", "Social Event", "Intramural Event"]
Expand Down Expand Up @@ -417,28 +416,6 @@ const SetSpecificEventDetails = ({ navigation }: EventProps) => {
/>
</View>

<View className={`flex-row items-center justify-between w-full px-4 h-16 rounded-lg ${darkMode ? 'bg-secondary-bg-dark' : 'bg-secondary-bg-light'}`}
style={{
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
}}
>
<Text className={`flex-1 text-xl font-semibold ${darkMode ? "text-white" : "text-black"}`}>Event No Points</Text>
<Switch
trackColor={{ false: "#B4B4B4", true: "#1870B8" }}
thumbColor={"white"}
ios_backgroundColor="#999796"
onValueChange={() => setNoPoints(previousState => !previousState)}
value={noPoints}
/>
</View>

<View>
<View className={`flex-row items-center justify-between w-full px-4 h-16 rounded-lg ${darkMode ? 'bg-secondary-bg-dark' : 'bg-secondary-bg-light'}`}
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/screens/home/MemberSHPE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const MemberSHPE = ({ navigation }: NativeStackScreenProps<HomeStackParams>) =>
className='text-primary-blue font-bold text-xl underline'
>
t-shirt
</Text>, and be sure to take a screenshot of your
</Text> and be sure to take a screenshot of your
<Text className='font-bold'> receipt</Text> and upload it below.
</Text>

Expand Down
3 changes: 0 additions & 3 deletions src/types/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ export abstract class SHPEEvent {
public notificationSent?: boolean | null;
/** Hide event from Events Screen */
public hiddenEvent?: boolean | null;
/** A flag to indicate if an event should count towards points or not */
public noPoints?: boolean | null;


/**
Expand All @@ -85,7 +83,6 @@ export abstract class SHPEEvent {
this.endTimeBuffer = null;
this.startTimeBuffer = null;
this.hiddenEvent = false;
this.noPoints = false;
}

/**
Expand Down

0 comments on commit bfe2258

Please sign in to comment.