Card --> PreviewCard
This commit is contained in:
parent
971bcb41e4
commit
f583e7eeb5
|
@ -20,7 +20,7 @@ const trim = (text: string, len: number): string => {
|
||||||
return text.substring(0, cut) + (text.length > len ? '…' : '');
|
return text.substring(0, cut) + (text.length > len ? '…' : '');
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ICard {
|
interface IPreviewCard {
|
||||||
card: CardEntity;
|
card: CardEntity;
|
||||||
maxTitle?: number;
|
maxTitle?: number;
|
||||||
maxDescription?: number;
|
maxDescription?: number;
|
||||||
|
@ -31,7 +31,7 @@ interface ICard {
|
||||||
horizontal?: boolean;
|
horizontal?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Card: React.FC<ICard> = ({
|
const PreviewCard: React.FC<IPreviewCard> = ({
|
||||||
card,
|
card,
|
||||||
defaultWidth = 467,
|
defaultWidth = 467,
|
||||||
maxTitle = 120,
|
maxTitle = 120,
|
||||||
|
@ -253,4 +253,4 @@ const Card: React.FC<ICard> = ({
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Card;
|
export default PreviewCard;
|
|
@ -2,9 +2,9 @@ import React, { Suspense } from 'react';
|
||||||
|
|
||||||
import { openModal } from 'soapbox/actions/modals';
|
import { openModal } from 'soapbox/actions/modals';
|
||||||
import AttachmentThumbs from 'soapbox/components/attachment-thumbs';
|
import AttachmentThumbs from 'soapbox/components/attachment-thumbs';
|
||||||
|
import PreviewCard from 'soapbox/components/preview-card';
|
||||||
import { GroupLinkPreview } from 'soapbox/features/groups/components/group-link-preview';
|
import { GroupLinkPreview } from 'soapbox/features/groups/components/group-link-preview';
|
||||||
import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder-card';
|
import PlaceholderCard from 'soapbox/features/placeholder/components/placeholder-card';
|
||||||
import Card from 'soapbox/features/status/components/card';
|
|
||||||
import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components';
|
import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components';
|
||||||
import { useAppDispatch } from 'soapbox/hooks';
|
import { useAppDispatch } from 'soapbox/hooks';
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ const StatusMedia: React.FC<IStatusMedia> = ({
|
||||||
);
|
);
|
||||||
} else if (status.spoiler_text.length === 0 && !status.quote && status.card) {
|
} else if (status.spoiler_text.length === 0 && !status.quote && status.card) {
|
||||||
media = (
|
media = (
|
||||||
<Card
|
<PreviewCard
|
||||||
onOpenMedia={openMedia}
|
onOpenMedia={openMedia}
|
||||||
card={status.card}
|
card={status.card}
|
||||||
compact
|
compact
|
||||||
|
|
Loading…
Reference in New Issue