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

modified: components/Activity.tsx #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
28 changes: 14 additions & 14 deletions components/Activity.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ReactNode } from 'react'

interface titleProps {
title: string
children: ReactNode
}
export default function Activity({ title, children }: titleProps) {
return (
<li className="space-y-1">
<h4 className="relative sub-thread-mark">{title}</h4>
<p>{children}</p>
</li>
)
}
import { ReactNode } from 'react'
interface titleProps {
title: string
children: ReactNode
}
export default function Activity({ title, children }: titleProps) {
return (
<li className="space-y-1">
<h4 className="relative sub-thread-mark">{title}</h4>
<p>{children}</p>
</li>
)
}
140 changes: 70 additions & 70 deletions components/BlogPost.tsx
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
import React from 'react'
import Image from 'next/image'
import usePostViews from '@/lib/usePostViews'
import Loader from './Loader'
import { formatDate } from '@/lib/date'

interface postLayoutProps {
readTime: string
publishedAt: string
title: string
image: string
slug: string
}

export default function BlogPost({
readTime,
publishedAt,
title,
image,
slug
}: postLayoutProps) {
const { views, error } = usePostViews(slug)

return (
<>
<h1>{title}</h1>
<div className="my-6 sm:items-center sm:justify-between sm:flex">
<div className="flex items-center gap-3">
<Image
src="/images/self.jpg"
height={28}
width={28}
objectFit="cover"
className="rounded-full"
alt="blog author avatar"
priority
/>
<div className="flex separator">
<p className="mr-2 text-gray-900 meta-size dark:text-gray-100">
Swarup Kumar Das
</p>
<p className="pl-2 text-gray-900 meta-size dark:text-gray-100">
{formatDate(publishedAt)}
</p>
</div>
</div>
<div className="flex mt-4 text-gray-500 separator sm:mt-0">
<p className="mr-2 meta-size">{readTime}</p>
{error ? (
<Loader />
) : views ? (
<p className="pl-2 meta-size">{views} views</p>
) : (
<Loader />
)}
</div>
</div>
<Image
src={`/images${image}`}
layout="responsive"
height={630}
width={1200}
className="rounded-sm"
objectFit="cover"
alt="blog image"
priority
/>
</>
)
}
import React from 'react'
import Image from 'next/image'
import usePostViews from '@/lib/usePostViews'
import Loader from './Loader'
import { formatDate } from '@/lib/date'
interface postLayoutProps {
readTime: string
publishedAt: string
title: string
image: string
slug: string
}
export default function BlogPost({
readTime,
publishedAt,
title,
image,
slug
}: postLayoutProps) {
const { views, error } = usePostViews(slug)
return (
<>
<h1>{title}</h1>
<div className="my-6 sm:items-center sm:justify-between sm:flex">
<div className="flex items-center gap-3">
<Image
src="/images/self.jpg"
height={28}
width={28}
objectFit="cover"
className="rounded-full"
alt="blog author avatar"
priority
/>
<div className="flex separator">
<p className="mr-2 text-gray-900 meta-size dark:text-gray-100">
Swarup Kumar Das
</p>
<p className="pl-2 text-gray-900 meta-size dark:text-gray-100">
{formatDate(publishedAt)}
</p>
</div>
</div>
<div className="flex mt-4 text-gray-500 separator sm:mt-0">
<p className="mr-2 meta-size">{readTime}</p>
{error ? (
<Loader />
) : views ? (
<p className="pl-2 meta-size">{views} views</p>
) : (
<Loader />
)}
</div>
</div>
<Image
src={`/images${image}`}
layout="responsive"
height={630}
width={1200}
className="rounded-sm"
objectFit="cover"
alt="blog image"
priority
/>
</>
)
}
54 changes: 27 additions & 27 deletions components/BlogPostPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import Link from 'next/link'
import { formatDate } from '@/lib/date'

