Skip to content

Commit

Permalink
Fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ryespresso committed Sep 28, 2022
1 parent 6f7bbce commit 1af9e2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 74 deletions.
58 changes: 0 additions & 58 deletions components/Home/NounishButton.tsx

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"autoprefixer": "^10.4.4",
"eslint": "^7.32.0",
"eslint-config-next": "12.1.1",
"eslint-plugin-import": "^2.26.0",
"postcss": "^8.4.12",
"tailwindcss": "^3.0.23",
"typescript": "^4.5.2"
Expand Down
19 changes: 3 additions & 16 deletions pages/notes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ import Subheader from "../components/Subheader";
import Loading from "../components/Loading";
import PageContent from "../components/Layout/PageContent";
import PageHeader from "../components/Layout/PageHeader";
import Button from "../components/common/Button";

const oniNotionTable = "e29fc3a9-2c4a-44c9-8210-f5142b751502";
const rootNotionPageId = "e29fc3a92c4a44c98210f5142b751502"; // collection

export async function getStaticProps() {
let ids = [];
Expand All @@ -40,6 +38,7 @@ export async function getStaticProps() {
return {
props: {
tableIds: ids,
mostRecentPostId: ids[0]?.id
},
};
}
Expand All @@ -48,23 +47,11 @@ function classNames(...classes) {
return classes.filter(Boolean).join(" ");
}

const Notes = ({ tableIds }) => {
const [currentPostId, setCurrentPostId] = useState(rootNotionPageId);
const Notes = ({ tableIds, mostRecentPostId }) => {
const [currentPostId, setCurrentPostId] = useState(mostRecentPostId);
const [postData, setPostData] = useState(null);
const [isLoading, setIsLoading] = useState<boolean>(false);

useEffect(() => {
tableIds &&
tableIds.map((post, idx) => {
if (idx === 0) {
setCurrentPostId(post.id);
return { ...post, current: true };
} else {
return { ...post, current: false };
}
});
}, []);

useEffect(() => {
setIsLoading(true);
const data = fetch(
Expand Down

0 comments on commit 1af9e2e

Please sign in to comment.