Skip to content

Commit c7b933b

Browse files
committed
Add yearOptions to constants folder
1 parent 1e2b39b commit c7b933b

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/components/search.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
import React from 'react';
22
import axios from 'axios'
33
import { Divider, Dropdown, Button } from 'semantic-ui-react';
4-
4+
import {yearOptions} from '../constants/years'
55
import {
66
urlGetBranchAndDegreeData,
77
urlGetFilteredStudents,
88
} from '../urls'
99

1010
import '../css/search.css'
1111

12-
const yearOptions = [
13-
{ key: 1, text: '1st Year', value: 1 },
14-
{ key: 2, text: '2nd Year', value: 2 },
15-
{ key: 3, text: '3rd Year', value: 3 },
16-
{ key: 4, text: '4th Year', value: 4 },
17-
{ key: 5, text: '5th Year', value: 5 },
18-
{ key: 6, text: '6th Year', value: 6 },
19-
{ key: 7, text: '7th Year', value: 7 },
20-
{ key: 8, text: '8th Year', value: 8 },
21-
{ key: 9, text: '9th Year', value: 9 },
22-
{ key: 10, text: '10th Year', value: 10 },
23-
]
24-
2512
class Search extends React.Component {
2613
constructor(props) {
2714
super(props);

src/constants/years.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export const yearOptions = [
2+
{ key: 1, text: '1st Year', value: 1 },
3+
{ key: 2, text: '2nd Year', value: 2 },
4+
{ key: 3, text: '3rd Year', value: 3 },
5+
{ key: 4, text: '4th Year', value: 4 },
6+
{ key: 5, text: '5th Year', value: 5 },
7+
{ key: 6, text: '6th Year', value: 6 },
8+
{ key: 7, text: '7th Year', value: 7 },
9+
{ key: 8, text: '8th Year', value: 8 },
10+
{ key: 9, text: '9th Year', value: 9 },
11+
{ key: 10, text: '10th Year', value: 10 },
12+
]

0 commit comments

Comments
 (0)