[Glitch] Fix preview for local collection links
Port d7b60a2cb6 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
1 parent
0e4878c733
commit
5bcb9ae43d
4 files changed
+23
-3
No files matched your search
+3
-1
@@ -1,3 +1,5 @@
|
||||
import classNames from 'classnames';
|
||||
|
||||
import type { CollectionLockupProps } from 'flavours/glitch/features/collections/components/collection_lockup';
|
||||
import { CollectionLockup } from 'flavours/glitch/features/collections/components/collection_lockup';
|
||||
|
||||
@@ -13,7 +15,7 @@ export const CollectionPreviewCard: React.FC<CollectionPreviewCardProps> = ({
|
||||
...otherProps
|
||||
}) => {
|
||||
return (
|
||||
<div className={classes.wrapper}>
|
||||
<div className={classNames(classes.wrapper, 'collection-preview')}>
|
||||
<CollectionLockup collection={collection} {...otherProps} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -316,6 +316,13 @@ export const DetailedStatus: React.FC<{
|
||||
}
|
||||
|
||||
mediaIcons.push('link');
|
||||
} else if (status.get('tagged_collections').size) {
|
||||
const firstLinkedCollection = status.get('tagged_collections').first();
|
||||
if (firstLinkedCollection) {
|
||||
media = (
|
||||
<CollectionPreviewCard collection={firstLinkedCollection.toJS()} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (status.get('poll')) {
|
||||
|
||||
Reference in new issue
Block a user