Skip to content

Conversation

@icycoldveins
Copy link
Collaborator

@icycoldveins icycoldveins commented Jan 21, 2026

Summary

Adds "Provided By" feature to display organization attribution when viewing a resource.

  • Display provider logo and/or name below "Last Modified" section
  • Support multiple providers with "+X more" overflow and popover
  • Logo mapping utility for local assets by provider name
  • Avatar fallback (first letter) when no logo available

Screenshot

providedby_ui

Changes

  • src/types/ResourceEntry.ts - Added Provider type
  • src/components/ProvidedBy/ProvidedBy.tsx - New component with extracted ProviderAvatar and ProviderLink subcomponents
  • src/utils/providerLogos.ts - Logo mapping utility
  • src/assets/logos/share-food-program.png - Share Food Program logo
  • src/components/SelectedResourceDetails/SelectedResourceDetails.tsx - Integration

Refactoring

  • Extracted ProviderAvatar component to handle logo/fallback avatar rendering
  • Extracted ProviderLink component for conditional URL wrapping
  • Removed redundant helper functions and inlined simple handlers
  • Reduced component from 232 to 192 lines

Closes #691

Co-authored-by: Claude [email protected]

Add Provider type to ResourceEntry and create ProvidedBy component
that displays organization attribution with logo/name support.
Supports multiple providers with "+X more" overflow handling.
- Add Share Food Program logo as local asset for testing
- Implement image fallback to Avatar when logo fails to load
- Increase logo size to 40x40 for better visibility
- Position ProvidedBy below Last Modified section
Logo resolution now checks both provider.logo_url and a local mapping
by provider name. This allows storing logos as local assets while
keeping provider data simple (just name and url).
Component now only displays when resource.providers has actual data.
@icycoldveins icycoldveins marked this pull request as ready for review January 21, 2026 01:10
| 'HIDDEN';

/** An organization or entity that provided/contributed this resource. */
export type Provider = {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • When looking in the database, I couldn't find a provider field in the resource table. Is this feature already connected?
  • Are we expecting to have more than a single provider per resource? I wonder if having a list of providers per resource makes sense, or if we should connect a single provider per resource.
  • I'd expect providers to be a separate table that we join with a foreign key from the resources table when we query for the resource, so that we can define each provider and their logo, url information

Copy link
Collaborator Author

@icycoldveins icycoldveins Jan 28, 2026

Choose a reason for hiding this comment

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

  • nope. We'd have to add a new field for providers.

  • I should probably ask billy about the possiblity of having more than two providers for a resource.

  • I was thinking of hardcoding the logos and the url just because I kinda doubt we'll have many providers, but should probably get clarification 😅.

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.

Display 'Provided By' organization when viewing a resource

3 participants