cleanup w new version of react

This commit is contained in:
lingdocs 2021-10-18 01:00:02 -04:00
parent 34e1359872
commit 7717b3a76b
19 changed files with 12 additions and 29 deletions

View File

@ -7,8 +7,7 @@
*/
import { useState } from "react";
// eslint-disable-next-line
import { BrowserRouter as Router, Route, withRouter, Switch, RouteComponentProps } from "react-router-dom";
import { Route, withRouter, Switch, RouteComponentProps } from "react-router-dom";
import "./App.css";
import Page404 from "./pages/404";
import Chapter from "./components/Chapter";
@ -44,10 +43,12 @@ function App(props: RouteComponentProps) {
}
useEffect(() => {
logAnalytics();
// eslint-disable-next-line
}, []);
useEffect(() => {
window.scroll(0, 0);
logAnalytics();
// eslint-disable-next-line
}, [props.location.pathname, user]);
return (
<>

View File

@ -6,7 +6,6 @@
*
*/
import React from "react";
import TableOfContents from "./TableOfContents";
import Footer from "./Footer";

View File

@ -1,4 +1,3 @@
import React from "react";
import {
Types as T,
Examples,

View File

@ -6,9 +6,7 @@
*
*/
import React from "react";
// eslint-disable-next-line
import { BrowserRouter as Router, Link } from "react-router-dom";
import { Link } from "react-router-dom";
import leftChevron from "./chevron_left-24px.svg";
import rightChevron from "./chevron_right-24px.svg";

View File

@ -1,4 +1,3 @@
import React from "react";
import {
InlinePs,
defaultTextOptions as opts,

View File

@ -6,9 +6,7 @@
*
*/
import React from "react";
// eslint-disable-next-line
import { BrowserRouter as Router, Link } from "react-router-dom";
import { Link } from "react-router-dom";
import { useUser } from "../user-context";
const hamburger = <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">

View File

@ -1,4 +1,3 @@
import React from "react";
import buttonUnpressed from "../images/button-unpressed.png";
import buttonHalfPressed from "../images/button-half-pressed.png";
import buttonFullyPressed from "../images/button-fully-pressed.png";

View File

@ -6,9 +6,8 @@
*
*/
import React, { useState } from "react";
// eslint-disable-next-line
import { BrowserRouter as Router, Link } from "react-router-dom";
import { useState } from "react";
import { Link } from "react-router-dom";
import classNames from "classnames";
import SmoothCollapse from "react-smooth-collapse";

View File

@ -1,4 +1,3 @@
import React from "react";
import {
Examples,
} from "@lingdocs/pashto-inflector";

View File

@ -6,7 +6,6 @@
*
*/
import React from 'react';
import { NavHashLink } from 'react-router-hash-link';
import Scrollspy from 'react-scrollspy';

View File

@ -1,4 +1,3 @@
import React from "react";
// import "./formula.css";
// import teacher from "./teacher-small.png";

View File

@ -1,4 +1,4 @@
import React from "react";
import { Component } from "react";
import classNames from "classnames";
import highlightExample from "./highlight-example";
import {
@ -16,7 +16,7 @@ interface IAppState {
view: ViewOptions;
}
class PhoneticsViewer extends React.Component<any, IAppState> {
class PhoneticsViewer extends Component<any, IAppState> {
constructor(props: any) {
super(props);
this.state = {

View File

@ -1,4 +1,3 @@
import React from "react";
import { Types as T } from "@lingdocs/pashto-inflector";
interface ILetter {

View File

@ -1,4 +1,3 @@
import React from "react";
import {
Types as T,
} from "@lingdocs/pashto-inflector";

View File

@ -1,4 +1,3 @@
import React from "react";
import { useUser } from "../user-context";
function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) {

View File

@ -1,4 +1,3 @@
import React from "react";
import GenderGame from "./sub-cores/GenderGame";
import UnisexNounGame from "./sub-cores/UnisexNounGame";

View File

@ -1,4 +1,4 @@
import React from 'react';
import { StrictMode } from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
@ -9,13 +9,13 @@ import "@fortawesome/fontawesome-free/css/all.css";
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<StrictMode>
<Router>
<UserProvider>
<App />
</UserProvider>
</Router>
</React.StrictMode>,
</StrictMode>,
document.getElementById('root')
);

View File

@ -1,4 +1,3 @@
import React from "react";
import Markdown from "markdown-to-jsx";
export default function mdps(input) {

View File

@ -6,7 +6,6 @@
*
*/
import React from 'react';
import { Link } from "react-router-dom";
import Footer from "../components/Footer";
import { content } from "../content/index";