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

Add border radius in tags #1116

Merged
6 changes: 3 additions & 3 deletions app/(app)/articles/_client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ const ArticlesPage = () => {
</section>
</div>
<section className="col-span-4 hidden lg:block">
<div className="mb-8 mt-2 border border-neutral-300 bg-white text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50">
<div className="mb-8 mt-2 rounded border border-neutral-300 bg-white text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50">
<Link href="/articles/join-our-6-week-writing-challenge-quohtgqb">
<Image
className="w-full"
className="w-full rounded-t"
src={challenge}
alt={`"Codú Writing Challenge" text on white background`}
/>
Expand Down Expand Up @@ -191,7 +191,7 @@ const ArticlesPage = () => {
key={title}
// only reason this is toLowerCase is to make url look nicer. Not needed for functionality
href={`/articles?tag=${title.toLowerCase()}`}
className="border border-neutral-300 bg-white px-6 py-2 text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50"
className="rounded border border-neutral-300 bg-white px-6 py-2 text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50"
>
{getCamelCaseFromLower(title)}
</Link>
Expand Down
71 changes: 71 additions & 0 deletions app/(app)/courses/[slug]/[id]/_client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"use client";
import { FEATURE_FLAGS, isFlagEnabled } from "@/utils/flags";
import { CheckCircle, CircleCheck, PlayCircle, SquarePlay } from "lucide-react";
import { type Session } from "next-auth";
import { notFound } from "next/navigation";
import { mockContentList, mockVideoSrc } from "../../mock";

const Content = ({ session }: { session: Session | null }) => {
const flagEnabled = isFlagEnabled(FEATURE_FLAGS.COURSE_VIDEO);

if (!flagEnabled) {
notFound();
}

return (
<div className="flex w-full flex-grow flex-col">
<div className="w-full divide-x divide-gray-700 lg:grid lg:grid-cols-12">
{/* Video container */}
<div className="col-span-9">
<div className="bg-black">
<iframe
className="aspect-video w-full"
src="https://www.youtube.com/embed/Q68wOyeG5lc"
title="YouTube video"
></iframe>
</div>
</div>

{/* Sidebar */}
<div className="col-span-3 flex w-full flex-col overflow-auto">
<ul className="divide-y divide-gray-700">
{mockContentList && mockContentList.length > 0 ? (
mockContentList.map((item, index) => (
<li
key={index}
className="flex flex-row items-center justify-between px-2 py-2 "
>
<div className="flex flex-row items-center">
<SquarePlay
className="mr-4 h-5 w-5 text-white group-hover:text-white"
aria-hidden="true"
/>
<p>{item.title}</p>
</div>
<CircleCheck
className={
item.watched
? "mr-2 h-5 w-5 text-pink-600"
: "mr-2 h-5 w-5 text-white"
}
aria-hidden="true"
/>
</li>
))
) : (
<li className="text-center text-gray-500">
No content available
</li>
)}
</ul>
</div>
</div>
<div className="flex-none">
<div>Video title</div>
<div>descritpion</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Improve video information section.

The video information section is currently using placeholder text. Consider the following improvements:

  1. Use dynamic content for the title and description, possibly from the same source as the video URL.
  2. Fix the typo in "descritpion" to "description".
  3. Add appropriate semantic HTML and styling for better structure and readability.

Here's a suggested improvement:

<div className="mt-4 p-4">
  <h2 className="text-xl font-bold">{videoTitle}</h2>
  <p className="mt-2 text-gray-300">{videoDescription}</p>
</div>

Replace videoTitle and videoDescription with the actual data from your course content.

</div>
);
};

export default Content;
4 changes: 2 additions & 2 deletions app/(app)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ const Home = async () => {
<TrendingPosts session={session} />
</Suspense>
<section className="col-span-5 hidden lg:block">
<div className="mb-8 mt-2 border border-neutral-300 bg-white text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50">
<div className="mb-8 mt-2 rounded border border-neutral-300 bg-white text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50">
<Link href="/articles/join-our-6-week-writing-challenge-quohtgqb">
<Image
className="w-full"
className="w-full rounded-t"
src={challenge}
alt={`"Codú Writing Challenge" text on white background`}
/>
Expand Down
3 changes: 2 additions & 1 deletion components/ArticlePreview/ArticlePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ const ArticlePreview: NextPage<Props> = ({
};

return (
<article className="my-2 rounded-r border border-l-4 border-neutral-300 border-l-pink-600 bg-white p-4 dark:border-neutral-600 dark:border-l-pink-600 dark:bg-neutral-900">
<article className="relative my-2 rounded border border-l-0 border-l-4 border-neutral-300 bg-white p-4 dark:border-neutral-600 dark:border-l-pink-600 dark:bg-neutral-900">
<div className="absolute bottom-0 left-0 top-0 flex justify-between border-l-4 border-l-pink-500 dark:border-l-pink-500"></div>
<div className="flex justify-between">
<div className="mb-4 flex items-center">
<span className="sr-only">{name}</span>
Expand Down
2 changes: 1 addition & 1 deletion components/PopularTags/PopularTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default async function PopularTags() {
// only reason this is toLowerCase is to make url look nicer. Not needed for functionality
href={`/articles?tag=${tag.title.toLowerCase()}`}
key={tag.title}
className="border border-neutral-300 bg-white px-6 py-2 text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50"
className="rounded border border-neutral-300 bg-white px-6 py-2 text-neutral-900 dark:border-neutral-600 dark:bg-neutral-900 dark:text-neutral-50"
>
{getCamelCaseFromLower(tag.title)}
</Link>
Expand Down
Loading