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

Minor Refactor: Move tab names into a common js file #1923

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

yadvirkaur
Copy link
Collaborator

#1802

This solution is for the task: "File: MiscHeader.jsx line: 36 we are passing a static string to setTab. Instead, there should be a common js file in constants folder which should have all these tab names and replace that variable in all the files that are using this static string. Not limited to the mentioned line number and file."

Solution: Move all tab names to a new constants file in the constants folder and replace all static string references to tab names across the application with these constants.

@yadvirkaur
Copy link
Collaborator Author

I did this for only the History, Favourites and Others tabs, kindly review the solution, if I am in the right direction this needs to be done for other tabs too such as : Shabads, Search, Announcements and Dhan-Guru. SImilar thing can be done for overlay screens too. Guide me here.

@Gauravjeetsingh
Copy link
Collaborator

@yadvirkaur as we discussed this in call, can we instead use the en.json file for constants, instead of a separate file here.

@yadvirkaur
Copy link
Collaborator Author

I began with en.json but realised these strings are not user-facing, but are being used for internal logic in code. Using en.json might introduce risks of translation affecting the application's logic. How should we proceed?

@Gauravjeetsingh
Copy link
Collaborator

Let me think a little on this one, I will get back to you on this in a day or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants