Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/app/Schedule/SchedulePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ export default function SchedulePage({ currentShow }: SchedulePageProps) {
show.name,
);

const showDetails = await scheduleService.getShowById(show.id);

if (showWithArchiveData && showWithArchiveData.archives.length > 0) {
navigation.navigate('ShowDetails' as WmbrRouteName, {
show: showWithArchiveData,
showDescription: showDetails?.description || '',
});
} else {
// If no archives found, show info message
Expand Down
32 changes: 20 additions & 12 deletions src/app/Schedule/ShowDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const CIRCLE_DIAMETER = 16;
// Route params for ShowDetailsPage
export type ShowDetailsPageRouteParams = {
show: Show;
showDescription: string;
};

export default function ShowDetailsPage() {
Expand All @@ -69,7 +70,7 @@ export default function ShowDetailsPage() {

const route =
useRoute<RouteProp<Record<string, ShowDetailsPageRouteParams>, string>>();
const show: Show = route.params!.show;
const { show, showDescription } = route.params;

const headerHeight = useHeaderHeight();

Expand Down Expand Up @@ -306,9 +307,14 @@ export default function ShowDetailsPage() {
{/* Show Info */}
<View style={styles.infoSection}>
<Text style={styles.showTitle}>{show.name}</Text>
<Text style={styles.showSchedule}>{formatShowTime(show)}</Text>
{show.hosts && (
<Text style={styles.showHosts}>Hosted by {show.hosts}</Text>
<View>
<Text style={styles.showSchedule}>{formatShowTime(show)}</Text>
{show.hosts && (
<Text style={styles.showHosts}>Hosted by {show.hosts}</Text>
)}
</View>
{showDescription && (
<Text style={styles.showDescription}>{showDescription}</Text>
)}
<Text style={styles.archiveCount}>
{archives.length} archived episode
Expand Down Expand Up @@ -473,27 +479,29 @@ const styles = StyleSheet.create({
infoSection: {
paddingHorizontal: 20,
paddingBottom: 30,
flexDirection: 'column',
rowGap: 8,
},
showTitle: {
color: COLORS.TEXT.PRIMARY,
fontSize: 32,
fontWeight: 'bold',
marginBottom: 8,
},
showSchedule: {
color: COLORS.TEXT.SECONDARY,
fontSize: 16,
marginBottom: 4,
color: COLORS.TEXT.TERTIARY,
fontSize: 14,
},
showHosts: {
color: COLORS.TEXT.SECONDARY,
color: COLORS.TEXT.TERTIARY,
fontSize: 14,
},
showDescription: {
color: COLORS.TEXT.PRIMARY,
fontSize: 16,
marginBottom: 8,
},
archiveCount: {
color: COLORS.TEXT.SECONDARY,
color: COLORS.TEXT.TERTIARY,
fontSize: 14,
fontWeight: '500',
},
archivesSection: {
paddingHorizontal: 20,
Expand Down
14 changes: 14 additions & 0 deletions src/services/ScheduleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,20 @@ export class ScheduleService {
return weeksSince % 2 === 0;
}

async getShowById(showId: string): Promise<ScheduleShow | null> {
try {
const scheduleData = await this.fetchSchedule();

const matchingShow =
scheduleData.shows.find(show => show.id === showId) || null;

return matchingShow;
} catch (error) {
debugError('Error getting show by ID:', error);
return null;
}
}

// Helper method to find the previous show based on current time
async findPreviousShow(
currentShowName: string,
Expand Down