Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Theme.js Code Duplication [Refactoring] #134

Open
shravan20 opened this issue Apr 30, 2021 · 3 comments · May be fixed by #223
Open

Remove Theme.js Code Duplication [Refactoring] #134

shravan20 opened this issue Apr 30, 2021 · 3 comments · May be fixed by #223
Labels
duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers hacktoberfest hacktoberfest-accepted help wanted Extra attention is needed Little work This task takes little time to complete. (ETA couple of days) refactoring The changes in code without affecting functionality to improve the code

Comments

@shravan20
Copy link
Owner

Is your feature request related to a problem? Please describe.
Constant Values stored as JSON values are duplicated across the frontend and backend version.

Describe the solution you'd like
Remove the duplicated version inside the /frontend/src/util/themes/index.js file and use the existing backend-version file

@shravan20 shravan20 added duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers Little work This task takes little time to complete. (ETA couple of days) refactoring The changes in code without affecting functionality to improve the code labels Apr 30, 2021
@shravan20 shravan20 added this to the Release of V2.0 milestone Apr 30, 2021
@toshihidetagami
Copy link

Hi, I removed /frontend/src/util/themes/index.js and tried to import backend version, but encountered this error.

./src/components/organisms/TemplateCard/index.js
Module not found: You attempted to import ../../../../../src/themes/themes which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

This is because Create React App does not allow frontend code to import outside /src directory.
Links below have some workaround. (the simplest one should be to delete backend const file and backend code imports frontend const file instead). Do you have any solution in your mind?

Reference
https://stackoverflow.com/questions/44114436/the-create-react-app-imports-restriction-outside-of-src-directory
https://stackoverflow.com/questions/59571680/react-backend-project-structure-when-sharing-code

@shravan20
Copy link
Owner Author

Hi, we can import the themes into theme.js and export it again from the same file.

@sanchit36
Copy link

looking for my first contribution in open source, can anyone guide me where to start with the issue. i would love to work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers hacktoberfest hacktoberfest-accepted help wanted Extra attention is needed Little work This task takes little time to complete. (ETA couple of days) refactoring The changes in code without affecting functionality to improve the code
Projects
Github Readme Quote
Awaiting triage
Development

Successfully merging a pull request may close this issue.

3 participants