forked from json-schema-org/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.page.tsx
147 lines (136 loc) · 5.75 KB
/
index.page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import React from 'react';
import { DocsHelp } from '~/components/DocsHelp';
import { getLayout } from '~/components/Sidebar';
import Head from 'next/head';
import { Headline1 } from '~/components/Headlines';
import { SectionContext } from '~/context';
import roadmap from '~/data/roadmap.json';
import NextPrevButton from '~/components/NavigationButtons';
const statusColors = {
'In Progress': 'bg-green-600 text-white dark:bg-green-500',
Done: 'bg-purple-600 text-white dark:bg-purple-500',
Planned: 'bg-blue-600 text-white dark:bg-blue-500',
Paused: 'bg-red-600 text-white dark:bg-red-500',
Deferred: 'bg-blue-600 text-white dark:bg-blue-500',
Unknown: 'bg-gray-600 text-white dark:bg-gray-500',
};
const effortColors = {
Low: 'bg-green-600 text-white dark:bg-green-500',
Medium: 'bg-yellow-600 text-white dark:bg-yellow-500',
High: 'bg-red-600 text-white dark:bg-red-500',
'Low-medium': 'bg-green-600 text-white dark:bg-green-500',
Unknown: 'bg-gray-600 text-white dark:bg-gray-500',
};
const impactColors = {
Low: 'bg-red-600 text-white dark:bg-red-500',
Medium: 'bg-yellow-600 text-white dark:bg-yellow-500',
High: 'bg-green-600 text-white dark:bg-green-500',
'Medium-high': 'bg-yellow-600 text-white dark:bg-yellow-500',
'Low-medium': 'bg-red-600 text-white dark:bg-red-500',
Unknown: 'bg-gray-600 text-white dark:bg-gray-500',
};
export default function Roadmap() {
const newTitle = 'JSON Schema Roadmap';
const markdownFile = '_indexPage';
return (
<SectionContext.Provider value='docs'>
<Head>
<title>{newTitle}</title>
</Head>
<Headline1>{newTitle}</Headline1>
<div className='text-md'>
Our "Roadmap" section displays our key objectives for the long term.
While this roadmap provides a detailed outlook for the near future,
please note that it might be subject to change. In fact, we are
currently{' '}
<a
className='text-blue-600 underline'
href='https://github.com/orgs/json-schema-org/discussions/813'
>
discussing
</a>{' '}
the new priorities for the next 24-month cycle, which will lead to
relevant changes. Please consider joining the discussion to become an
active part of JSON Schema's future!
</div>
<div className='text-gray-900 dark:text-white'>
<div className='container mt-14 mx-auto px-4'>
<div className='relative'>
<div className='absolute left-0 top-0 bottom-0 w-0.5 bg-blue-600'></div>
{roadmap.map((item) => {
const status =
item.fieldValues.nodes.find(
(node) => node.field?.name === 'Status',
)?.name || 'Unknown';
const category =
item.fieldValues.nodes.find(
(node) => node.field?.name === 'Category',
)?.name || 'Uncategorized';
const effort =
item.fieldValues.nodes.find(
(node) => node.field?.name === 'Effort',
)?.name || 'Unknown';
const impact =
item.fieldValues.nodes.find(
(node) => node.field?.name === 'Impact',
)?.name || 'Unknown';
const effortClass =
effortColors[effort as keyof typeof effortColors] ||
effortColors['Unknown'];
const impactClass =
impactColors[impact as keyof typeof impactColors] ||
impactColors['Unknown'];
const statusClass =
statusColors[status as keyof typeof statusColors] ||
statusColors['Unknown'];
return (
<div key={item.id} className='relative z-10 mb-12 pl-8'>
<div className='absolute -left-4 top-6 w-8 h-8 bg-blue-600 rounded-full z-10 flex items-center justify-center'>
<div className='w-4 h-4 bg-white dark:bg-gray-800 rounded-full'></div>
</div>
<div className='bg-white dark:bg-gray-800 relative z-10 w-full rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 shadow-lg'>
<div className='p-6'>
<span className='inline-block px-3 py-1 text-sm font-semibold text-white bg-blue-600 rounded-full mb-4'>
{category}
</span>
<h2 className='text-2xl font-bold mb-3'>
{item.content.title}
</h2>
<div className='flex flex-wrap items-center gap-2 text-sm'>
<span
className={`px-2 py-1 rounded whitespace-nowrap ${effortClass}`}
>
Effort: {effort}
</span>
<span
className={`px-2 py-1 rounded whitespace-nowrap ${impactClass}`}
>
Impact: {impact}
</span>
</div>
</div>
<div className={`px-6 py-3 ${statusClass}`}>
<span className='text-sm font-semibold text-white uppercase'>
{status}
</span>
</div>
</div>
</div>
);
})}
</div>
</div>
</div>
<NextPrevButton
prevLabel='What is JSON Schema?'
=======
prevLabel='What is JSON Schema'
prevURL='/overview/what-is-jsonschema'
nextLabel='Sponsors'
nextURL='/overview/sponsors'
/>
<DocsHelp markdownFile={markdownFile} />
</SectionContext.Provider>
);
}
Roadmap.getLayout = getLayout;