Skip to content

Commit

Permalink
Temp lint disable.
Browse files Browse the repository at this point in the history
  • Loading branch information
vytaux committed Dec 12, 2024
1 parent e4f6481 commit b810bb9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
rules: {
"no-unused-vars": "off",
"no-console": "off",
"react-hooks/rules-of-hooks": "off",
// Add other rules you want to disable here
},
};
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/containers/AdminDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function AdminDashboard({ currentUser }) {
);
};

// eslint-disable-next-line react-hooks/exhaustive-deps
useEffect(() => refreshOwners(), []);

const approveOwner = (userId) => {
Expand Down
3 changes: 1 addition & 2 deletions src/containers/Header/Header.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { useContext } from "react";
import { Link, useNavigate } from "react-router-dom";
import { Link } from "react-router-dom";
import UserContext from "../../context/UserContext";
import hasRole from "../../util/hasRole";
import './Header.css';

const Header = () => {
const { currentUser, updateUser } = useContext(UserContext)
const navigate = useNavigate();

const logoutHandler = () => {
updateUser(null);
Expand Down
28 changes: 14 additions & 14 deletions src/containers/OwnerDashboard.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import React, {useCallback, useEffect} from "react";
import FetchService from "../service/FetchService";
import formatMoney from "../util/formatMoney";
import { Link } from "react-router-dom";
Expand All @@ -10,24 +10,24 @@ function OwnerDashboard({ currentUser }) {
const [reload, setReload] = React.useState(true);


const fetchOwnersOffers = () => {
FetchService.getOwnersOffers(currentUser.accessToken).then((response) => {
setOwnersOffersState(response.data);
});
};
const fetchOwnersOffers = useCallback(() => {
FetchService.getOwnersOffers(currentUser.accessToken).then((response) => {
setOwnersOffersState(response.data);
});
}, [currentUser.accessToken]);

const fetchOwnersProperties = () => {
FetchService.getOwnersProperties(currentUser.accessToken).then(
(response) => {
setOwnersPropertiesState(response.data);
}
);
};
const fetchOwnersProperties = useCallback(() => {
FetchService.getOwnersProperties(currentUser.accessToken).then(
(response) => {
setOwnersPropertiesState(response.data);
}
);
}, [currentUser.accessToken]);

useEffect(() => {
fetchOwnersOffers();
fetchOwnersProperties();
}, [reload]);
}, [fetchOwnersOffers, fetchOwnersProperties, reload]);

const acceptOffer = (offer) => {
if (offer.status === "STATUS_CANCELLED")
Expand Down

0 comments on commit b810bb9

Please sign in to comment.