Skip to content

Commit

Permalink
Fix formating issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kandiecindy committed Sep 21, 2024
1 parent 9a47c56 commit 4af1fb4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 28 deletions.
4 changes: 2 additions & 2 deletions app/(tabs)/home/speakers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const SpeakersTab = () => {
setLoading(true);
setError(false);
try {
const res = await fetch("https://sessionize.com/api/v2/d899srzm/view/Speakers");
if (!res.ok) throw new Error("Failed to fetch speakers");
const res = await fetch('https://sessionize.com/api/v2/d899srzm/view/Speakers');
if (!res.ok) throw new Error('Failed to fetch speakers');
const data = await res.json();
setSpeakerList(data);
} catch (error) {
Expand Down
6 changes: 1 addition & 5 deletions app/(tabs)/speakers/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ const SpeakerPage = () => {
<ScrollView style={styles.container}>
<View style={styles.header}>
<Text style={styles.name}>{speaker.fullName}</Text>
<Image
source={{ uri: speaker.profilePicture }}
style={styles.image}
resizeMode="cover"
/>
<Image source={{ uri: speaker.profilePicture }} style={styles.image} resizeMode="cover" />
<Text style={styles.occupation}>{speaker.occupation}</Text>
</View>

Expand Down
10 changes: 2 additions & 8 deletions components/SpeakerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ interface SpeakerCardProps {
const SpeakerCard: React.FC<SpeakerCardProps> = ({ speaker }) => {
return (
<View style={styles.card}>

{speaker.profilePicture ? (
<Image
source={{ uri: speaker.profilePicture }}
style={styles.image}
resizeMode="cover"
/>
<Image source={{ uri: speaker.profilePicture }} style={styles.image} resizeMode="cover" />
) : (
<View style={styles.imageFallback}>
<Text style={styles.imageFallbackText}>No Image</Text>
Expand All @@ -25,7 +20,7 @@ const SpeakerCard: React.FC<SpeakerCardProps> = ({ speaker }) => {
<View style={styles.textContainer}>
<Text style={styles.name}>{speaker.fullName}</Text>
<Link href={`/speakers/${speaker.id}`}>
<Text style={styles.occupation}>{speaker.sessions[0]?.name || 'Session you cant afford to miss!'}</Text>
<Text style={styles.occupation}>{speaker.sessions[0]?.name || 'Session you cant afford to miss!'}</Text>
</Link>
</View>
</View>
Expand Down Expand Up @@ -77,7 +72,6 @@ const styles = StyleSheet.create({
fontSize: 14,
color: '#fff', // text color
marginTop: 4,

},
});

Expand Down
13 changes: 6 additions & 7 deletions components/Speakers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const Speakers = () => {
setLoading(true);
setError(false);
try {
const res = await fetch("https://sessionize.com/api/v2/d899srzm/view/Speakers");
if (!res.ok) throw new Error("Failed to fetch speakers");
const res = await fetch('https://sessionize.com/api/v2/d899srzm/view/Speakers');
if (!res.ok) throw new Error('Failed to fetch speakers');
const data = await res.json();
setSpeakerList(data);
} catch (error) {
Expand All @@ -31,9 +31,9 @@ const Speakers = () => {

return (
<View style={styles.container}>
<StyledText size="lg" font="semiBold" style={styles.header}>
Speakers
</StyledText>
<StyledText size="lg" font="semiBold" style={styles.header}>
Speakers
</StyledText>
{loading ? (
<ActivityIndicator size="large" color={palette.palette.secondary} /> // Access secondary color correctly
) : error ? (
Expand All @@ -58,8 +58,7 @@ const styles = StyleSheet.create({
header: {
fontSize: 24,
fontWeight: '700',
color
: '#eee712', // secondary color
color: '#eee712', // secondary color
textAlign: 'left',
marginBottom: 16,
},
Expand Down
11 changes: 5 additions & 6 deletions components/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// types.ts
export type Speaker = {
id: string;
fullName: string;
profilePicture: string;
sessions: { name: string }[];
};

id: string;
fullName: string;
profilePicture: string;
sessions: { name: string }[];
};

0 comments on commit 4af1fb4

Please sign in to comment.