-
Notifications
You must be signed in to change notification settings - Fork 3.4k
change font size for code block in H1 #30876
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
change font size for code block in H1 #30876
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
|
Please update the test steps to the following:
|
src/components/HTMLEngineProvider/HTMLRenderers/CodeRenderer.js
Outdated
Show resolved
Hide resolved
|
Please run |
|
Please update the tests and the qa tests as mentioned above. Also please complete the screenshots for the rest of the platforms |
Reviewer Checklist
Screenshots/Videos |
|
@yakupafsin Thank you! PS: Next time please tag me after making such changes because there is no notification for those actions (change title, change description, etc.) |
|
@s77rt sorry, I've totally forgotten about it. Thank you for your time. And sorry for the hassle :). It was my first PR with Expensify. I'll try to do it more professionally next time. |
|
@yakupafsin I will not be able to merge this PR since it contains unsigned commits. Please retroactively sign all the commits for this PR so that I can merge it |
|
You've also got lint errors it seems |
|
@roryabraham because last 2 commits are co-authered woth @s77rt I guess that's why it looks unsigned. We need to undo that 2 commit and re-commit them. |
aa882a4 to
da842ee
Compare
|
@roryabraham I've removed that 2 commits and pushed 2 new commits. I guess all will be signed now. |
|
@roryabraham I've double-checked but couldn't find any lint errors. |
Mentioned that fontSize controlled by getCodeFontSize function in `StyleUtils.js` Signed-off-by: Yakup Afsin <[email protected]>
Signed-off-by: Yakup Afsin <[email protected]>
Signed-off-by: Yakup Afsin <[email protected]>
7abef85 to
2f4fe78
Compare
|
Hi @roryabraham, I've signed all the commits. Because I've changed my device I forgot change my gitconfig file. Sorry about that. But I've signed them now. |
|
@yakupafsin looks like we've got some lint errors here: https://github.com/Expensify/App/actions/runs/6792085078/job/18467959217?pr=30876 Also, NAB but if you don't mind I think we could generalize /**
* Check if there is an ancestor node for which the predicate returns true.
*
* @param {TNode} tnode
* @param {Function} predicate
* @returns {Boolean}
*/
function isChildOfNode(tnode, predicate) {
let currentNode = tnode.parent;
while (currentNode) {
if (predicate(currentNode)) {
return true;
}
currentNode = currentNode.parent;
}
return false;
}
/**
* Check if node is a child of a comment tag.
*
* @param {TNode} tnode
* @returns {Boolean}
*/
function isChildOfComment(tnode) {
return isChildOfNode(tnode, (node) => isCommentTag(node.domNode.name));
}
/**
* Check if node is a child of an h1 tag.
*
* @param {TNode} tnode
* @returns {Boolean}
*/
function isChildOfH1(tnode) {
return isChildOfNode(tnode, (node) => node.domNode.name.toLowerCase() === 'h1');
} |
|
@roryabraham I was planning to do something like this, but I decided not to touch someone else's code 😅. But yes, that looks better. Let me change it. |
|
Hi @roryabraham, I've found the lint error. And also applied the changes on htmlEngineUtils.js |
|
@yakupafsin please run |
|
@roryabraham now it's ready to merge I guess :) |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.98-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.98-5 🚀
|






@s77rt
Details
Created a new function to check if there is an ancestor node with the name 'h1' and applied on CodeRenderer.js to change code block font-size if it is inside h1 tag.
Fixed Issues
$ #30203
PROPOSAL: #30203 (comment)
Tests
Helloand observe its font sizeHelloOffline tests
Not connectivity related.
QA Steps
Helloand observe its font sizeHelloPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
3dcfd030-8871-4fd6-871e-f5170f9a26a4.mp4
MacOS: Desktop