MCPcopy Create free account
hub / github.com/dailydotdev/apps / PollPostModal

Function PollPostModal

packages/shared/src/components/modals/PollPostModal.tsx:20–75  ·  view source on GitHub ↗
({
  id,
  className,
  onRequestClose,
  onPreviousPost,
  onNextPost,
  postPosition,
  post,
  ...props
}: PollPostModalProps)

Source from the content-addressed store, hash-verified

18}
19
20export default function PollPostModal({
21 id,
22 className,
23 onRequestClose,
24 onPreviousPost,
25 onNextPost,
26 postPosition,
27 post,
28 ...props
29}: PollPostModalProps): ReactElement {
30 const { position, onLoad } = usePostNavigationPosition({
31 isDisplayed: props.isOpen,
32 offset: 0,
33 });
34
35 return (
36 <BasePostModal
37 {...props}
38 post={post}
39 onAfterOpen={onLoad}
40 size={Modal.Size.XLarge}
41 navigationContentOwnsActions
42 onRequestClose={onRequestClose}
43 postType={PostType.Poll}
44 source={post.source}
45 loadingClassName="!pb-2 tablet:pb-0"
46 postPosition={postPosition}
47 onPreviousPost={onPreviousPost}
48 onNextPost={onNextPost}
49 >
50 <EnableNotification
51 source={NotificationPromptSource.SquadPostModal}
52 label={
53 isSourceUserSource(post?.source)
54 ? post?.author?.username
55 : post?.source?.handle
56 }
57 />
58 <PollPostContent
59 position={position}
60 post={post}
61 onPreviousPost={onPreviousPost}
62 onNextPost={onNextPost}
63 postPosition={postPosition}
64 inlineActions
65 onClose={onRequestClose}
66 origin={Origin.ArticleModal}
67 className={{
68 fixedNavigation: { container: '!w-[inherit]', actions: 'ml-auto' },
69 navigation: { actions: 'ml-auto tablet:hidden' },
70 onboarding: 'mb-0 mt-8',
71 }}
72 />
73 </BasePostModal>
74 );
75}

Callers

nothing calls this directly

Calls 2

isSourceUserSourceFunction · 0.90

Tested by

no test coverage detected