Skip to content

feat(ONYX-1729): add subtitles support to Editorial and Viewing Rooms home view sections #12146

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 9 additions & 2 deletions src/app/Scenes/HomeView/Components/ArticlesRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ interface ArticlesRailProps {
onTitlePress?: () => void
onPress?: (article: ExtractNodeType<ArticlesRail_articlesConnection$data>, index: number) => void
title: string
subtitle?: string
titleHref?: string | null
}

export const ArticlesRail: React.FC<ArticlesRailProps> = memo(
({ onTitlePress, onPress, title, titleHref, ...restProps }) => {
({ onTitlePress, onPress, title, subtitle, titleHref, ...restProps }) => {
const articlesConnection = useFragment(articlesConnectionFragment, restProps.articlesConnection)

const articles = extractNodes(articlesConnection)
Expand All @@ -35,7 +36,13 @@ export const ArticlesRail: React.FC<ArticlesRailProps> = memo(

return (
<Flex>
<SectionTitle href={titleHref} mx={2} onPress={onTitlePress} title={title} />
<SectionTitle
href={titleHref}
mx={2}
onPress={onTitlePress}
title={title}
subtitle={subtitle}
/>

<Flex>
<FlatList
Expand Down
2 changes: 2 additions & 0 deletions src/app/Scenes/HomeView/Sections/HomeViewSectionArticles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const HomeViewSectionArticles: React.FC<HomeViewSectionArticlesProps> = (
)
}}
title={section.component?.title ?? ""}
subtitle={section.component?.description ?? ""}
titleHref={viewAll?.href}
/>

Expand All @@ -71,6 +72,7 @@ const sectionFragment = graphql`
contextModule
component {
title
description
behaviors {
viewAll {
href
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ export const HomeViewSectionViewingRooms: React.FC<HomeViewSectionViewingRoomsPr

return (
<Flex {...flexProps}>
<SectionTitle href={href} px={2} title={section.component?.title} onPress={onHeaderPress} />
<SectionTitle
href={href}
px={2}
title={section.component?.title}
subtitle={section.component?.description}
onPress={onHeaderPress}
/>

<Suspense fallback={<ViewingRoomsRailPlaceholder />}>
<LegacyViewingRoomsHomeRail
Expand Down Expand Up @@ -83,6 +89,7 @@ const viewingRoomsFragment = graphql`
contextModule
component {
title
description
behaviors {
viewAll {
href
Expand Down