Skip to content

Commit 3608079

Browse files
authored
Improve docs/gallery card component (microsoft#1445)
* Improve docs/gallery card component * added border to gallery card component
1 parent 6cf5bb0 commit 3608079

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

website/src/components/GalleryPage.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React, { useEffect, useState, useCallback } from "react";
22
import galleryData from "../data/gallery.json";
3-
import { Card, List, Select } from "antd";
3+
import { Card, List, Select, Typography } from "antd";
44
import { useLocation, useHistory } from "react-router-dom";
55

66
const { Option } = Select;
7+
const { Paragraph, Title } = Typography;
78

89
const GalleryPage = () => {
910
const location = useLocation();
@@ -75,10 +76,10 @@ const GalleryPage = () => {
7576
gutter: 16,
7677
xs: 1,
7778
sm: 2,
78-
md: 3,
79-
lg: 3,
80-
xl: 4,
81-
xxl: 4,
79+
md: 2,
80+
lg: 2,
81+
xl: 3,
82+
xxl: 3,
8283
}}
8384
dataSource={filteredData}
8485
renderItem={(item) => (
@@ -92,6 +93,7 @@ const GalleryPage = () => {
9293
<Card
9394
hoverable
9495
bordered
96+
style={{ height: 370, paddingTop: 15 }}
9597
cover={
9698
<img
9799
alt={item.title}
@@ -102,29 +104,27 @@ const GalleryPage = () => {
102104
: `/autogen/img/gallery/${item.image}`
103105
: `/autogen/img/gallery/default.png`
104106
}
107+
style={{
108+
height: 150,
109+
width: "fit-content",
110+
margin: "auto",
111+
padding: 2,
112+
}}
105113
/>
106114
}
107115
>
108-
<div>
109-
<span
110-
style={{
111-
fontSize: "1.2rem",
112-
fontWeight: "bold",
113-
color: "black",
114-
}}
115-
>
116-
{item.title}
117-
</span>
118-
</div>
119-
<div
116+
<Title level={5} ellipsis={{ rows: 2 }}>
117+
{item.title}
118+
</Title>
119+
<Paragraph
120+
ellipsis={{ rows: 3 }}
120121
style={{
121-
// fontSize: "0.8rem",
122122
fontWeight: "normal",
123123
color: "#727272",
124124
}}
125125
>
126126
{item.description ? item.description : item.title}
127-
</div>
127+
</Paragraph>
128128
<TagsView tags={item.tags} />
129129
</Card>
130130
</a>

0 commit comments

Comments
 (0)