-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
122 changed files
with
1,904 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare module 'react-select-virtualized'; | ||
declare module '*.svg'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import Http from './index'; | ||
|
||
export const getScheduleByLecturer = lecturerId => { | ||
export const getScheduleByLecturer = (lecturerId: string) => { | ||
return Http.get('/schedule/lecturer?lecturerId=' + lecturerId) | ||
.then(res => res.data); | ||
} | ||
|
||
export const getScheduleByGroup = groupId => { | ||
export const getScheduleByGroup = (groupId: string) => { | ||
return Http.get('/schedule/lessons?groupId=' + groupId) | ||
.then(res => res.data); | ||
} | ||
|
||
export const getExamsByGroup = groupName => { | ||
export const getExamsByGroup = (groupName: string) => { | ||
return Http.get('/exams/group?groupId=' + groupName) | ||
.then(res => res.data); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { GroupContextProvider } from "../common/context/groupContext"; | ||
import { LecturerContextProvider } from "../common/context/lecturerContext"; | ||
import { PreloadedListsContextProvider } from "../common/context/preloadedListsContext"; | ||
import { WeekContextProvider } from "../common/context/weekContext"; | ||
import { useCurrentDateParams } from "../common/utils/useCurrentDateParams"; | ||
import ThemeContextProvider from "../common/context/themeContext"; | ||
import Navbar from "../containers/navbar"; | ||
import ScheduleRouter from "../containers/router"; | ||
import ScrollToTop from "../containers/scrollToTop/index"; | ||
import { Wrapper } from "./app.style"; | ||
|
||
function App() { | ||
const { currentWeek } = useCurrentDateParams(); | ||
return ( | ||
<WeekContextProvider | ||
initialValue={currentWeek === 1 ? "firstWeek" : "secondWeek"} | ||
> | ||
<PreloadedListsContextProvider> | ||
<GroupContextProvider> | ||
<ThemeContextProvider> | ||
<LecturerContextProvider> | ||
<ScrollToTop> | ||
<Wrapper> | ||
<Navbar /> | ||
<ScheduleRouter /> | ||
</Wrapper> | ||
</ScrollToTop> | ||
</LecturerContextProvider> | ||
</ThemeContextProvider> | ||
</GroupContextProvider> | ||
</PreloadedListsContextProvider> | ||
</WeekContextProvider> | ||
); | ||
} | ||
|
||
export default App; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/common/constants/dayOptions.js → src/common/constants/dayOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ export const MODES = { | |
SMALL: 'smallMode', | ||
MEDIUM: 'mediumMode', | ||
BIG: 'bigMode', | ||
}; | ||
} as Record<string, string>; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { AnyStyledComponent } from "styled-components"; | ||
import { | ||
ScheduleItemTypeLab, | ||
ScheduleItemTypeLec, | ||
ScheduleItemTypePrac, | ||
} from "../../components/scheduleItemContent/scheduleItemContent.style"; | ||
|
||
export const SUBJECT_TYPES: Record<string, { component: AnyStyledComponent; title: string }> = | ||
{ | ||
lec: { | ||
component: ScheduleItemTypeLec, | ||
title: "Лек", | ||
}, | ||
lab: { | ||
component: ScheduleItemTypeLab, | ||
title: "Лаб", | ||
}, | ||
prac: { | ||
component: ScheduleItemTypePrac, | ||
title: "Прак", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { createContext, useContext, useState } from "react"; | ||
|
||
interface Props { | ||
children: React.ReactNode | ||
} | ||
|
||
interface GroupContextType { | ||
group?: any; | ||
setGroup: React.Dispatch<any>; | ||
}; | ||
|
||
|
||
const defaultContext: GroupContextType = { | ||
setGroup: () => {}, | ||
}; | ||
|
||
const GroupContext = createContext<GroupContextType>(defaultContext); | ||
|
||
export const useGroupContext = () => useContext(GroupContext); | ||
|
||
export const GroupContextProvider: React.FC<Props> = ({ children }) => { | ||
const [group, setGroup] = useState<any>(); | ||
|
||
const params: GroupContextType = { setGroup, group }; | ||
|
||
return <GroupContext.Provider value={params}>{children}</GroupContext.Provider> ; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { createContext, useContext, useState, ReactNode, FC } from 'react'; | ||
|
||
interface Props { | ||
children: ReactNode; | ||
} | ||
|
||
interface LecturerContextType { | ||
lecturer: string | null; // Change this to the actual type of lecturer | ||
setLecturer: React.Dispatch<React.SetStateAction<string | null>>; | ||
} | ||
|
||
const LecturerContext = createContext<LecturerContextType | null>(null); | ||
|
||
export const useLecturerContext = () => { | ||
const context = useContext(LecturerContext); | ||
if (context === null) { | ||
throw new Error('useLecturerContext must be used within a LecturerContextProvider'); | ||
} | ||
return context; | ||
}; | ||
|
||
export const LecturerContextProvider: FC<Props> = ({ children }) => { | ||
const [lecturer, setLecturer] = useState<string | null>(null); | ||
|
||
const params = { lecturer, setLecturer }; | ||
|
||
return ( | ||
<LecturerContext.Provider value={params}> | ||
{children} | ||
</LecturerContext.Provider> | ||
); | ||
}; |
Oops, something went wrong.