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

fix: article meta & featured collection size as per design #286

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions resources/js/Pages/Articles/Components/ArticleMeta.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ArticleAuthor } from "./ArticleAuthor";
import { ArticleCopy } from "./ArticleCopy";
import { ArticleDate } from "./ArticleDate";
import { ArticleShare } from "./ArticleShare";

interface Properties {
article: App.Data.Articles.ArticleData;
}

export const ArticleMeta = ({ article }: Properties): JSX.Element => (
<div className="px-6 sm:px-8 lg:px-0">
<div className="-mx-6 flex flex-col border-b border-t border-theme-secondary-300 px-6 py-4 sm:-mx-8 sm:px-8 md:mx-0 md:rounded-xl md:border md:px-6 lg:rounded-none lg:border-x-0 lg:border-b-0">
<div className="flex items-center justify-between">
<div className="flex overflow-auto">
<ArticleAuthor article={article} />

<div className="mx-6 border-r border-theme-secondary-300"></div>

<ArticleDate article={article} />
</div>

<div className="hidden md:block">
<ArticleCopy article={article} />
</div>
</div>

<div className="mt-4 flex justify-between border-t border-dashed border-theme-secondary-400 pt-4 md:hidden">
<div>
<ArticleShare
article={article}
className="flex space-x-2"
/>
</div>

<div>
<ArticleCopy article={article} />
</div>
</div>
</div>
</div>
);
79 changes: 27 additions & 52 deletions resources/js/Pages/Articles/Show.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ArticleAuthor } from "./Components/ArticleAuthor";
import { ArticleContent } from "./Components/ArticleContent";
import { ArticleCopy } from "./Components/ArticleCopy";
import { ArticleDate } from "./Components/ArticleDate";
import { ArticleMeta } from "./Components/ArticleMeta";
import { ArticleShare } from "./Components/ArticleShare";
import { FeaturedCollectionsBanner } from "@/Components/FeaturedCollectionsBanner";
import { Heading } from "@/Components/Heading";
Expand All @@ -18,66 +16,43 @@ interface Properties {
const ArticlesShow = ({ article, popularArticles }: Properties): JSX.Element => (
<DefaultLayout>
<article className="w-full lg:px-8 2xl:px-0">
<div className="article-wrapper -mt-6 px-6 sm:-mt-8 sm:px-8 md:px-24 lg:mt-0 lg:rounded-xl lg:border lg:border-theme-secondary-300 lg:px-0">
<div className="mx-auto bg-white/20 pt-8 md:max-w-[768px] xl:max-w-[1000px]">
<div className="border-b border-theme-secondary-400 pb-3">
<Heading level={1}>{article.title}</Heading>
</div>
</div>

<div className="mx-auto mt-6 md:max-w-[768px] xl:max-w-[1000px]">
<div className="aspect-video overflow-hidden rounded-lg bg-theme-secondary-300 ">
<Img
className="h-full w-full rounded-lg object-cover"
wrapperClassName="h-full [&>span]:h-full bg-white"
alt={article.title}
srcSet={`${article.image.large} 1x, ${article.image.large2x} 2x`}
src={article.image.large}
/>
</div>

<div className="relative mt-6 flex items-start pb-6">
<div className="bottom-8 top-8 hidden min-h-[136px] md:sticky md:block">
<ArticleShare
article={article}
className="absolute -ml-[68px] flex flex-col space-y-2"
/>
<div className="article-wrapper -mt-6 sm:-mt-8 lg:mt-0 lg:rounded-xl lg:border lg:border-theme-secondary-300 ">
<div className=" px-6 sm:px-8 md:px-24 lg:px-0">
<div className="mx-auto bg-white/20 pt-8 md:max-w-[768px] xl:max-w-[1000px]">
<div className="border-b border-theme-secondary-400 pb-3">
<Heading level={1}>{article.title}</Heading>
</div>

<ArticleContent article={article} />
</div>
</div>

<div className="-mx-6 flex flex-col border-b border-t border-theme-secondary-300 px-6 py-4 sm:-mx-8 sm:px-8 md:mx-0 md:rounded-xl md:border md:px-6 lg:rounded-none lg:border-x-0 lg:border-b-0">
<div className="flex items-center justify-between">
<div className="flex overflow-auto">
<ArticleAuthor article={article} />

<div className="mx-6 border-r border-theme-secondary-300"></div>

<ArticleDate article={article} />
</div>

<div className="hidden md:block">
<ArticleCopy article={article} />
</div>
</div>
<div className="mt-4 flex justify-between border-t border-dashed border-theme-secondary-400 pt-4 md:hidden">
<div>
<ArticleShare
article={article}
className="flex space-x-2"
<div className="mx-auto mt-6 md:max-w-[768px] xl:max-w-[1000px]">
<div className="aspect-video overflow-hidden rounded-lg bg-theme-secondary-300 ">
<Img
className="h-full w-full rounded-lg object-cover"
wrapperClassName="h-full [&>span]:h-full bg-white"
alt={article.title}
srcSet={`${article.image.large} 1x, ${article.image.large2x} 2x`}
src={article.image.large}
/>
</div>

<div>
<ArticleCopy article={article} />
<div className="relative mt-6 flex items-start pb-6">
<div className="bottom-8 top-8 hidden min-h-[136px] md:sticky md:block">
<ArticleShare
article={article}
className="absolute -ml-[68px] flex flex-col space-y-2"
/>
</div>

<ArticleContent article={article} />
</div>
</div>
</div>

<ArticleMeta article={article} />
</div>
</article>
<div className="px-6 pt-6 sm:px-8 md:px-24 md:pt-3 lg:px-8 2xl:px-0">

<div className="px-6 pt-6 sm:px-8 md:pt-3 2xl:px-0">
<FeaturedCollectionsBanner
collections={article.featuredCollections}
subtitle={tp("pages.articles.consists_of_collections", article.featuredCollections.length, {
Expand Down
Loading