From a509f72c40647a2a46ace63ec5f5f8b35a3c2c2c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 1 Aug 2022 17:35:04 -0500 Subject: [PATCH] Create Ad component --- app/soapbox/features/ads/components/ad.tsx | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/soapbox/features/ads/components/ad.tsx diff --git a/app/soapbox/features/ads/components/ad.tsx b/app/soapbox/features/ads/components/ad.tsx new file mode 100644 index 000000000..aee9c374a --- /dev/null +++ b/app/soapbox/features/ads/components/ad.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +import { FormattedMessage } from 'react-intl'; + +import { Stack, HStack, Card, Avatar, Text, Icon } from 'soapbox/components/ui'; +import { useAppSelector } from 'soapbox/hooks'; + +import type { Card as CardEntity } from 'soapbox/types/entities'; + +interface IAd { + card: CardEntity, +} + +/** Displays an ad in sponsored post format. */ +const Ad: React.FC = ({ card }) => { + const instance = useAppSelector(state => state.instance); + + return ( + + + + + + + + + {instance.title} + + + + + + + + + + + + + + + + {card.image && ( + + + + )} + + + ); +}; + +export default Ad;