Skip to content

Commit

Permalink
fix: remove preview card
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys committed Aug 23, 2022
1 parent 65ca253 commit 5741534
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
41 changes: 29 additions & 12 deletions components/common/Note/MarkdownRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,7 @@ export function MarkdownRenderer({
);
},
a: function Link({ node, ...props }) {
const { data, isLoading, isSuccess } = useLinkPreview(
props.href
);
return isLoading ? (
<LinkPreviewSkeleton />
) : isSuccess &&
data &&
(("siteName" in data && data.siteName) ||
("title" in data && data.title) ||
("description" in data && data.description)) ? (
<LinkPreviewCard data={data} />
) : (
return (
<Text
size={fontSize}
variant="link"
Expand All @@ -158,6 +147,34 @@ export function MarkdownRenderer({
{props.children}
</Text>
);
// TODO: better UI
// const { data, isLoading, isSuccess } = useLinkPreview(
// props.href
// );
// return isLoading ? (
// <LinkPreviewSkeleton />
// ) : isSuccess &&
// data &&
// (("siteName" in data && data.siteName) ||
// ("title" in data && data.title) ||
// ("description" in data && data.description)) ? (
// <LinkPreviewCard data={data} />
// ) : (
// <Text
// size={fontSize}
// variant="link"
// component="a"
// href={props.href}
// target={
// props.href && isExternalUrl(props.href)
// ? "_blank"
// : undefined
// }
// rel="noreferrer"
// >
// {props.children}
// </Text>
// );
},
table: ({ node, ...props }) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/layouts/AppLayout/MoreMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function MoreMenu() {

<Menu.Label>Ecosystem</Menu.Label>
<MenuItemLink href="https://crosssync.app/">CrossSync</MenuItemLink>
<MenuItemLink href="https://xlog.app/">Xlog</MenuItemLink>
<MenuItemLink href="https://xlog.app/">xlog</MenuItemLink>
</Menu.Dropdown>
</Menu>
);
Expand Down
2 changes: 1 addition & 1 deletion components/ui/CharacterManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function CharacterManagement({
form.setFieldValue("handle", "");
}
}
}, [form, form.values.name, mode]);
}, [form.values.name, mode]);

// check if handle is taken
const [debouncedHandle] = useDebouncedValue(form.values.handle, 200);
Expand Down
1 change: 0 additions & 1 deletion components/ui/CharacterProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
composeCharacterFollowHref,
composeWalletCharacterEditHref,
} from "@/utils/url";
import { useRouter } from "next/router";
import Link from "next/link";

// used in character page to display the profile
Expand Down

0 comments on commit 5741534

Please sign in to comment.