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

Improve docs/gallery card component #1445

Merged
merged 2 commits into from
Jan 29, 2024
Merged
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
38 changes: 19 additions & 19 deletions website/src/components/GalleryPage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { useEffect, useState, useCallback } from "react";
import galleryData from "../data/gallery.json";
import { Card, List, Select } from "antd";
import { Card, List, Select, Typography } from "antd";
import { useLocation, useHistory } from "react-router-dom";

const { Option } = Select;
const { Paragraph, Title } = Typography;

const GalleryPage = () => {
const location = useLocation();
Expand Down Expand Up @@ -75,10 +76,10 @@ const GalleryPage = () => {
gutter: 16,
xs: 1,
sm: 2,
md: 3,
lg: 3,
xl: 4,
xxl: 4,
md: 2,
lg: 2,
xl: 3,
xxl: 3,
}}
dataSource={filteredData}
renderItem={(item) => (
Expand All @@ -92,6 +93,7 @@ const GalleryPage = () => {
<Card
hoverable
bordered
style={{ height: 370, paddingTop: 15 }}
cover={
<img
alt={item.title}
Expand All @@ -102,29 +104,27 @@ const GalleryPage = () => {
: `/autogen/img/gallery/${item.image}`
: `/autogen/img/gallery/default.png`
}
style={{
height: 150,
width: "fit-content",
margin: "auto",
padding: 2,
}}
/>
}
>
<div>
<span
style={{
fontSize: "1.2rem",
fontWeight: "bold",
color: "black",
}}
>
{item.title}
</span>
</div>
<div
<Title level={5} ellipsis={{ rows: 2 }}>
{item.title}
</Title>
<Paragraph
ellipsis={{ rows: 3 }}
style={{
// fontSize: "0.8rem",
fontWeight: "normal",
color: "#727272",
}}
>
{item.description ? item.description : item.title}
</div>
</Paragraph>
<TagsView tags={item.tags} />
</Card>
</a>
Expand Down
Loading