Skip to content

Commit

Permalink
add dir attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
kb019 committed Sep 17, 2024
1 parent d1f9f4b commit 8279be9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface WardMetricProps {
}
const WardMetric: React.FC<WardMetricProps> = ({ metricName, metricValue, isLoading }) => {
const { i18n } = useTranslation();
const dir=i18n.dir?i18n.dir():"ltr";
const dir=i18n.dir();
const field1=dir=="ltr"?metricName:metricValue;
const field2=dir=="ltr"?metricValue:metricName;
return (
Expand Down
4 changes: 3 additions & 1 deletion react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ useMock.t = (key, defaultValue, options = {}) => {

return translatedString ?? key;
};
useMock.i18n = {};
useMock.i18n = {
dir:()=>"ltr"
};

module.exports = {
// this mock makes sure any components using the translate HoC receive the t function as a prop
Expand Down

0 comments on commit 8279be9

Please sign in to comment.