From 010eedff0e3aa69ae59f137e2bc02315afcdc02e Mon Sep 17 00:00:00 2001 From: Lwin Moe Paing Date: Thu, 19 Oct 2023 21:09:41 +0630 Subject: [PATCH] :fire: build(profile): add lwinmoepaing profile --- .gitignore | 7 ++- .../profile/{sample.mdx => lwinmoepaing.mdx} | 25 ++++++++--- contentlayer.config.ts | 5 +++ src/app/profile/[slug]/page.tsx | 9 ++++ src/app/profile/layout.tsx | 8 +++- src/components/Common/TitleText/TitleText.tsx | 5 ++- .../ProfileCardList/ProfileCardList.tsx | 43 +++++++++++++++++-- 7 files changed, 90 insertions(+), 12 deletions(-) rename content/profile/{sample.mdx => lwinmoepaing.mdx} (72%) diff --git a/.gitignore b/.gitignore index bba5371..10ae947 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,9 @@ yarn-error.log* next-env.d.ts # contentlayer -.contentlayer \ No newline at end of file +.contentlayer + +# Dont need package locks +yarn.lock +package-lock.json +pnpm-lock.yaml \ No newline at end of file diff --git a/content/profile/sample.mdx b/content/profile/lwinmoepaing.mdx similarity index 72% rename from content/profile/sample.mdx rename to content/profile/lwinmoepaing.mdx index e07d6c2..c96bff6 100644 --- a/content/profile/sample.mdx +++ b/content/profile/lwinmoepaing.mdx @@ -1,16 +1,29 @@ --- -name: Sample -description: I'm software developer +name: Lwin Moe Paing +description: I'm senior frontend engineers and looking for help with **Javascript Language to build Many Free Softwares to help people who can't afford to pay !! +image: "https://avatars.githubusercontent.com/u/49163775?v=4" +tags: + - Fullstack + - Frontend + - JavaScript + - ReactJS + - SolidJS --- -

+
+ +
+ +

Hi, I'm Lwin Moe Paing

+
+ - šŸ¤ Iā€™m looking for help with **Javascript Language to build Many Free Softwares to help people who can't afford to pay !!** - šŸ’¬ Ask me about **React, React Native & Nodejs.** - šŸ“« How to reach me **lwinmoepaing.dev@gmail.com (or) [facebook](https://www.facebook.com/lwin.im/)** @@ -49,4 +62,6 @@ const Lwin = { architecture: ["Microservices", "Event-Driven", "Design System Pattern"], challenge: "Nothing in life is permanent. so i'm trying to be always humble", }; -``` \ No newline at end of file +``` + +
diff --git a/contentlayer.config.ts b/contentlayer.config.ts index 0191211..4761572 100644 --- a/contentlayer.config.ts +++ b/contentlayer.config.ts @@ -38,6 +38,11 @@ export const Blog = defineDocumentType(() => ({ const profileFields: FieldDefs = { name: { type: "string", required: true }, description: { type: "string" }, + tags: { + type: "list", + of: { type: "string" }, + }, + image: { type: "string", required: false }, }; export const Profile = defineDocumentType(() => ({ diff --git a/src/app/profile/[slug]/page.tsx b/src/app/profile/[slug]/page.tsx index 4add1c7..ca2a9ac 100644 --- a/src/app/profile/[slug]/page.tsx +++ b/src/app/profile/[slug]/page.tsx @@ -24,6 +24,15 @@ export async function generateMetadata({ return { title: `Profile | ${profile.name}`, description: `Profile | ${profile.description}`, + openGraph: { + title: `Profile | ${profile.name}`, + description: `Profile | ${profile.description}`, + image: profile.image + ? profile.image + : "https://mmswe.com/images/landing/galaxy.jpg", + siteName: `https://mmswe.com/profile/${slug}`, + type: "content" + }, }; } diff --git a/src/app/profile/layout.tsx b/src/app/profile/layout.tsx index c1ed12f..de1f9c7 100644 --- a/src/app/profile/layout.tsx +++ b/src/app/profile/layout.tsx @@ -1,10 +1,16 @@ import Container from "@/components/Common/Container/Container"; +import { titleFont } from "@/fonts/fonts"; import styles from "@/styles/styles"; +import { cn } from "@/utils"; export default function ProfileLayout({ children, }: { children: React.ReactNode; }) { - return {children}; + return ( + + {children} + + ); } diff --git a/src/components/Common/TitleText/TitleText.tsx b/src/components/Common/TitleText/TitleText.tsx index 4aa83c1..d0da200 100644 --- a/src/components/Common/TitleText/TitleText.tsx +++ b/src/components/Common/TitleText/TitleText.tsx @@ -1,11 +1,12 @@ import { titleFont, titleFontBold } from "@/fonts/fonts"; import { cn } from "@/utils"; -import { PropsWithChildren } from "react"; +import { MouseEvent, PropsWithChildren } from "react"; type TTitleText = PropsWithChildren<{ className?: string; tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "div" | "p"; isBold?: boolean; + onClick?: (event: MouseEvent) => void; }>; const TitleText: React.FC = ({ @@ -13,6 +14,7 @@ const TitleText: React.FC = ({ children, tag = "h1", isBold = false, + onClick, }) => { const Component = tag; return ( @@ -23,6 +25,7 @@ const TitleText: React.FC = ({ isBold && titleFontBold.className, className )} + onClick={onClick} > {children} diff --git a/src/components/Profile/ProfileCardList/ProfileCardList.tsx b/src/components/Profile/ProfileCardList/ProfileCardList.tsx index edb266a..af92179 100644 --- a/src/components/Profile/ProfileCardList/ProfileCardList.tsx +++ b/src/components/Profile/ProfileCardList/ProfileCardList.tsx @@ -4,9 +4,14 @@ import TitleText from "@/components/Common/TitleText/TitleText"; import SquareBox from "@/components/Ui/SquareBox/SquareBox"; import { cn, generateColor } from "@/utils"; import { Profile } from "contentlayer/generated"; +import Image from "next/image"; import Link from "next/link"; -const ProfileCardList = ({ profiles }: { profiles: Profile[] }) => { +type TPropsProfileCardList = { + profiles: Profile[]; +}; + +const ProfileCardList = ({ profiles }: TPropsProfileCardList) => { return ( <> {profiles.map((profile) => { @@ -24,17 +29,47 @@ const ProfileCardList = ({ profiles }: { profiles: Profile[] }) => {
- {profile.name?.trim()?.[0]} + {!!profile.image ? ( + {profile.name} + ) : ( + profile.name?.trim()?.[0] + )}
{profile.name}
- +
+ {profile.tags?.slice(0, 8)?.map((tag) => ( + { + e.preventDefault(); + console.log(tag); + }} + > + {tag} + + ))} +
+ {profile.description}