Skip to content

Commit

Permalink
yauheni/79513/no language redirection from derivapp (binary-com#6824)
Browse files Browse the repository at this point in the history
* yauheni/79513/no language redirection from derivapp

* functions call refactor

Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”>
  • Loading branch information
2 people authored and adrienne-deriv committed Nov 17, 2022
1 parent 5aa04a4 commit 08ef4d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/components/src/components/static-url/static-url.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import React from 'react';
import { getStaticUrl, PlatformContext } from '@deriv/shared';
import { getStaticUrl, PlatformContext, setUrlLanguage } from '@deriv/shared';
import { getLanguage } from '@deriv/translations';

const StaticUrl = ({ href, is_document, children, ...props }) => {
const { is_appstore } = React.useContext(PlatformContext);
const getHref = () => {
setUrlLanguage(getLanguage());
return getStaticUrl(href, { is_appstore }, is_document);
};

return (
<a href={getStaticUrl(href, { is_appstore }, is_document)} rel='noopener noreferrer' target='_blank' {...props}>
<a href={getHref()} rel='noopener noreferrer' target='_blank' {...props}>
{children}
</a>
);
Expand Down

0 comments on commit 08ef4d2

Please sign in to comment.