Harvest valuable features from external/ reference repos, adapted to each product's stack and wired in; all products typecheck clean. - gitgram-web (5): clickable @mention/#hashtag linkify in rendered content (munia), + feed/notification/accessibility patterns; install @testing-library/dom - gitgram-backend (3): feed thread dedup + muted-thread removal (bluesky), GitHub star/follow write-back via OAuth (gh-social) - gitgram-mobile (4): double-tap-to-like + heart bounce (proximity), haptics layer (bluesky useHaptics), + gesture/feed UX - aitm-api (4): beads ready/dependency-DAG endpoints + atomic claim (beads) - aitm-mcp (6): beads_ready work-queue tool, context-efficient projections, transport arg aliasing (context7/pal-mcp/beads) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 lines
563 B
TypeScript
25 lines
563 B
TypeScript
import { useCallback } from 'react';
|
|
|
|
import { useLightboxStore, LightboxImage } from './lightboxStore';
|
|
|
|
/**
|
|
* Convenience hook to open the global lightbox from any component.
|
|
*
|
|
* Usage:
|
|
* const openLightbox = useLightbox();
|
|
* openLightbox([{ uri, alt }], 0);
|
|
*/
|
|
export function useLightbox(): (
|
|
images: LightboxImage[],
|
|
initialIndex?: number,
|
|
) => void {
|
|
const open = useLightboxStore((state) => state.open);
|
|
|
|
return useCallback(
|
|
(images: LightboxImage[], initialIndex = 0) => {
|
|
open(images, initialIndex);
|
|
},
|
|
[open],
|
|
);
|
|
}
|