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

Function PollPostModal

packages/shared/src/components/modals/PollPostModal.tsx:20–74  ·  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 onRequestClose={onRequestClose}
42 postType={PostType.Poll}
43 source={post.source}
44 loadingClassName="!pb-2 tablet:pb-0"
45 postPosition={postPosition}
46 onPreviousPost={onPreviousPost}
47 onNextPost={onNextPost}
48 >
49 <EnableNotification
50 source={NotificationPromptSource.SquadPostModal}
51 label={
52 isSourceUserSource(post?.source)
53 ? post?.author?.username
54 : post?.source?.handle
55 }
56 />
57 <PollPostContent
58 position={position}
59 post={post}
60 onPreviousPost={onPreviousPost}
61 onNextPost={onNextPost}
62 postPosition={postPosition}
63 inlineActions
64 onClose={onRequestClose}
65 origin={Origin.ArticleModal}
66 className={{
67 fixedNavigation: { container: '!w-[inherit]', actions: 'ml-auto' },
68 navigation: { actions: 'ml-auto tablet:hidden' },
69 onboarding: 'mb-0 mt-8',
70 }}
71 />
72 </BasePostModal>
73 );
74}

Callers

nothing calls this directly

Calls 2

isSourceUserSourceFunction · 0.90

Tested by

no test coverage detected