Skip to content

Commit

Permalink
Bugfix 7562 / rtl helps fix (#381)
Browse files Browse the repository at this point in the history
* fix helps for rtl

* bump version

---------

Co-authored-by: PhotoNomad0 <[email protected]>
  • Loading branch information
PhotoNomad0 and PhotoNomad0 authored Mar 19, 2024
1 parent fb4c50c commit b8360c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tc-ui-toolkit",
"version": "6.2.8",
"version": "6.2.9",
"description": "React components used to develop tools for the desktop app translationCore",
"main": "lib/index.js",
"display": "library",
Expand Down
10 changes: 9 additions & 1 deletion src/TranslationHelps/ExpandedHelpsModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ const ExpandedHelpsModal = ({
article,
classes,
translate,
direction,
}) => (
<Dialog
classes={{ paper: classes.paper }}
dir={direction}
open={show}
onClose={onHide}
maxWidth='md'
Expand All @@ -59,7 +61,10 @@ const ExpandedHelpsModal = ({
<Glyphicon glyph="remove" />
</IconButton>
</Toolbar>
<DialogContent className="dialog-content">
<DialogContent
className="dialog-content"
dir={direction}
>
<div dangerouslySetInnerHTML={{ __html: marked(article) }} />
</DialogContent>
<DialogActions disableSpacing className="dialog-actions">
Expand All @@ -78,6 +83,9 @@ ExpandedHelpsModal.propTypes = {
article: PropTypes.string.isRequired,
classes: PropTypes.object.isRequired,
translate: PropTypes.func.isRequired,
direction: PropTypes.oneOf(['ltr', 'rtl']),
};

ExpandedHelpsModal.defaultProps = { direction: 'ltr' };

export default withStyles(styles)(ExpandedHelpsModal);
11 changes: 8 additions & 3 deletions src/TranslationHelps/TranslationHelps.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ const TranslationHelps = ({
isShowHelpsExpanded, // is the expanded Translation Helps modal displayed?
modalTitle, // Title for the expanded helps modal
translate,
direction, // language direction
}) => {
if (isShowHelpsSidebar) {
return (
<div className="helps-sash-container">
<div className="helps-sash-container" style={{ direction }}>
<div className="helps-sash-closed" onClick={sidebarToggle}>
<Glyphicon
glyph="chevron-right"
Expand All @@ -53,12 +54,14 @@ const TranslationHelps = ({
show={isShowHelpsExpanded}
onHide={openExpandedHelpsModal}
title={modalTitle}
article={modalArticle || article} />
article={modalArticle || article}
direction={direction}
/>
</div>
);
} else {
return (
<div className="helps-sash-closed" onClick={sidebarToggle}>
<div className="helps-sash-closed" style={{ direction }} onClick={sidebarToggle}>
<Glyphicon
glyph="chevron-left"
style={{ cursor: 'pointer' }}
Expand All @@ -78,12 +81,14 @@ TranslationHelps.propTypes = {
sidebarToggle: PropTypes.func.isRequired,
isShowHelpsExpanded: PropTypes.bool.isRequired,
translate: PropTypes.func.isRequired,
direction: PropTypes.oneOf(['ltr', 'rtl']),
};

TranslationHelps.defaultProps = {
modalTitle: 'translationHelps',
article: '',
modalArticle: '',
direction: 'ltr',
};

export default TranslationHelps;

0 comments on commit b8360c9

Please sign in to comment.