fossology / FOSSologyUI

Repository to hold the new UI framework for FOSSology built with React
https://fossology.github.io/FOSSologyUI/
GNU General Public License v2.0
49 stars 88 forks source link

refactor (Components) : Refactored Components #179

Open Raunakk02 opened 2 years ago

Raunakk02 commented 2 years ago

Description

Refactored the files inside src/components folder

Changes

Implemented the changes as proposed in this comment of issue #108

How to test

Since the changes are just related to refactoring, simple testing of the UI components should be sufficient.

fixes #108

sjha2048 commented 2 years ago

Hi @Raunakk02 , can you please squash your commits and follow the commit message guidelines.

Raunakk02 commented 2 years ago

Hi @sjha2048, thanks for reviewing the PR. As suggested by you, I have squashed and updated the commits as per the commit message guidelines. Please let me know if any other change is needed.

GMishx commented 2 years ago

When I login, I see following error:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
getLocalStorage
src/shared/storageHelper.js:59

  56 | // Get from localstorage
  57 | export const getLocalStorage = (key) => {
  58 |   if (typeof window !== "undefined") {
> 59 |     return JSON.parse(localStorage.getItem(key));
  60 |   }
  61 |   return null;
  62 | };

UserInfoDropdown
src/components/Header/Dropdowns/UserInfoDropdown.jsx:43

  40 | import { getNameInitials } from "shared/helper";
  41 | 
  42 | const UserInfoDropdown = () => {
> 43 |   const [currentGroup, setCurrentGroup] = useState(
  44 |     getLocalStorage("currentGroup") || getLocalStorage("user")?.default_group
  45 |   );
  46 |   const history = useHistory();
Raunakk02 commented 2 years ago

@GMishx please have a look at this PR created by @krishna9304. He has fixed the issue. It was out of the scope of this particular PR and some other contributors (including me) was facing it too.

github-actions[bot] commented 2 years ago

This pull request has conflicts, please rebase to resolve those before we can evaluate the pull request.