diff --git a/src/components/intro_card/index.module.scss b/src/components/intro_card/index.module.scss new file mode 100644 index 00000000..645639dc --- /dev/null +++ b/src/components/intro_card/index.module.scss @@ -0,0 +1,77 @@ +@import "src/styles/sass.scss"; + +.wrapper { + background: #fff; + border-radius: 24px; + box-shadow: + 0 10px 32px -4px rgba(96, 60, 238, 0.1), + 0 6px 14px -6px rgba(96, 60, 238, 0.28); + box-sizing: border-box; + display: flex; + flex-direction: column; + height: 100%; + max-width: calc(100vw - 40px); + overflow: hidden; + position: relative; +} + +.imageWrapper { + height: 200px; + position: relative; + width: 100%; +} + +.contentWrapper { + align-items: flex-start; + box-sizing: border-box; + display: flex; + flex: 1; + flex-flow: column wrap; + justify-content: space-between; + padding: 24px; + row-gap: 24px; +} + +.title { + color: #202a43; + font-size: 20px; + font-weight: 590; + margin-bottom: 12px; +} + +.listItem { + color: #202a43; + display: flex; + font-size: 16px; + font-weight: 400; + line-height: 22px; + padding-left: 10px; + padding-right: 10px; + + &::before { + background-color: #202a43; + border-radius: 4px; + content: " "; + display: inline-block; + flex: 0 0 auto; + height: 4px; + margin-right: 10px; + margin-top: 10px; + vertical-align: middle; + width: 4px; + } +} + +.desc { + font-size: 16px; + line-height: 22px; +} + +.image { + object-fit: cover; +} + +.ctaButton { + align-self: flex-start; + font-family: "590"; +} diff --git a/src/components/intro_card/index.tsx b/src/components/intro_card/index.tsx index 29d08212..e447cb37 100644 --- a/src/components/intro_card/index.tsx +++ b/src/components/intro_card/index.tsx @@ -3,6 +3,7 @@ import Box from "@mui/material/Box"; import Image from "next/image"; import CtaButton from "../cta-button"; +import * as styles from "./index.module.scss"; type Props = { title?: string; @@ -25,99 +26,30 @@ const IntroCard = (props: Props) => { } = props; return ( - - + + {imageHref && ( {title )} - + - - {title} - + {title} {typeof desc && ( - - {desc} - + {desc} )}
    {list?.map((item, index) => ( {item} @@ -125,12 +57,9 @@ const IntroCard = (props: Props) => {
{btnName} diff --git a/src/pages/author/[author]/index.tsx b/src/pages/author/[author]/index.tsx index f775194f..228e81e1 100644 --- a/src/pages/author/[author]/index.tsx +++ b/src/pages/author/[author]/index.tsx @@ -14,6 +14,7 @@ export async function getServerSideProps(context: { query: any }) { let formattedTags: Tag[] = []; let meta = {}; let error = false; + try { const { query } = context; const fetchQuery: any = {}; diff --git a/src/screens/author/components/author_posts/index.tsx b/src/screens/author/components/author_posts/index.tsx index 850a9b5a..131ba712 100644 --- a/src/screens/author/components/author_posts/index.tsx +++ b/src/screens/author/components/author_posts/index.tsx @@ -1,15 +1,20 @@ import { Box, Pagination } from "@mui/material"; -import { pathOr } from "ramda"; import Post from "@src/screens/blog/components/blog_posts/components/post"; +import type { AuthorMeta } from "../../types"; import { useBlogPostsHook } from "./hooks"; import * as styles from "./index.module.scss"; -import type { IProps } from "./interface"; + +interface IProps { + blogs: any[]; + main: any; + meta: AuthorMeta; +} const AuthorPosts = ({ main, blogs, meta }: IProps) => { - const currentPage = pathOr(0, ["pagination", "page"], meta); - const totalPages = pathOr(0, ["pagination", "pages"], meta); + const currentPage = meta.pagination?.page || 0; + const totalPages = meta.pagination?.pages || 0; const { handleAuthorPageChange } = useBlogPostsHook(); diff --git a/src/screens/author/components/author_posts/interface.ts b/src/screens/author/components/author_posts/interface.ts deleted file mode 100644 index f48a8080..00000000 --- a/src/screens/author/components/author_posts/interface.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface IProps { - main: any; - blogs: any[]; - meta: any; -} diff --git a/src/screens/author/index.tsx b/src/screens/author/index.tsx index 56a18a55..b87d7177 100644 --- a/src/screens/author/index.tsx +++ b/src/screens/author/index.tsx @@ -1,13 +1,22 @@ import { Box, Typography } from "@mui/material"; import useTranslation from "next-translate/useTranslation"; +import Head from "next/head"; import Layout from "@src/components/layout"; import AuthorPosts from "./components/author_posts"; import { useBlogHook } from "./hooks"; import * as styles from "./index.module.scss"; +import type { AuthorMeta } from "./types"; -const AuthorTitlePosts = (props: any) => { +type Props = { + author: any; + meta: AuthorMeta; + post: any; + tags: any; +}; + +const AuthorTitlePosts = (props: Props) => { const { t } = useTranslation("blog"); const { post, tags, author, meta } = props; const { featureImage, excerpt, error } = post; @@ -25,6 +34,35 @@ const AuthorTitlePosts = (props: any) => { title={post.title} type="article" > + +