Skip to content

Commit

Permalink
Update frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
avgupta456 committed Nov 13, 2023
1 parent 2ce817a commit 1fe69ab
Show file tree
Hide file tree
Showing 5 changed files with 3,319 additions and 2,441 deletions.
1 change: 1 addition & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
'import/prefer-default-export': 'off',
'react/function-component-definition': 'off',
'react/no-unstable-nested-components': 'off',
'jsx-a11y/control-has-associated-label': 'off',
'no-console': 'off',
radix: 'off',
'prettier/prettier': [
Expand Down
60 changes: 30 additions & 30 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,48 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/runtime": "^7.19.0",
"@nivo/bar": "^0.80.0",
"@nivo/calendar": "^0.80.0",
"@nivo/core": "^0.80.0",
"@nivo/pie": "^0.80.0",
"@nivo/radar": "^0.80.0",
"@nivo/swarmplot": "^0.80.0",
"@nivo/tooltip": "^0.80.0",
"axios": "^0.27.2",
"daisyui": "^2.31.0",
"@babel/runtime": "^7.23.2",
"@nivo/bar": "^0.83.0",
"@nivo/calendar": "^0.83.0",
"@nivo/core": "^0.83.0",
"@nivo/pie": "^0.83.0",
"@nivo/radar": "^0.83.0",
"@nivo/swarmplot": "^0.83.0",
"@nivo/tooltip": "^0.83.0",
"axios": "^1.6.1",
"daisyui": "2.31.0",
"downloadjs": "^1.4.7",
"html-to-image": "^1.10.8",
"html-to-image": "^1.11.11",
"moment": "^2.29.4",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-loading-skeleton": "^3.1.0",
"react-redux": "^8.0.4",
"react-router-dom": "^6.4.1",
"react-icons": "^4.11.0",
"react-loading-skeleton": "^3.3.1",
"react-redux": "^8.1.3",
"react-router-dom": "^6.18.0",
"react-scripts": "^5.0.1",
"react-spinners": "^0.13.4",
"react-toastify": "^9.0.0",
"react-spinners": "^0.13.8",
"react-toastify": "^9.1.3",
"react-typist": "^2.0.5",
"react-typist-loop": "0.0.5",
"redux": "^4.2.0",
"redux": "^4.2.1",
"save-svg-as-png": "^1.4.17",
"uuid": "^9.0.0"
"uuid": "^9.0.1"
},
"devDependencies": {
"autoprefixer": "^10.4.12",
"eslint": "8.24.0",
"autoprefixer": "^10.4.16",
"eslint": "8.53.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.31.8",
"eslint-plugin-react-hooks": "4.3.0",
"postcss": "^8.4.17",
"prettier": "^2.7.1",
"tailwindcss": "^3.1.8"
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"tailwindcss": "^3.3.5"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function App() {
<div className="bg-gray-100 border-t border-gray-300">
<div className="container mx-auto py-4 px-5">
<p className="text-gray-500 text-sm text-center">
© 2022 GitHub Trends
© 2023 GitHub Trends
</p>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/pages/Wrapped/Wrapped.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { classnames } from '../../utils';
const WrappedScreen = () => {
// eslint-disable-next-line prefer-const
let { userId, year } = useParams();
year = year || '2022';
year = year || '2023';

const currUserId = useSelector((state) => state.user.userId);
const usePrivate = useSelector((state) => state.user.privateAccess);
Expand All @@ -55,9 +55,13 @@ const WrappedScreen = () => {

useEffect(() => {
async function getData() {
if (userId?.length > 0 && year > 2010 && year <= 2022) {
if (userId?.length > 0 && year > 2010 && year <= 2023) {
const output = await getWrapped(userId, year);
if (output !== null && output !== undefined && output !== {}) {
if (
output !== null &&
output !== undefined &&
Object.keys(output).length > 0
) {
setData(output);
setIsLoading(false);
}
Expand Down
Loading

0 comments on commit 1fe69ab

Please sign in to comment.