sttm-desktop icon indicating copy to clipboard operation
sttm-desktop copied to clipboard

Minor Refactor: Move tab names into a common js file

Open yadvirkaur opened this issue 1 year ago • 4 comments

#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 avatar Apr 15 '24 14:04 yadvirkaur

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.

yadvirkaur avatar Apr 15 '24 15:04 yadvirkaur

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

Gauravjeetsingh avatar Apr 15 '24 17:04 Gauravjeetsingh

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?

yadvirkaur avatar Apr 16 '24 06:04 yadvirkaur

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

Gauravjeetsingh avatar Apr 17 '24 22:04 Gauravjeetsingh

Closing this out, we can have another look here in next possible refactor sprint.

Gauravjeetsingh avatar Apr 23 '25 06:04 Gauravjeetsingh