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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,9 +6,7 @@
* *
*/ */
import React from "react"; import { Link } from "react-router-dom";
// eslint-disable-next-line
import { BrowserRouter as Router, Link } from "react-router-dom";
import { useUser } from "../user-context"; import { useUser } from "../user-context";
const hamburger = <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"> 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 buttonUnpressed from "../images/button-unpressed.png";
import buttonHalfPressed from "../images/button-half-pressed.png"; import buttonHalfPressed from "../images/button-half-pressed.png";
import buttonFullyPressed from "../images/button-fully-pressed.png"; import buttonFullyPressed from "../images/button-fully-pressed.png";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,3 @@
import React from "react";
import { useUser } from "../user-context"; import { useUser } from "../user-context";
function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) { 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 GenderGame from "./sub-cores/GenderGame";
import UnisexNounGame from "./sub-cores/UnisexNounGame"; 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 ReactDOM from 'react-dom';
import App from './App'; import App from './App';
import * as serviceWorkerRegistration from './serviceWorkerRegistration'; import * as serviceWorkerRegistration from './serviceWorkerRegistration';
@ -9,13 +9,13 @@ import "@fortawesome/fontawesome-free/css/all.css";
import reportWebVitals from './reportWebVitals'; import reportWebVitals from './reportWebVitals';
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <StrictMode>
<Router> <Router>
<UserProvider> <UserProvider>
<App /> <App />
</UserProvider> </UserProvider>
</Router> </Router>
</React.StrictMode>, </StrictMode>,
document.getElementById('root') document.getElementById('root')
); );

View File

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

View File

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