Skip to content

Commit a52eedd

Browse files
committed
feat: add rules page
1 parent 4ecb295 commit a52eedd

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Landing from './components/Landing';
1010
import Login from './components/Login';
1111
import Register from './components/Register';
1212
import PrivateRoute from './components/Routing/PrivateRoute';
13+
import Rules from './components/rules/Rules';
1314

1415
function App() {
1516
const queryClient = new QueryClient();
@@ -29,6 +30,7 @@ function App() {
2930
<Register />
3031
</Route>
3132
<PrivateRoute exact path="/benchmarks" component={Benchmarks} />
33+
<PrivateRoute exact path="/rules" component={Rules} />
3234
<PrivateRoute
3335
exact
3436
path="/benchmarks/create"

src/components/Page/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import useDarkMode from 'use-dark-mode';
77
import { useToken } from '../../hooks/token';
88
import useProfile from '../../hooks/users';
99

10-
const navigation = ['Benchmarks'];
10+
const navigation = ['Benchmarks', 'Rules'];
1111
const profile = ['Your Profile', 'Settings', 'Sign out'];
1212

1313
export default function Navbar() {

src/components/rules/Rules.tsx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import Page from '../Page/Page';
2+
import Header from '../Page/Header';
3+
import React from 'react';
4+
5+
const Rules: React.FC = () => {
6+
return (
7+
<Page>
8+
<Header title="Quality rules" />
9+
<div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
10+
<p className="ml-2 dark:text-gray-100">
11+
This page contains all the rules for the supported languages.
12+
</p>
13+
<h1 className="text-3xl dark:text-gray-100 font-bold text-gray-900 ml-2 mt-3">
14+
C++
15+
</h1>
16+
<ul className="list-disc dark:text-gray-100 ml-20 mt-5">
17+
<li>
18+
If the function names are not in snake case, decrease score of 3
19+
points
20+
</li>
21+
<li>
22+
If the function names is longer than 25 characters, decrease score
23+
of 1 points
24+
</li>
25+
<li>
26+
If the function body contains more than 30 lines, decrease score of
27+
5 points
28+
</li>
29+
<li>
30+
If the line in a function have more than 80 characters, decrease
31+
score of 1 point
32+
</li>
33+
</ul>
34+
<h1 className="text-3xl dark:text-gray-100 font-bold text-gray-900 ml-2 mt-3">
35+
Python
36+
</h1>
37+
<ul className="list-disc dark:text-gray-100 ml-20 mt-5">
38+
<li>
39+
If the function names are not in snake case, decrease score of 3
40+
points
41+
</li>
42+
<li>
43+
If the function names is longer than 25 characters, decrease score
44+
of 1 points
45+
</li>
46+
<li>
47+
If the line in a function have more than 80 characters, decrease
48+
score of 1 point
49+
</li>
50+
</ul>
51+
<h1 className="text-3xl dark:text-gray-100 font-bold text-gray-900 ml-2 mt-3">
52+
Go
53+
</h1>
54+
<ul className="list-disc dark:text-gray-100 ml-20 mt-5">
55+
<li>
56+
If the function names are not in snake case, decrease score of 3
57+
points
58+
</li>
59+
<li>
60+
If the function names is longer than 25 characters, decrease score
61+
of 1 points
62+
</li>
63+
<li>
64+
If the function body contains more than 30 lines, decrease score of
65+
5 points
66+
</li>
67+
</ul>
68+
</div>
69+
</Page>
70+
);
71+
};
72+
73+
export default Rules;

0 commit comments

Comments
 (0)