Revert "Feat/customizable links"

This commit is contained in:
Daniel
2024-08-18 14:46:52 -04:00
committed by GitHub
parent ee2319996b
commit 9a3e82470a
28 changed files with 326 additions and 976 deletions
+16 -5
View File
@@ -46,6 +46,13 @@ export default function ReadableView({ link }: Props) {
const router = useRouter();
const getLink = useGetLink();
const { data: collections = [] } = useCollections();
const collection = useMemo(() => {
return collections.find(
(e) => e.id === link.collection.id
) as CollectionIncludingMembersAndLinkCount;
}, [collections, link]);
useEffect(() => {
const fetchLinkContent = async () => {
@@ -66,7 +73,7 @@ export default function ReadableView({ link }: Props) {
}, [link]);
useEffect(() => {
if (link) getLink.mutateAsync({ id: link.id as number });
if (link) getLink.mutateAsync(link?.id as number);
let interval: any;
if (
@@ -81,10 +88,7 @@ export default function ReadableView({ link }: Props) {
!link?.monolith)
) {
interval = setInterval(
() =>
getLink.mutateAsync({
id: link.id as number,
}),
() => getLink.mutateAsync(link.id as number),
5000
);
} else {
@@ -239,6 +243,13 @@ export default function ReadableView({ link }: Props) {
{link?.name ? <p>{unescapeString(link?.description)}</p> : undefined}
</div>
<LinkActions
link={link}
collection={collection}
position="top-3 right-3"
alignToTop
/>
</div>
<div className="flex flex-col gap-5 h-full">