diff --git a/src/app/actions/blog.action.ts b/src/app/actions/blog.action.ts index 675d1f2..0d1052f 100644 --- a/src/app/actions/blog.action.ts +++ b/src/app/actions/blog.action.ts @@ -9,9 +9,6 @@ import rehypeHighlight from "rehype-highlight/lib"; import rehypeSlug from "rehype-slug"; import { SuccessResponse } from "@/lib/success"; -export const blogsGet = async () => { - return { hi: "there" }; -}; const getBlogs = withServerActionAsyncCatcher(async () => { const response = await axios.get( `https://api.github.com/repos/${process.env.GITHUB_USERNAME}/${process.env.GITHUB_REPO_NAME}/git/trees/main?recursive=1`, diff --git a/src/app/actions/tag.action.ts b/src/app/actions/tag.action.ts index ecb34d8..7e9af1c 100644 --- a/src/app/actions/tag.action.ts +++ b/src/app/actions/tag.action.ts @@ -4,6 +4,9 @@ import { getBlogs } from "./blog.action"; import { SuccessResponse } from "@/lib/success"; import { ErrorHandler } from "@/lib/error"; +/** + * v3 will have tags and tag filtering + */ export const getTags = withServerActionAsyncCatcher(async () => { const response = await getBlogs(); const blogs = response.additional.meta; diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index 923d5fc..3b60312 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -1,7 +1,7 @@ import { Blogs } from "@/components/Blogs"; import { Heading } from "@/components/Heading"; import { BlurDiv } from "@/components/ui/Blur"; -import { DELAY } from "@/constants/misc"; +import { DELAY } from "@/lib/constants"; const BlogPage = () => { return ( diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f642169..983ee3f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -29,7 +29,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + diff --git a/src/app/page.tsx b/src/app/page.tsx index 4873712..d41ac94 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -6,7 +6,7 @@ import { Blogs } from "@/components/Blogs"; import { Footer } from "@/components/Footer"; import { Heading } from "@/components/Heading"; import { BlurDiv } from "@/components/ui/Blur"; -import { DELAY } from "@/constants/misc"; +import { DELAY } from "@/lib/constants"; export default function Home() { return (
diff --git a/src/components/About.tsx b/src/components/About.tsx index 666fd2c..fa329ba 100644 --- a/src/components/About.tsx +++ b/src/components/About.tsx @@ -1,5 +1,5 @@ import { BlurDiv } from "./ui/Blur"; -import { DELAY } from "@/constants/misc"; +import { DELAY } from "@/lib/constants"; import Markdown from "react-markdown"; import { DATA } from "@/data/info"; import { GithubGraph } from "./ui/github"; diff --git a/src/components/Blogs.tsx b/src/components/Blogs.tsx index 4efd312..63787e6 100644 --- a/src/components/Blogs.tsx +++ b/src/components/Blogs.tsx @@ -6,7 +6,7 @@ import { Blog, BlogSkeleton } from "./cards/Blog-card"; import { NoPost } from "./cards/Blog-card"; import { Input } from "./ui/Input"; import { BlurDiv } from "./ui/Blur"; -import { DELAY } from "@/constants/misc"; +import { DELAY } from "@/lib/constants"; type blogProps = { showMore?: boolean; diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index a5f772e..173d96c 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -14,12 +14,7 @@ export const Footer = () => {

Want to chat? Just shoot me a dm{" "} - - on twitter - {" "} + on twitter

VINEET.TECH diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 2b7309a..6a5adcb 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -5,7 +5,7 @@ import React from "react"; export default function Navbar() { return ( diff --git a/src/components/Share-twitter.tsx b/src/components/Share-twitter.tsx index 8b0eac9..f1df3b2 100644 --- a/src/components/Share-twitter.tsx +++ b/src/components/Share-twitter.tsx @@ -23,10 +23,10 @@ export default function ShareOnTwitter({

); diff --git a/src/components/cards/Blog-card.tsx b/src/components/cards/Blog-card.tsx index 4a40ec6..2882673 100644 --- a/src/components/cards/Blog-card.tsx +++ b/src/components/cards/Blog-card.tsx @@ -8,36 +8,39 @@ import { Card, CardContent } from "@/components/ui/card"; export const Blog = (post: Meta) => { return ( - -
-

- { + window.location.href = `/blog/${post.id}`; + }} + className="hover:scale-[1.04] transition-all rounded-xl cursor-pointer bg-gray-400/20 dark:bg-stone-900/20 border-muted border-[1px] border-solid px-6 py-7 mb-6 relative z-40" + > +

+ + {post.title} + +

+

+ {post.description} +

+

+ {getFormattedDate(post.date)} ยท Vineet Agarwal +

+
+ {post.tags.map((tag: any) => ( + - {post.title} - -

-

- {post.description} -

-

- {getFormattedDate(post.date)} ยท Vineet Agarwal -

-
- {post.tags.map((tag: any) => ( - - {tag} - - ))} -
+ {tag} + + ))}
- + ); }; diff --git a/src/components/introduction.tsx b/src/components/introduction.tsx index 54100c3..d2e0590 100644 --- a/src/components/introduction.tsx +++ b/src/components/introduction.tsx @@ -2,7 +2,7 @@ import React from "react"; import { BlurDiv } from "./ui/Blur"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/Avatar"; import { DATA } from "@/data/info"; -import { DELAY } from "@/constants/misc"; +import { DELAY } from "@/lib/constants"; type IntroductionProps = { name: string; desc: string; @@ -26,7 +26,7 @@ export const Introduction = ({ name, desc }: IntroductionProps) => { - + CN diff --git a/src/components/ui/dock.tsx b/src/components/ui/dock.tsx index ee63ac2..0728f29 100644 --- a/src/components/ui/dock.tsx +++ b/src/components/ui/dock.tsx @@ -9,7 +9,7 @@ import Link from "next/link"; export interface DockProps { mobileClassName?: string; DesktopClassName?: string; - navbar: dataProps; + navbar: dataProps["navbar"]; } const Dock: React.FC = ({ @@ -25,143 +25,133 @@ const Dock: React.FC = ({ ); }; -const DockMobile = React.forwardRef( - ({ mobileClassName, navbar }) => { - const [open, setOpen] = useState(false); - return ( -
- - {open && ( - - {navbar.navbar.socials.map((social, idx) => ( - - - - ))} - - )} - -
setOpen(!open)} - className={cn( - "z-50 flex gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4", - mobileClassName - )} - > - - ๐ŸŽ’ - -
-
- ); - } -); -DockMobile.displayName = "DockMobile"; - -const DockDesktop = React.forwardRef( - ({ DesktopClassName, navbar }) => { - const [isBlurred, setIsBlurred] = useState(false); - const [isHovered, setIsHovered] = useState(false); - - const iconWidth = 40; - const totalIcons = navbar.navbar.socials.length * iconWidth + 35; - const handleMouseEnter = () => { - setIsBlurred(true); - setIsHovered(true); - setTimeout(() => { - setIsBlurred(false); - }, 300); - }; - const handleMouseLeave = () => { - setIsBlurred(true); - setIsHovered(false); - setTimeout(() => { - setIsBlurred(false); - }, 100); - }; - return ( -
- - - ๐ŸŽ’ - {isHovered && ( +const DockMobile = ({ mobileClassName, navbar }: DockProps) => { + const [open, setOpen] = useState(false); + return ( +
+ + {open && ( + + {navbar.socials.map((social, idx) => ( - {navbar.navbar.socials.map((social, idx) => ( - - ))} + - )} + ))} - + )} + +
setOpen(!open)} + className={cn( + "z-50 flex gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4", + mobileClassName + )} + > + + ๐ŸŽ’ +
- ); - } -); +
+ ); +}; +DockMobile.displayName = "DockMobile"; + +const DockDesktop = ({ DesktopClassName, navbar }: DockProps) => { + const [isBlurred, setIsBlurred] = useState(false); + const [isHovered, setIsHovered] = useState(false); + + const iconWidth = 40; + const totalIcons = navbar.socials.length * iconWidth + 35; + const handleMouseEnter = () => { + setIsBlurred(true); + setIsHovered(true); + setTimeout(() => { + setIsBlurred(false); + }, 300); + }; + const handleMouseLeave = () => { + setIsBlurred(true); + setIsHovered(false); + setTimeout(() => { + setIsBlurred(false); + }, 100); + }; + return ( +
+ + + ๐ŸŽ’ + {isHovered && ( + + {navbar.socials.map((social, idx) => ( + + ))} + + )} + + +
+ ); +}; type DockIconProps = { link: string; icon: React.ReactNode; className?: string; }; -const DockIcon = React.forwardRef( - ({ link, icon, className }) => { - return ( -
- {icon} -
- ); - } -); - -DockIcon.displayName = "DockIcon"; -Dock.displayName = "Dock"; -DockDesktop.displayName = "DockDesktop"; +const DockIcon = ({ link, icon, className }: DockIconProps) => { + return ( +
+ {icon} +
+ ); +}; export { Dock }; diff --git a/src/constants/navbar-link.tsx b/src/constants/navbar-link.tsx deleted file mode 100644 index e089291..0000000 --- a/src/constants/navbar-link.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Github } from "lucide-react"; - -export const NavbarLinks: { - name: string; - url: string; - icon?: JSX.Element; -}[] = [ - { - name: "Blog", - url: "/blog", - }, - { - name: "Tags", - url: "/tags", - }, - { - name: "Github", - icon: , - url: "https://github.com/VineeTagarwaL-code/blogs.vineet.tech", - }, -]; diff --git a/src/data/info.tsx b/src/data/info.tsx index 6b4fba4..4777c4e 100644 --- a/src/data/info.tsx +++ b/src/data/info.tsx @@ -44,6 +44,7 @@ export const DATA: dataProps = { ), }, + // its not ideal to have toggle here but for the sake of example and functionality of multiple themes { name: "toggle", link: "#", diff --git a/src/constants/misc.tsx b/src/lib/constants.ts similarity index 100% rename from src/constants/misc.tsx rename to src/lib/constants.ts