Skip to content

Commit

Permalink
button link for topic card
Browse files Browse the repository at this point in the history
  • Loading branch information
GraemeFulton committed Jan 29, 2024
1 parent 986d8f0 commit 1779303
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions components/v4/layout/PostGroupRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import SmallCard from "../card/SmallCard/SmallCardStacked";
import { useIntl } from "react-intl";
import Button from "@/components/Primitives/Button";

const PostGroupRow = ({ largePost, smallPosts, description,title }) => {
import Link from 'next/link'
const PostGroupRow = ({ largePost, smallPosts, description,title,topicObject }) => {
let url = largePost?.attributes?.featuredImage?.data?.attributes?.url;
const dummyAvatar = 'https://s3-us-west-1.amazonaws.com/tinify-bucket/%2Fprototypr%2Ftemp%2F1595435549331-1595435549330.png'
const largeCoverImage = url
Expand All @@ -29,10 +29,12 @@ const PostGroupRow = ({ largePost, smallPosts, description,title }) => {
{intl.formatMessage({ id: title })}
</h2>
<p>
219 posts
{topicObject?.tagline}
{/* {intl.formatMessage({ id: description })} */}
</p>
<Button className="rounded-full mt-6" variant={"ghostSmallBlue"}>Browse</Button>
<Link href={`/posts/${topicObject?.slug}/page/1`}>
<Button className="rounded-full mt-6" variant={"ghostSmallBlue"}>Browse</Button>
</Link>
</div>
</div>
{/* <div className="w-full lg:w-1/2">
Expand Down
4 changes: 2 additions & 2 deletions components/v4/section/TopicIndexSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Container from "@/components/container";
import LargePostGridC from "@/components/v4/layout/LargePostGridB";
import PostGroupRow from "../layout/PostGroupRow";
// import {RssSimple} from 'phosphor-react'
const TopicIndexSection = ({user, heroCardPost, viewablePosts, jobsSidebar,title }) => {
const TopicIndexSection = ({user, heroCardPost, viewablePosts, jobsSidebar,title , topicObject}) => {
return (
<Container maxWidth="max-w-[1320px]">
<div className="w-full shadow-sm h-full grid grid-cols-12 flex justify-center bg-white rounded-xl py-2 md:p-6">
<div className={`w-full max-w-full flex flex-col gap-2 col-span-12 py-3 `}>
{/* <LargePostGridC title={title} largePost={heroCardPost} smallPosts={viewablePosts} /> */}
<PostGroupRow title={title} largePost={heroCardPost} smallPosts={viewablePosts} />
<PostGroupRow topicObject={topicObject} title={title} largePost={heroCardPost} smallPosts={viewablePosts} />
</div>
{/* <SidebarDiscover
paddingTop="hidden ml-4 pl-6 lg:block pt-12"
Expand Down
1 change: 1 addition & 0 deletions pages/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default function Index({
<div key={`section_${index}`}>
<TopicIndexSection
title={topic.name}
topicObject={topic}
user={user}
heroCardPost={topicRes[topic.slug]?.posts[0]}
viewablePosts={topicRes[topic.slug]?.posts?.slice(0, 3)}
Expand Down

0 comments on commit 1779303

Please sign in to comment.