PhoenixKitPhotos.Components.ViewerPicker (PhoenixKit Photos v0.3.0)

Copy Markdown View Source

A select for the viewer of one library (PhoenixKitPhotos.Viewer): "Default", "Swipe viewer", "Classic viewer". It shows nothing to someone who may not choose (Viewer.can_set?/2), and checks again when it saves.

Usage

<.live_component
  module={PhoenixKitPhotos.Components.ViewerPicker}
  id="viewer-picker"
  library_uuid={library_uuid}
  auth={scope}
/>

When the choice is saved the parent LiveView gets {:viewer_changed, library_uuid} and reads PhoenixKitPhotos.Viewer.for_library/1 again.