-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(frontend): add toggle to remove line and page numbers from transliterations and translations #578
Conversation
Note: On a side note, I don't think it's actually correct to use the comma notation, even though I have, but instead use |
So I can either do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, not sure I'm a fan of the parameter-passing, it's very similar to prop-drilling. Perhaps a utility function and/or usage of stripEndings
directly would be a better approach? What if we wanted to add another option in the future? Would we keep extending the parameter list?
The approach otherwise is good.
It is possible to do use |
Are you proposing a different solution, or did you mean you prefer extending the list? My suggestion is to use or write something like lodash's |
I preferred extending list, but something else that can make it readable will be amazing and I think I can change it to use the |
@Harjot1Singh I think we can add |
All the customizaions will run through a function which can be expanded in future to include more transformations.
Should be good to merge now! |
Option name: Line Ending ??? |
Can you give screenshot |
Just going off the screenshots provided in PR -- was this updated/changed? |
nope |
Which one ? |
Updated screenshots |
app/frontend/src/Overlay/index.js
Outdated
@@ -23,18 +25,26 @@ const Overlay = () => { | |||
} } = globalSettings || {} | |||
|
|||
const [ line ] = useCurrentLine() | |||
const { typeId } = line || '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the || '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I was getting undefined errors so added it as a safety check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deal with this inside customiseLine
, since you presumably are doing this in multiple places
app/frontend/src/Overlay/index.js
Outdated
@@ -23,18 +25,26 @@ const Overlay = () => { | |||
} } = globalSettings || {} | |||
|
|||
const [ line ] = useCurrentLine() | |||
const { typeId } = line || '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deal with this inside customiseLine
, since you presumably are doing this in multiple places
In this situation, it's ok to do the equivalent of |
Doing |
Summary of PR
Using
stripEndings()
adds toggle that allows user to hide the line endings for translations and transliterations in the following settings tabs:Tests for unexpected behavior
stripEndings
for SirlekhUnhide Line Endings
Hide Line Endings:
Time spent on PR
6.5 hours
Linked issues
Fix #508
Reviewers
@Harjot1Singh @bhajneet
Note: Don't forget
npm install
since gurmukhi-util packages was updated.