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

Function ContentModal

packages/shared/src/components/modals/ContentModal.tsx:22–87  ·  view source on GitHub ↗
({
  onRequestClose,
  videoUrl,
  imageUrl,
  mediaType = 'image',
  title,
  description,
  buttonText = 'Got it',
  ...props
}: ContentModalProps)

Source from the content-addressed store, hash-verified

20}
21
22export default function ContentModal({
23 onRequestClose,
24 videoUrl,
25 imageUrl,
26 mediaType = 'image',
27 title,
28 description,
29 buttonText = 'Got it',
30 ...props
31}: ContentModalProps): ReactElement {
32 return (
33 <Modal
34 kind={ModalKind.FlexibleCenter}
35 size={ModalSize.Small}
36 onRequestClose={onRequestClose}
37 isDrawerOnMobile
38 {...props}
39 >
40 <div className="flex w-full flex-col items-center">
41 <div className="w-full rounded-t-16 bg-surface-active">
42 {mediaType === 'video' ? (
43 <video
44 className="aspect-video w-full border-none"
45 poster={imageUrl}
46 src={videoUrl}
47 muted
48 autoPlay
49 loop
50 playsInline
51 disablePictureInPicture
52 controls={false}
53 title={title}
54 />
55 ) : (
56 <img src={imageUrl} alt={title} className="h-70 w-full" />
57 )}
58 </div>
59 <div className="flex w-full flex-col gap-4 p-6">
60 <div className="flex flex-col gap-3">
61 <Typography
62 type={TypographyType.Title3}
63 color={TypographyColor.Primary}
64 bold
65 >
66 {title}
67 </Typography>
68 <Typography
69 type={TypographyType.Callout}
70 color={TypographyColor.Tertiary}
71 >
72 {description}
73 </Typography>
74 </div>
75 <Button
76 variant={ButtonVariant.Primary}
77 size={ButtonSize.Medium}
78 className="mt-3 w-full"
79 onClick={onRequestClose}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected