Skip to content

Commit

Permalink
refactor: add back in loading
Browse files Browse the repository at this point in the history
  • Loading branch information
eldu committed Jan 23, 2024
1 parent 754410a commit 575793c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 4 additions & 6 deletions src/components/ContentPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBook } from "@fortawesome/free-solid-svg-icons";
// import Spinner from "./Spinner";
import Spinner from "./Spinner";
import { PubsTable } from "./PubsTable";
// import YearChart from "./YearChart";
// import WordCloud from "./WordCloud";
Expand Down Expand Up @@ -40,11 +40,9 @@ export function ContentPage() {
<h1 className="pl-2">Publications</h1>
</div>

{/* TODO: Error Boundary */}
{/* TODO: Put back in suspense component */}
{/*<Spinner loading={this.props.loading} className="spinner" size={100} />*/}
<Spinner loading={publications.length === 0} className="spinner" size={100} />

<div id="main-content">
{publications.length !== 0 && (<div id="main-content">
<div className="PubsTable-CP">
<PubsTable publications={publications} />
</div>
Expand All @@ -59,7 +57,7 @@ export function ContentPage() {
{/* <WordCloud />*/}
{/* <YearChart />*/}
{/*</div>*/}
</div>
</div>)}
</div>
);
}
5 changes: 1 addition & 4 deletions src/components/PubsTable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ReactTable from "react-table";
import React from "react";
import "react-table/react-table.css";
import _ from "lodash";

export function PubsTable({ publications }) {
const changetoHTML = (url) => <a href={url.value}>{url.value}</a>;
Expand All @@ -13,8 +12,6 @@ export function PubsTable({ publications }) {
: false;
}

var filteredData = _.cloneDeep(publications)

const columns = [
{
Header: "Title",
Expand All @@ -41,7 +38,7 @@ export function PubsTable({ publications }) {

return (
<ReactTable
data={filteredData}
data={publications}
columns={columns}
filterable
defaultFilterMethod={(filter, row) =>
Expand Down

0 comments on commit 575793c

Please sign in to comment.