interface PostPreviewProps {
slug: string
title: string
summary: string
publishedAt: string
}
export default function BlogPostPreview({
slug,
title,
summary,
publishedAt
}: PostPreviewProps) {
return (
<Link href={`/blog/${slug}`} passHref>
<a className="block">
<div className="p-3 space-y-2 transition-all border border-gray-300 rounded-md dark:border-gray-800 dark:hover:border-gray-700 hover:border-gray-400">
<h4>{title}</h4>
<p>{formatDate(publishedAt)}</p>
<p>{summary}</p>
</div>
</a>
</Link>
)
}
import Link from 'next/link'
import { formatDate } from '@/lib/date'
interface PostPreviewProps {
slug: string
title: string
summary: string
publishedAt: string
}
export default function BlogPostPreview({
slug,
title,
summary,
publishedAt
}: PostPreviewProps) {
return (
<Link href={`/blog/${slug}`} passHref>
<a className="block">
<div className="p-3 space-y-2 transition-all border border-gray-300 rounded-md dark:border-gray-800 dark:hover:border-gray-700 hover:border-gray-400">
<h4>{title}</h4>
<p>{formatDate(publishedAt)}</p>
<p>{summary}</p>
</div>
</a>
</Link>
)
}
34 changes: 17 additions & 17 deletions components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ReactChild } from 'react'

interface Props {
href: string
children: ReactChild
}

export default function Button({ href, children }: Props) {
return (
<a
href={href}
className="grid w-full px-10 py-2 text-sm text-white transition-all bg-black border rounded-md place-items-center sm:text-base md:text-lg hover:border-gray-800 hover:bg-transparent hover:text-black dark:hover:border-gray-100 dark:text-black dark:bg-white dark:hover:bg-transparent dark:hover:text-white"
>
{children}
</a>
)
}
import { ReactChild } from 'react'
interface Props {
href: string
children: ReactChild
}
export default function Button({ href, children }: Props) {
return (
<a
href={href}
className="grid w-full px-10 py-2 text-sm text-white transition-all bg-black border rounded-md place-items-center sm:text-base md:text-lg hover:border-gray-800 hover:bg-transparent hover:text-black dark:hover:border-gray-100 dark:text-black dark:bg-white dark:hover:bg-transparent dark:hover:text-white"
>
{children}
</a>
)
}
60 changes: 30 additions & 30 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
export default function Footer() {
return (
<footer className="max-w-3xl px-6 mx-auto my-16">
<hr className="border-gray-400 dark:border-gray-600" />
<div className="flex flex-col items-center md:flex-row md:justify-between">
<p className="my-6">Built with Next.js, MDX, Tailwind and Vercel</p>
<div className="flex justify-between w-64 mb-2 text-gray-500 sm:text-lg md:mb-0 dark:text-gray-400">
<a
href="https://github.com/swarup4741"
className="hover:text-black dark:hover:text-gray-50"
>
Github
</a>
<a
href="https://dribbble.com/swarupdas"
className="hover:text-black dark:hover:text-gray-50"
>
Dribbble
</a>
<a
href="https://twitter.com/swarup4741"
className="hover:text-black dark:hover:text-gray-50"
>
Twitter
</a>
</div>
</div>
</footer>
)
}
export default function Footer() {
return (
<footer className="max-w-3xl px-6 mx-auto my-16">
<hr className="border-gray-400 dark:border-gray-600" />
<div className="flex flex-col items-center md:flex-row md:justify-between">
<p className="my-6">Built with Next.js, MDX, Tailwind and Vercel</p>
<div className="flex justify-between w-64 mb-2 text-gray-500 sm:text-lg md:mb-0 dark:text-gray-400">
<a
href="https://github.com/swarup4741"
className="hover:text-black dark:hover:text-gray-50"
>
Github
</a>
<a
href="https://dribbble.com/swarupdas"
className="hover:text-black dark:hover:text-gray-50"
>
Dribbble
</a>
<a
href="https://twitter.com/swarup4741"
className="hover:text-black dark:hover:text-gray-50"
>
Twitter
</a>
</div>
</div>
</footer>
)
}
Loading