Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 0ba9b18

Browse files
committed
feat: implement stepper component and deploy to progress section
1 parent 53faca1 commit 0ba9b18

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

src/components/Progress.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import React from 'react';
2+
import Stepper from '../components/Stepper';
23

34
const Progress = ({ pageContext: { locale: language } }) => {
5+
const stepperItems = [
6+
{ label: 'Import', status: 'done' },
7+
{ label: 'Build', status: 'doing' },
8+
{ label: 'Test', status: null },
9+
{ label: 'Release', status: null },
10+
];
411

512
return (
613
<div className="relative bg-white dark:bg-gray-900 py-16 sm:py-24 lg:py-32">
714
<div className="mx-auto max-w-md px-4 text-center sm:max-w-3xl sm:px-6 lg:px-8 lg:max-w-7xl">
815
<p className="mt-2 text-3xl font-extrabold text-gray-900 dark:text-gray-300 tracking-tight sm:text-4xl">
916
Current Release Progress
1017
</p>
18+
<Stepper items={stepperItems}/>
1119
<p className="mt-5 max-w-prose mx-auto text-xl text-gray-500">
1220
Rocky Linux 9.0 will be ready for general release in the June - July 2022 timeframe after thorough testing and validation.
1321
</p>

src/components/Stepper.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import { CheckIcon } from '@heroicons/react/outline';
3+
4+
/**
5+
* Items schema:
6+
*
7+
* { label: string, status: 'done'|'doing'|null }
8+
*/
9+
10+
const Stepper = ({ items }) => {
11+
const stepperItems = items.map((v, i) => {
12+
return (
13+
<div className={`${i !== items.length - 1 ? 'w-full' : ''} flex items-center`}>
14+
<div className="relative flex flex-col items-center">
15+
<div className={`rounded-full transition duration-500 ease-in-out h-12 w-12 flex items-center justify-center py-3 ${v.status == 'done' ? 'bg-green-500 text-white' : (v.status == 'doing' ? 'bg-blue-500 text-white' : 'border-gray-300 border-2 text-gray-800 bg-white')} font-bold`}>
16+
<span className="font-bold text-xl">
17+
{ v.status == 'done' ? <CheckIcon className="h-6 w-6" /> : i + 1 }
18+
</span>
19+
</div>
20+
<div className={`absolute top-0 text-center mt-14 w-32 font-medium text-${v.status == 'done' ? 'green' : (v.status == 'doing' ? 'blue' : 'gray')}-500`}>{v.label}</div>
21+
</div>
22+
<div className="flex-auto border-t-2 transition duration-500 ease-in-out border-gray-300" />
23+
</div>
24+
);
25+
});
26+
27+
return (
28+
<div className="mx-4 p-4 flex justify-between items-center my-20">
29+
{stepperItems}
30+
</div>
31+
);
32+
}
33+
34+
export default Stepper;
35+

tailwind.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
const colors = require('tailwindcss/colors');
22

33
module.exports = {
4-
purge: ['./src/**/*.{js,jsx,ts,tsx}'],
5-
content: [],
4+
content: ['./src/**/*.{js,jsx,ts,tsx}'],
65
theme: {
76
colors: {
87
green: {

0 commit comments

Comments
 (0)