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

Profile redesign and bugfixes #358

Merged
merged 4 commits into from
Oct 7, 2024
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
49 changes: 47 additions & 2 deletions components/profileScreen/BookedEventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ import { Dimensions, FlatList, StyleSheet, View } from "react-native";
import { Event } from "api/Events";
import { EventListItem } from "../eventList/EventListItem";
import { API } from "api/API";
import { ArkadText } from "components/StyledText";
import Colors from "constants/Colors";
import { FontAwesome } from "@expo/vector-icons";

type BookedEventListProps = {
bookedEvents: Event[] | null;
onPress: (eventId: number) => void;
};

const windowWidth = Dimensions.get("window").width;
const windowHeight = Dimensions.get("window").height;
const itemHeight = windowHeight * 0.25;


export const BookedEventList = ({
bookedEvents,
Expand All @@ -35,14 +41,32 @@ export const BookedEventList = ({
const ticket_eventid = getTicketsForEvent(event);

return (
<View style={styles.item}>
<View style={[styles.item, { height: itemHeight }]}>
<EventListItem
event={event}
itemStyle={{ width: windowWidth * 0.6 }}
onPress={() => onPress(event.id)}
ticket_eventid={ticket_eventid}
odd={false}
/>
<View>
<ArkadText style={styles.eventText} text={event.name} />
</View>
<View style={styles.infoRow}>
<ArkadText
style={{
...styles.infoText,
color: Colors.arkadOrange,
paddingRight: 10,
}}
text={API.events.formatTime(
event.date,
event.start,
event.end
)}
/>
</View>

</View>
);
}}
Expand All @@ -57,8 +81,29 @@ const styles = StyleSheet.create({
alignItems: "center",
},
item: {
height: 150,
height: 300,
alignItems: "center",
justifyContent: "flex-start",
},
infoText: {
fontSize: 16,
textAlign: "left",
fontFamily: "main-font-bold",
paddingLeft: 10, // Adjust padding to align text properly
},
infoRow: {
paddingLeft: 10,
flexDirection: "row",
alignItems: "center",
},
eventText: {
paddingLeft: 10,
fontSize: 20,
textAlign: "left",
fontFamily: "main-font-bold",
color: Colors.white,
paddingTop: 10, // Space between event box and event name
},


});
6 changes: 3 additions & 3 deletions components/profileScreen/StudentProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Colors from "constants/Colors";
import { Programme, Student } from "api/Students";
import { ArkadButton } from "../Buttons";
import { ArkadText } from "../StyledText";
import { IconLinkButton } from "components/companies/IconLinkButton";

type StudentProfileProps = {
student: Student;
Expand Down Expand Up @@ -48,9 +49,8 @@ const OpenURLButton = (url: string) => {
}, [url]);

return (
<ArkadButton onPress={handlePress}>
<ArkadText text={"Open linkedIn profile"} />
</ArkadButton>
<IconLinkButton icon={require("../../assets/images/linked-in-icon.png")} url={url} text="LinkedIn" style={{backgroundColor: Colors.white}} />

);
};

Expand Down
4 changes: 2 additions & 2 deletions screens/event/EventDetailsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ const styles = StyleSheet.create({
gap: 16,
},
title: {
fontSize: 32,
fontSize: 20,
color: Colors.white,
textAlign: "left",
textAlign: "center",
width: "100%",
},
headerItem: {
Expand Down
4 changes: 2 additions & 2 deletions screens/event/EventListScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { TouchableOpacity, StyleSheet, Dimensions } from "react-native";
import { TouchableOpacity, StyleSheet, Dimensions, ViewStyle } from "react-native";
import Animated, {
useSharedValue,
useAnimatedStyle,
Expand Down Expand Up @@ -135,7 +135,7 @@ export default function EventListScreen({ navigation }: EventsNavigation) {
const animatedStyle = useAnimatedStyle(() => {
return {
transform: [{ translateX: translateX.value }],
};
} as Animated.AnimateStyle<ViewStyle>;
});

return (
Expand Down
2 changes: 1 addition & 1 deletion screens/profile/EditProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ArkadButton } from "components/Buttons";
import EditStudentProfile from "components/profileScreen/EditStudentProfile";
import EditCompanyProfile from "components/profileScreen/EditCompanyProfile";
import EditVolunteerProfile from "components/profileScreen/EditVolunteerProfile";

//TODO make nice
export type EditStatus = {
ok: boolean;
message: string | null;
Expand Down
Loading