refactor component/page function returns

This commit is contained in:
jake committed 2022-05-25 09:30:11 -04:00
1 parent ff96ccae44
commit 1e1ecd89ea
31 files changed
+2347 -2281

No files matched your search

+13 -11
View File
@@ -25,16 +25,18 @@ const Link = styled(NextLink, {
export type NoteTitleProps = Pick<NoteFrontMatter, "slug" | "htmlTitle"> & ComponentProps<typeof Title>;
const NoteTitle = ({ slug, htmlTitle, ...rest }: NoteTitleProps) => (
<Title {...rest}>
<Link
href={{
pathname: "/notes/[slug]/",
query: { slug },
}}
dangerouslySetInnerHTML={{ __html: htmlTitle }}
/>
</Title>
);
const NoteTitle = ({ slug, htmlTitle, ...rest }: NoteTitleProps) => {
return (
<Title {...rest}>
<Link
href={{
pathname: "/notes/[slug]/",
query: { slug },
}}
dangerouslySetInnerHTML={{ __html: htmlTitle }}
/>
</Title>
);
};
export default NoteTitle;