Skip to content

Commit

Permalink
Remove Static Views (#669)
Browse files Browse the repository at this point in the history
* Add course data for Core Fundamentals and Command Line Interface; update BlogCard component to remove views display

* Remove instructor and course data for Core Fundamentals and Command Line Interface

* Remove views display from BlogArea components across multiple layouts

* Remove 'views' field from blog data retrieval across multiple components
  • Loading branch information
jeromehardaway authored Dec 21, 2024
1 parent 1bcbc5f commit 3bc1347
Show file tree
Hide file tree
Showing 31 changed files with 39 additions and 123 deletions.
10 changes: 3 additions & 7 deletions src/components/blog-card/blog-01.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import clsx from "clsx";
import Anchor from "@ui/anchor";
import { IBlog } from "@utils/types";

type TProps = Pick<IBlog, "title" | "path" | "category" | "postedAt" | "image" | "views"> & {
type TProps = Pick<IBlog, "title" | "path" | "category" | "postedAt" | "image"> & {
className?: string;
};

const BlogCard = forwardRef<HTMLDivElement, TProps>(
({ title, path, category, postedAt, image, views, className }, ref) => (
({ title, path, category, postedAt, image, className }, ref) => (
<div
className={clsx(
"blog-card tw-relative tw-overflow-hidden tw-transition-all tw-rounded tw-bg-white tw-shadow-xl tw-shadow-black/5 tw-group",
Expand Down Expand Up @@ -42,15 +42,11 @@ const BlogCard = forwardRef<HTMLDivElement, TProps>(
<h3 className="tw-text-xl tw-mb-0 tw-leading-normal">
<Anchor path={path}>{title}</Anchor>
</h3>
<ul className="tw-flex tw-gap-7">
<ul>
<li className="tw-text-md tw-mt-3.8">
<i className="far fa-calendar tw-mr-2.5" />
{postedAt}
</li>
<li className="tw-text-md tw-mt-3.8">
<i className="far fa-eye tw-mr-2.5" />
{views} views
</li>
</ul>
</div>
</div>
Expand Down
10 changes: 3 additions & 7 deletions src/components/blog-card/blog-02.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import clsx from "clsx";
import Anchor from "@ui/anchor";
import { IBlog } from "@utils/types";

type TProps = Pick<IBlog, "title" | "path" | "category" | "postedAt" | "image" | "views"> & {
type TProps = Pick<IBlog, "title" | "path" | "category" | "postedAt" | "image"> & {
className?: string;
};

const BlogCard = forwardRef<HTMLDivElement, TProps>(
({ title, path, category, postedAt, image, views, className }, ref) => (
({ title, path, category, postedAt, image, className }, ref) => (
<div
className={clsx(
"blog-card tw-grid tw-relative tw-overflow-hidden tw-transition-all tw-rounded tw-bg-white tw-shadow-xl tw-shadow-black/5 tw-group",
Expand Down Expand Up @@ -46,15 +46,11 @@ const BlogCard = forwardRef<HTMLDivElement, TProps>(
{title}
</Anchor>
</h3>
<ul className="tw-flex tw-gap-7">
<ul>
<li className="tw-text-md tw-mt-3.8 tw-text-white tw-mb-0">
<i className="far fa-calendar tw-mr-2.5" />
{postedAt}
</li>
<li className="tw-text-md tw-mt-3.8 tw-text-white">
<i className="far fa-eye tw-mr-2.5" />
{views} views
</li>
</ul>
</div>
</div>
Expand Down
10 changes: 3 additions & 7 deletions src/components/blog-card/blog-03.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import clsx from "clsx";
import Anchor from "@ui/anchor";
import { IBlog } from "@utils/types";

type TProps = Pick<IBlog, "image" | "path" | "title" | "category" | "postedAt" | "views"> & {
type TProps = Pick<IBlog, "image" | "path" | "title" | "category" | "postedAt"> & {
className?: string;
};

const BlogCard = forwardRef<HTMLDivElement, TProps>(
({ className, image, path, title, category, postedAt, views }, ref) => {
({ className, image, path, title, category, postedAt }, ref) => {
return (
<div className={clsx("blog-card tw-group", className)} ref={ref}>
<div className="tw-relative tw-overflow-hidden tw-rounded tw-h-[250px]">
Expand Down Expand Up @@ -40,15 +40,11 @@ const BlogCard = forwardRef<HTMLDivElement, TProps>(
<Anchor path={path}>{title}</Anchor>
</h3>

<ul className="tw-flex tw-gap-7 tw-text-gray-300 tw-text-md">
<ul className="tw-text-gray-300 tw-text-md">
<li className="tw-mt-3.8 tw-mb-0">
<i className="far fa-calendar tw-mr-2.5" />
{postedAt}
</li>
<li className="tw-mt-3.8">
<i className="far fa-eye tw-mr-2.5" />
{views} views
</li>
</ul>
</div>
</div>
Expand Down
10 changes: 3 additions & 7 deletions src/components/blog-card/blog-04.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import clsx from "clsx";
import Anchor from "@ui/anchor";
import { BlogMetaType, IBlog } from "@utils/types";

type TProps = Pick<IBlog, "image" | "path" | "title" | "postedAt" | "views"> & {
type TProps = Pick<IBlog, "image" | "path" | "title" | "postedAt"> & {
className?: string;
category?: BlogMetaType;
};

const BlogCard = forwardRef<HTMLDivElement, TProps>(
({ className, image, path, title, postedAt, views, category }, ref) => {
({ className, image, path, title, postedAt, category }, ref) => {
return (
<div
className={clsx(
Expand Down Expand Up @@ -49,15 +49,11 @@ const BlogCard = forwardRef<HTMLDivElement, TProps>(
<Anchor path={path}>{title}</Anchor>
</h3>

<ul className="tw-flex tw-gap-7 tw-text-gray-300 tw-text-md">
<ul className="tw-flex tw-text-gray-300 tw-text-md">
<li className="tw-mt-3.8 tw-mb-0">
<i className="far fa-calendar tw-mr-2.5" />
{postedAt}
</li>
<li className="tw-mt-3.8">
<i className="far fa-eye tw-mr-2.5" />
{views} views
</li>
</ul>
</div>
</div>
Expand Down
9 changes: 2 additions & 7 deletions src/components/blog-card/blog-05.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import SocialShare from "@components/social-share/layout-03";

type TProps = Pick<
IBlog,
"image" | "path" | "title" | "postedAt" | "views" | "category" | "author" | "excerpt"
"image" | "path" | "title" | "postedAt" | "category" | "author" | "excerpt"
> & {
className?: string;
};

const BlogCard = forwardRef<HTMLDivElement, TProps>(
({ className, image, path, title, postedAt, views, category, author, excerpt }, ref) => {
({ className, image, path, title, postedAt, category, author, excerpt }, ref) => {
return (
<div
className={clsx(
Expand Down Expand Up @@ -60,11 +60,6 @@ const BlogCard = forwardRef<HTMLDivElement, TProps>(
text={postedAt}
icon="far fa-calendar"
/>
<BlogMetaItem
className="tw-pr-5 md:tw-pr-8"
text={`${views} views`}
icon="far fa-eye"
/>
</div>
<p className="tw-mt-4" dangerouslySetInnerHTML={{ __html: excerpt }} />
<div className="tw-flex tw-items-center tw-justify-between tw-mt-7.5">
Expand Down
12 changes: 2 additions & 10 deletions src/components/blog-card/blog-06.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ import { IBlog } from "@utils/types";
import Button from "@components/ui/button";
import SocialShare from "@components/social-share/layout-03";

type TProps = Pick<
IBlog,
"image" | "path" | "title" | "postedAt" | "views" | "author" | "excerpt"
> & {
type TProps = Pick<IBlog, "image" | "path" | "title" | "postedAt" | "author" | "excerpt"> & {
className?: string;
};

const BlogCard = forwardRef<HTMLDivElement, TProps>(
({ className, image, path, title, postedAt, views, author, excerpt }, ref) => {
({ className, image, path, title, postedAt, author, excerpt }, ref) => {
return (
<div
className={clsx(
Expand Down Expand Up @@ -54,11 +51,6 @@ const BlogCard = forwardRef<HTMLDivElement, TProps>(
text={postedAt}
icon="far fa-calendar"
/>
<BlogMetaItem
className="tw-pr-5 md:tw-pr-8"
text={`${views} views`}
icon="far fa-eye"
/>
</div>
<p className="tw-mt-4" dangerouslySetInnerHTML={{ __html: excerpt }} />
<div className="tw-flex tw-items-center tw-justify-between tw-mt-7.5 md:tw-mt-9">
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog-full/layout-01/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const BlogArea = ({ data: { blogs, pagiData } }: TProps) => {
path={blog.path}
category={blog.category}
postedAt={blog.postedAt}
views={blog.views}
initial="offscreen"
whileInView="onscreen"
viewport={{ once: true, amount: 0.2 }}
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog-full/layout-02/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const BlogArea = ({ data: { blogs, recentPosts, tags, pagiData } }: TProps) => {
path={blog.path}
image={blog.image}
postedAt={blog.postedAt}
views={blog.views}
initial="offscreen"
whileInView="onscreen"
viewport={{ once: true, amount: 0.2 }}
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog-full/layout-03/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const BlogArea = ({ data: { blogs, recentPosts, tags, pagiData } }: TProps) => {
path={blog.path}
image={blog.image}
postedAt={blog.postedAt}
views={blog.views}
category={blog.category}
author={blog.author}
excerpt={blog.excerpt}
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog-full/layout-04/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const BlogArea = ({ data: { blogs, pagiData } }: TProps) => {
path={blog.path}
image={blog.image}
postedAt={blog.postedAt}
views={blog.views}
author={blog.author}
excerpt={blog.excerpt}
initial="offscreen"
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog-full/layout-05/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const BlogArea = ({ data: { blogs } }: TProps) => {
path={blog.path}
category={blog.category}
postedAt={blog.postedAt}
views={blog.views}
initial="offscreen"
whileInView="onscreen"
viewport={{ once: true, amount: 0.2 }}
Expand Down
16 changes: 2 additions & 14 deletions src/containers/blog/layout-01/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@ type TProps = TSection & {
};
};

const BlogArea = ({
data: { section_title, motto, blogs },
space,
bg,
titleSize,
}: TProps) => {
const BlogArea = ({ data: { section_title, motto, blogs }, space, bg, titleSize }: TProps) => {
const { trans1, trans2 } = useUI();

return (
<Section
className="blog-area tw-relative tw-overflow-hidden"
space={space}
bg={bg}
>
<Section className="blog-area tw-relative tw-overflow-hidden" space={space} bg={bg}>
<div className="tw-absolute tw-inset-0 tw-flex jtw-justify-center tw-items-center">
<img
src="/images/bg/shape-03.png"
Expand Down Expand Up @@ -69,7 +60,6 @@ const BlogArea = ({
category={blogs[0].category}
postedAt={blogs[0].postedAt}
image={blogs[0].image}
views={blogs[0].views}
/>
</motion.div>
<motion.div
Expand All @@ -85,7 +75,6 @@ const BlogArea = ({
category={blogs[1].category}
postedAt={blogs[1].postedAt}
image={blogs[1].image}
views={blogs[1].views}
/>
</motion.div>
<motion.div
Expand All @@ -101,7 +90,6 @@ const BlogArea = ({
category={blogs[2].category}
postedAt={blogs[2].postedAt}
image={blogs[2].image}
views={blogs[2].views}
/>
</motion.div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog/layout-02/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const BlogArea = ({
image={blog.image}
path={blog.path}
postedAt={blog.postedAt}
views={blog.views}
category={blog.category}
initial="offscreen"
whileInView="onscreen"
Expand Down
1 change: 0 additions & 1 deletion src/containers/blog/layout-03/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const BlogArea = ({ data: { section_title, blogs }, space, bg, titleSize }: TPro
category={blog.category}
postedAt={blog.postedAt}
image={blog.image}
views={blog.views}
initial="offscreen"
whileInView="onscreen"
viewport={{ once: true, amount: 0.4 }}
Expand Down
36 changes: 0 additions & 36 deletions src/data/instructors/arthur-will.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/blogs/author/[author]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const getStaticProps = ({ params }: Params) => {
const author = getAuthorBySlug(params.author, ["id", "name", "slug"]);
const { posts, count } = getPostsByAuthor(
author.id,
["title", "image", "category", "postedAt", "views"],
["title", "image", "category", "postedAt"],
0,
POSTS_PER_PAGE
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blogs/author/[author]/page/[page].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const getStaticProps = ({ params }: Params) => {
const skip = (currentPage - 1) * POSTS_PER_PAGE;
const { posts, count } = getPostsByAuthor(
author.id,
["title", "image", "category", "postedAt", "views"],
["title", "image", "category", "postedAt"],
skip,
POSTS_PER_PAGE
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blogs/blog-classic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BlogClassic.Layout = Layout01;

export const getStaticProps: GetStaticProps = () => {
const { blogs, count } = getAllBlogs(
["title", "image", "category", "postedAt", "views", "author", "excerpt"],
["title", "image", "category", "postedAt", "author", "excerpt"],
0,
POSTS_PER_PAGE
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/blogs/blog-classic/page/[page].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const getStaticPaths: GetStaticPaths = () => {
.filter(Boolean);

const paths = pagesToGenerate.map((page) => {
return { params: { page: String(page) } }; // cast page to string
return { params: { page: String(page) } };
});

return {
Expand All @@ -78,7 +78,7 @@ export const getStaticProps: GetStaticProps<TProps, Params> = ({ params }) => {
const currentPage = !page || Number.isNaN(+page) ? 1 : +page;
const skip = (currentPage - 1) * POSTS_PER_PAGE;
const { blogs, count } = getAllBlogs(
["title", "image", "category", "postedAt", "views", "author", "excerpt"],
["title", "image", "category", "postedAt", "author", "excerpt"],
skip,
POSTS_PER_PAGE
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blogs/blog-grid-sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BlogGridSidebar.Layout = Layout01;

export const getStaticProps: GetStaticProps = () => {
const { blogs, count } = getAllBlogs(
["title", "image", "category", "postedAt", "views"],
["title", "image", "category", "postedAt"],
0,
POSTS_PER_PAGE
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/blogs/blog-grid-sidebar/page/[page].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const getStaticPaths: GetStaticPaths = () => {
.filter(Boolean);

const paths = pagesToGenerate.map((page) => {
return { params: { page: String(page) } }; // cast page to string
return { params: { page: String(page) } };
});

return {
Expand All @@ -78,7 +78,7 @@ export const getStaticProps: GetStaticProps<TProps, Params> = ({ params }) => {
const currentPage = !page || Number.isNaN(+page) ? 1 : +page;
const skip = (currentPage - 1) * POSTS_PER_PAGE;
const { blogs, count } = getAllBlogs(
["title", "slug", "image", "category", "postedAt", "views"],
["title", "slug", "image", "category", "postedAt"],
skip,
POSTS_PER_PAGE
);
Expand Down
Loading

0 comments on commit 3bc1347

Please sign in to comment.