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

View File

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

View File

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

View File

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