Skip to content

Commit

Permalink
Merge pull request #32 from AhmedNassar7/setup-husky
Browse files Browse the repository at this point in the history
Fixed missing props validation, line endings and applied formatting
  • Loading branch information
xeenoh authored Nov 15, 2024
2 parents 112b55c + 8bc8570 commit da8f345
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package-lock.json

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

17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@
"lint:fix": "eslint . --fix",
"preview": "vite preview",
"format-check": "prettier --check .",
"prepare": "husky install"
"prepare": "husky install",
"postinstall": "husky install",
"lint-staged": "lint-staged"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm test"
}
},
"lint-staged": {
"*.{js,jsx}": [
"eslint --fix",
"prettier --write"
]
},
"dependencies": {
"@emotion/react": "^11.13.3",
Expand All @@ -21,6 +35,7 @@
"@mui/icons-material": "^6.1.1",
"@mui/material": "^6.1.1",
"axios": "^1.7.7",
"prop-types": "^15.8.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2"
Expand Down
4 changes: 4 additions & 0 deletions src/components/navigation/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from '@emotion/styled';
import { Button } from '@mui/material';
import { Link } from 'react-router-dom';
import PropTypes from 'prop-types';

/** TODO:
* Login button
Expand Down Expand Up @@ -47,5 +48,8 @@ const Navbar = ({ isUser = false }) => {
if (!isUser) return <NonUserNavbar />;
return <UserNavbar />;
};
Navbar.propTypes = {
isUser: PropTypes.bool,
};

export default Navbar;
7 changes: 7 additions & 0 deletions src/components/settings/NavButton.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Link, useLocation } from 'react-router-dom';
import { Button } from '@mui/material';
import PropTypes from 'prop-types';

const NavButton = ({ to, children }) => {
const location = useLocation();
Expand Down Expand Up @@ -36,4 +37,10 @@ const NavButton = ({ to, children }) => {
</>
);
};

NavButton.propTypes = {
to: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
};

export default NavButton;

0 comments on commit da8f345

Please sign in to comment.