Skip to content

Conversation

jkartoshka
Copy link
Collaborator

@jkartoshka jkartoshka commented Oct 2, 2025

Adding Content Card Container UI Component

Description

  • Content card container now fetches container settings from the API and uses them to:
  • Decide orientation, capacity, heading, and empty state.
  • Apply unread indicator/background if enabled.
  • Sample app wired to a surface so remote content cards are displayed through the container.

Related Issue

https://jira.corp.adobe.com/browse/MOB-24117

Screenshots (if appropriate):

Vertical Layout (w/o Unread Background Color):

Screen.Recording.2025-10-03.at.4.11.23.PM.mov

Horizontal Layout (w/ Unread Background Color):

Screen.Recording.2025-10-03.at.4.06.08.PM.mov

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@dsoffiantini dsoffiantini force-pushed the content-card-containers branch 7 times, most recently from 81521eb to 00e7269 Compare October 6, 2025 16:25
import { Text, View } from "react-native";

function UnreadIcon() {
function UnreadIcon({ placement, image }: { placement: string|undefined, image: { url: string; darkUrl?: string | undefined; } | undefined }) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Calise is doing this component

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just placeholder

const { content, error, isLoading } = useContentCardUI(surface);

const scheme = useColorScheme();
const headingColor = Platform.OS === 'ios'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this os condition returns the same either way

const { heading, layout, emptyStateSettings, unread_indicator, isUnreadEnabled } = contentSettings;

// Derived flags used across renders
const isHorizontal = layout?.orientation === 'horizontal';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should all be memoized

const styles = StyleSheet.create({
contentContainer: {
flex: 1,
minHeight: 140,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would not used defined heights/widths here or the other styles. Let the content dictate it or the user

data={content as T[]}
contentContainerStyle={[styles.contentContainer, contentContainerStyle]}
horizontal={settings?.content?.layout?.orientation === "horizontal"}
ItemSeparatorComponent={() => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont need a separator component. The user can add one if theyd like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants