Corrected typos

This commit is contained in:
maciekglowacki 2020-06-20 11:13:12 +02:00
parent 6992906450
commit 63c85abeb4
6 changed files with 13 additions and 16 deletions

View File

@ -3,17 +3,17 @@ import React, { Component } from "react";
import { User } from "./models/user";
export interface BuisnessProvided {
states: BuisnessState;
states: BusinessState;
reducers: () => void;
}
interface BuisnessState {
interface BusinessState {
user: User | null;
}
interface Props {}
class BusinessLogicProvider extends Component<Props, BuisnessState> {
class BusinessLogicProvider extends Component<Props, BusinessState> {
constructor(props: Props) {
super(props);
this.state = {
@ -29,19 +29,16 @@ class BusinessLogicProvider extends Component<Props, BuisnessState> {
const urlParams = new URLSearchParams(window.location.search);
const ticket = urlParams.get("ticket");
if (!ticket && !this.state.user) {
window.location.replace(
`https://cas.amu.edu.pl/cas/login?service=${window.origin}&locale=pl`
);
} else if (ticket && !this.state.user) {
if (!ticket) {
window.location.replace(`https://cas.amu.edu.pl/cas/login?service=${window.origin}&locale=pl`);
}
if (ticket && !this.state.user) {
this.setState({ user: { ticket } });
}
}
logout() {
window.location.replace(
`https://cas.amu.edu.pl/cas/logout?service=${window.origin}`
);
window.location.replace(`https://cas.amu.edu.pl/cas/logout?service=${window.origin}`);
}
render() {

View File

@ -1,8 +1,8 @@
import React from "react";
import "./index.scss";
import Class, { Group } from "../Class";
import BusinessLogicContext from "../../buisnesslogic/BusinessLogicContext";
import { BuisnessProvided } from "../../buisnesslogic/BuisnessLogicProvider";
import BusinessLogicContext from "../../businesslogic/BusinessLogicContext";
import { BuisnessProvided } from "../../businesslogic/BusinessLogicProvider";
interface RightBarProps {
onClassHover: (group_id: String, class_id: String) => void;

View File

@ -1,7 +1,7 @@
import { Menu, MenuItem } from "@material-ui/core";
import React, { FC } from "react";
import BusinessLogicContext from "../../buisnesslogic/BusinessLogicContext";
import { BuisnessProvided } from "../../buisnesslogic/BuisnessLogicProvider";
import BusinessLogicContext from "../../businesslogic/BusinessLogicContext";
import { BuisnessProvided } from "../../businesslogic/BusinessLogicProvider";
interface ProfileProps {
anchorEl: HTMLElement | null;

View File

@ -1,7 +1,7 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import BuisnessLogicProvider from "./buisnesslogic/BuisnessLogicProvider";
import BuisnessLogicProvider from "./businesslogic/BusinessLogicProvider";
ReactDOM.render(
<React.Fragment>