Skip to content

Commit 7e73b81

Browse files
author
Vivek Vishal
authored
Merge pull request #6498 from vishalvivekm/tutorials
Tutorials updates
2 parents 10d9bf2 + c268d89 commit 7e73b81

4 files changed

Lines changed: 62 additions & 44 deletions

File tree

src/assets/data/tutorials/index.js

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const data = [
22
{
3-
date: "Oct. 1st, 2020",
3+
date: "2020-10-01",
44
topic: "An Introduction to Contributing to Meshery",
55
resources: {
66
slides: "https://docs.google.com/presentation/d/1Wc5ALdn-G3fADJ8I6nJlyOGhV2XHVprYPqDvkZ1MEqY/edit#",
@@ -14,7 +14,7 @@ const data = [
1414
],
1515
},
1616
{
17-
date: "Oct. 8th, 2020",
17+
date: "2020-10-08",
1818
topic: "An Introduction to mesheryctl",
1919
resources: {
2020
slides: "https://docs.google.com/presentation/d/1LxhzJhUs9-Hc9mwlKVUMlDAVdH-QWLvU1KWxVuRbSHg/edit?usp=sharing",
@@ -28,7 +28,7 @@ const data = [
2828
],
2929
},
3030
{
31-
date: "Oct. 15th, 2020",
31+
date: "2020-10-15",
3232
topic: "A tutorial on contributing to Layer5 and working with Git",
3333
resources: {
3434
slides: "https://docs.google.com/presentation/d/1UOlwFtZ-VJhW4RgQoSI_QOGUQ7OBG8NZDWrFUor7eyY/edit?usp=sharing",
@@ -42,7 +42,7 @@ const data = [
4242
],
4343
},
4444
{
45-
date: "Oct. 22nd, 2020",
45+
date: "2020-10-22",
4646
topic: "An introduction to all Layer5 repositories",
4747
resources: {
4848
slides: "https://docs.google.com/document/d/1brtiJhdzal_O6NBZU_JQXiBff2InNtmgL_G1JgAiZtk/edit",
@@ -56,7 +56,7 @@ const data = [
5656
],
5757
},
5858
{
59-
date: "Oct. 29th, 2020",
59+
date: "2020-10-29",
6060
topic: "A tutorial on Gatsby",
6161
resources: {
6262
slides: "https://www.gatsbyjs.com/docs/quick-start/",
@@ -74,35 +74,7 @@ const data = [
7474
],
7575
},
7676
{
77-
date: "Nov. 4 2020",
78-
topic: "Functional Testing with Cypress in Meshery UI",
79-
resources: {
80-
slides: "https://layer5.io/blog/meshery/functional-testing-with-cypress-in-meshery-ui",
81-
recording: "https://youtu.be/pIFSI7xtwFs",
82-
},
83-
presenters: [
84-
{
85-
link: "/community/members/rodolfo-martinez-vega",
86-
name: "Rodolfo Martinez Vega",
87-
}
88-
]
89-
},
90-
91-
{
92-
date: "Jan. 28 2021",
93-
topic: "Beginner's guide to contributing to Meshery and mesheryctl",
94-
resources: {
95-
slides: "https://docs.google.com/presentation/d/1oUzWQpFeFbpIs_sejtOPbF9J4nigj9ziEAzoWxmm6ig/edit",
96-
recording: "https://youtu.be/hh_kFLZx3G4",
97-
},
98-
presenters: [
99-
{
100-
name: "Navendu Pottekkat",
101-
}
102-
]
103-
},
104-
{
105-
date: "Jul. 27 2021",
77+
date: "2021-07-27",
10678
topic: "Contributing to Meshery API Swagger Documentation" ,
10779
resources: {
10880
recording: "https://www.youtube.com/watch?v=NAvt6B5kNIQ"
@@ -115,7 +87,7 @@ const data = [
11587
]
11688
},
11789
{
118-
date: "Apr. 10, 2025",
90+
date: "2025-04-10",
11991
topic: "Working with Meshery Docs",
12092
resources: {
12193
slides: "https://docs.google.com/presentation/d/1kQIzSa4f-pOH8cM4SwEdbFZGI_SXVyyhc9zUZPB7bsI/edit?usp=sharing",
@@ -129,7 +101,7 @@ const data = [
129101
]
130102
},
131103
{
132-
date: "Apr. 17, 2025",
104+
date: "2025-04-17",
133105
topic: "End-to-end Testing in Meshery CLI",
134106
resources: {
135107
slides: "https://docs.google.com/presentation/d/1OhUhqIZVPdnjD7eO1ppeXVvTa-P2lIcdCXHncTOX_XE/edit?usp=sharing",
@@ -143,7 +115,7 @@ const data = [
143115
]
144116
},
145117
{
146-
date: "Apr. 24, 2025",
118+
date: "2025-04-24",
147119
topic: "Meshery CI and CD",
148120
resources: {
149121
slides: "https://docs.google.com/presentation/d/1hUDhFeYP7dtCQhOEw2U_wQ-G718Y2e5iU3drMDOdIws/edit?usp=sharing",
@@ -157,7 +129,7 @@ const data = [
157129
]
158130
},
159131
{
160-
date: "Apr. 30, 2025",
132+
date: "2025-04-30",
161133
topic: "Meshery CLI",
162134
resources: {
163135
slides: "https://docs.google.com/presentation/d/1lRop7DAAMUBmuFdzZK25LdQrkLG08eVsXEaDrauP3S8/edit?usp=sharing",
@@ -175,7 +147,7 @@ const data = [
175147
],
176148
},
177149
{
178-
date: "May 8th, 2025",
150+
date: "2025-05-08",
179151
topic: "End-to-end Testing in Meshery UI using Playwright",
180152
resources: {
181153
slides: "https://docs.google.com/presentation/d/1Vcq48Y0nLZsrKKFNYBJ5fm9bIcb2m6ZnYxq2azn6nlM/edit?slide=id.g35936fe4c88_0_0#slide=id.g35936fe4c88_0_0",
@@ -189,7 +161,7 @@ const data = [
189161
],
190162
},
191163
{
192-
date: "May 15th, 2025",
164+
date: "2025-05-15",
193165
topic: "Meshery UI",
194166
resources: {
195167
slides: "https://docs.google.com/presentation/d/1MRDs28YmzrO1t5QNz7WTp50ukCz6fB2p3awZz63HJmA/edit?slide=id.g34811bf5022_0_3#slide=id.g34811bf5022_0_3",

src/sections/Community/Newcomers-guide/Tutorials-table/TutorialsTable.style.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ export const TutorialsTableWrapper = styled.div`
3434
}
3535
}
3636
}
37+
.newBadge {
38+
display: flex;
39+
align-items: center;
40+
justify-content: center;
41+
gap: 6px;
42+
img {
43+
height: 26px;
44+
width: auto;
45+
}
46+
}
3747
`;

src/sections/Community/Newcomers-guide/Tutorials-table/index.js

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,42 @@ const TutorialsTable = () => {
88

99
const columns = React.useMemo(
1010
() => [
11+
{
12+
Header: "Date",
13+
accessor: "date",
14+
Cell: ({ value }) => {
15+
const parsedDate = new Date(value);
16+
return (
17+
<span>
18+
{parsedDate.toLocaleDateString("en-US", {
19+
year: "numeric",
20+
month: "short",
21+
day: "numeric",
22+
})}
23+
</span>
24+
);
25+
}
26+
},
1127
{
1228
Header: "Topic",
1329
accessor: "topic",
30+
Cell: ({ row, value }) => {
31+
const parsedDate = new Date(row.original.date);
32+
const thisYear = new Date().getFullYear();
33+
const isNew = parsedDate.getFullYear() === thisYear;
34+
35+
return (
36+
<span className="newBadge">
37+
{value}
38+
{isNew && (
39+
<img
40+
src="/images/new-badge.png"
41+
alt="New"
42+
/>
43+
)}
44+
</span>
45+
);
46+
},
1447
},
1548
{
1649
Header: "Resources",
@@ -39,17 +72,19 @@ const TutorialsTable = () => {
3972
],
4073
[]
4174
);
75+
const sortedData = React.useMemo(() => {
76+
return [...data].sort((a, b) => new Date(b.date) - new Date(a.date));
77+
}, []);
4278

79+
const tableInstance = useTable({ columns, data: sortedData });
4380
const {
4481
getTableProps,
4582
getTableBodyProps,
4683
headerGroups,
4784
rows,
4885
prepareRow,
49-
} = useTable({
50-
columns,
51-
data,
52-
});
86+
} = tableInstance;
87+
5388

5489
return (
5590
<TutorialsTableWrapper>
@@ -88,3 +123,4 @@ const TutorialsTable = () => {
88123
};
89124

90125
export default TutorialsTable;
126+

static/images/new-badge.png

21.7 KB
Loading

0 commit comments

Comments
 (0)