Skip to content

Commit

Permalink
some tsc and eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saanuregh committed May 1, 2021
1 parent 911160a commit 4e3ea69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 6 additions & 2 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import { useGlobalStore } from "../lib/stores";
type HeaderProps = {
text: string;
lastUpdated: string;
float: boolean;
float?: boolean;
};

export default function Header({ text, lastUpdated, float }: HeaderProps) {
export default function Header({
text,
lastUpdated,
float = false,
}: HeaderProps) {
const [isSidebarOpen, toggleSidebar] = useGlobalStore(
(state) => [state.isSidebarOpen, state.toggleSidebar],
shallow
Expand Down
4 changes: 3 additions & 1 deletion components/Home/HomeDistrictSection.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-nocheck

import {
LegendLinear,
LegendItem,
Expand Down Expand Up @@ -133,7 +135,7 @@ export default function HomeDistrictSection({
colorScale(
districtHistories[districtHistories.length - 1].summary[
geo.properties.DISTRICT.toLowerCase()
][dataKey]
][dataKey] as number
)
}
stroke={(geo) =>
Expand Down
8 changes: 3 additions & 5 deletions pages/_error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function Error({ statusCode }) {
);
}

export async function getServerSideProps({ res, err }) {
Error.getInitialProps = ({ res, err }) => {
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
return {
props: { statusCode },
};
}
return { statusCode };
};
2 changes: 0 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { InferGetStaticPropsType } from "next";
import Head from "next/head";
import { useEffect } from "react";
import shallow from "zustand/shallow";

import Header from "../components/Header";
import HomeDistrictSection from "../components/Home/HomeDistrictSection";
Expand Down

0 comments on commit 4e3ea69

Please sign in to comment.