Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#200] Blog: implement Blockquote component #419

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/blog/src/assets/quote.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/blog/src/components/Blockquote/Blockquote.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export function Blockquote(props: React.BlockquoteHTMLAttributes<HTMLQuoteElement>) {
return (
<blockquote
className="relative border-none font-semibold not-italic pl-[2.5em] lg:pl-[2em] before:content-quote before:absolute before:left-[0]"
{...props}
/>
)
}
1 change: 1 addition & 0 deletions apps/blog/src/components/Blockquote/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Blockquote } from './Blockquote'
3 changes: 2 additions & 1 deletion apps/blog/src/components/Mdx/Mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import Image from 'next/image'
import { useMDXComponent } from 'next-contentlayer/hooks'
import InstagramPost from '../InstagramPost'
import { ExternalLink } from '../ExternalLink'
import { Blockquote } from '../Blockquote'

interface MdxProps {
code: string
}

const components = { Image: (props: ImageProps) => <Image {...props} />, InstagramPost, a: ExternalLink }
const components = { Image: (props: ImageProps) => <Image {...props} />, InstagramPost, a: ExternalLink, blockquote: Blockquote }

export function Mdx({ code }: MdxProps) {
const Component = useMDXComponent(code)
Expand Down
5 changes: 4 additions & 1 deletion apps/blog/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ module.exports = {
},
content: {
externalLink: 'url("../../assets/ext-link-icon.svg")',
quote: 'url("../../assets/quote.svg")',
},
typography: {
DEFAULT: {
css: {
blockquote: { quotes: 'auto' },
blockquote: {
Themezv marked this conversation as resolved.
Show resolved Hide resolved
quotes: 'auto',
},
},
},
},
Expand Down
Loading