Fix (some) warnings and errors

I always forget to `npm run build` before pushing a PR
This commit is contained in:
Justin Edmund 2022-02-28 01:09:43 -08:00
parent 65d46f8f96
commit ad1472dfbb
5 changed files with 9 additions and 6 deletions

View file

@ -22,7 +22,7 @@ interface Props {
createdAt: Date
displayUser?: boolean | false
onClick: (shortcode: string) => void
onSave: (partyId: string, favorited: boolean) => void
onSave?: (partyId: string, favorited: boolean) => void
}
const GridRep = (props: Props) => {
@ -75,7 +75,8 @@ const GridRep = (props: Props) => {
}
function sendSaveData() {
props.onSave(props.id, props.favorited)
if (props.onSave)
props.onSave(props.id, props.favorited)
}
const userImage = () => {

View file

@ -45,7 +45,7 @@ const RaidDropdown = React.forwardRef<HTMLSelectElement, Props>(function useFiel
useEffect(() => {
fetchRaids()
}, [])
}, [fetchRaids])
function fetchRaids() {
api.endpoints.raids.getAll(headers)

View file

@ -72,11 +72,13 @@ const ProfileRoute: React.FC = () => {
{
parties.map((party, i) => {
return <GridRep
id={party.id}
shortcode={party.shortcode}
name={party.name}
createdAt={new Date(party.created_at)}
raid={party.raid}
grid={party.weapons}
favorited={party.favorited}
key={`party-${i}`}
onClick={goTo}
/>

View file

@ -26,7 +26,7 @@ const SavedRoute: React.FC = () => {
useEffect(() => {
console.log(`Fetching favorite teams...`)
fetchTeams()
}, [])
}, [fetchTeams])
useEffect(() => {
window.addEventListener("scroll", handleScroll)
@ -145,7 +145,7 @@ const SavedRoute: React.FC = () => {
function renderNoGrids() {
return (
<div id="NotFound">
<h2>You haven't saved any teams yet</h2>
<h2>You haven&apos;t saved any teams yet</h2>
</div>
)
}

View file

@ -26,7 +26,7 @@ const TeamsRoute: React.FC = () => {
useEffect(() => {
console.log(`Fetching teams...`)
fetchTeams()
}, [])
}, [fetchTeams])
useEffect(() => {
window.addEventListener("scroll", handleScroll)