Cleanup imports and unused variables
parent
7cc8f0cc57
commit
bce0c8598a
21
src/App.js
21
src/App.js
|
@ -1,19 +1,17 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import axios from "axios";
|
||||
import Fuse from "fuse.js";
|
||||
import { useCookies } from "react-cookie";
|
||||
import queryString from "query-string";
|
||||
|
||||
import LangFilters from "./components/LangFilters";
|
||||
import SearchBar from "./components/SearchBar";
|
||||
import SearchResult from "./components/SearchResult";
|
||||
import axios from "axios";
|
||||
import Fuse from "fuse.js";
|
||||
import { ThemeContext, themes, swapMode } from "./darkMode";
|
||||
import { useCookies } from "react-cookie";
|
||||
|
||||
import Default from "./components/Default";
|
||||
import MarkdownParser from "./components/MarkdownParser";
|
||||
|
||||
import SunImg from "./img/sun.png";
|
||||
import MoonImg from "./img/moon.png";
|
||||
import MarkdownParser from "./components/MarkdownParser";
|
||||
const queryString = require("query-string");
|
||||
|
||||
import { ThemeContext, themes, swapMode } from "./darkMode";
|
||||
|
||||
function jsonToArray(json) {
|
||||
// list of all books
|
||||
|
@ -71,10 +69,7 @@ function App() {
|
|||
const [searchParams, setSearchParams] = useState({ searchTerm: defaultSearch, "lang.code": "" });
|
||||
// array of all search results
|
||||
const [searchResults, setSearchResults] = useState([]);
|
||||
// array of the topics the search results fall under
|
||||
const [sectionResults, setSectionResults] = useState([]);
|
||||
// eslint-disable-next-line
|
||||
const [cookies, setCookie, removeCookie] = useCookies(["lightMode"]);
|
||||
const [cookies, setCookie, ] = useCookies(["lightMode"]);
|
||||
const [queries, setQueries] = useState({ lang: "", subject: "" });
|
||||
|
||||
// eslint-disable-next-line
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { useState, useEffect } from "react";
|
||||
const queryString = require("query-string");
|
||||
import queryString from "query-string";
|
||||
|
||||
function LangFilters({ changeParameter, data, langCode }) {
|
||||
const [languages, setLanguages] = useState([]);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import axios from "axios";
|
||||
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import rehypeSlug from "rehype-slug";
|
||||
import rehypeRaw from "rehype-raw";
|
||||
|
||||
import ParsedLink from "./ParsedLink";
|
||||
|
||||
function MarkdownParser({ file, sect }) {
|
||||
|
@ -58,7 +60,7 @@ function MarkdownParser({ file, sect }) {
|
|||
</a>
|
||||
);
|
||||
}
|
||||
return <ParsedLink node={node} children={children} className={className} sect={sect} props={props} />;
|
||||
return <ParsedLink children={children} className={className} sect={sect} props={props} />;
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
|
||||
function ParsedLink({ node, children, className, sect, props }) {
|
||||
function ParsedLink({ children, sect, props }) {
|
||||
const [folder, setFolder] = useState(null);
|
||||
const [file, setFile] = useState(null);
|
||||
|
||||
|
@ -9,7 +9,7 @@ function ParsedLink({ node, children, className, sect, props }) {
|
|||
// If there is only one entry then the folder is the root directory and the entry is the file
|
||||
let hrefSplit = props.href.split("/");
|
||||
|
||||
if (hrefSplit.length == 2) {
|
||||
if (hrefSplit.length === 2) {
|
||||
// Case when the
|
||||
// Some docs reference back to the root directory which would give the folder ".."
|
||||
// When that happens, skip setting the folder as it should stay null.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import React, {useEffect} from "react";
|
||||
const queryString = require("query-string");
|
||||
|
||||
function SearchBar(props) {
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Reference in New Issue