Skip to content

Commit

Permalink
feat(localized-urls): set url localized for buttons go-to-bug-form an…
Browse files Browse the repository at this point in the history
…d go-to-support-center
  • Loading branch information
Gianpaolo Sinatra committed Jul 20, 2023
1 parent 8d9f564 commit af4fe72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/pages/Manual/components/ManualHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BrandLogo } from 'src/common/components/navigation/header/brandLogo';
import { appTheme } from 'src/app/theme';
import { Button } from '@appquality/unguess-design-system';
import { useTranslation } from 'react-i18next';
import i18n from 'src/i18n';

const ManualHeaderWrapper = styled.div`
background-color: ${({ theme }) => theme.palette.white};
Expand Down Expand Up @@ -32,12 +33,14 @@ const ManualHeader = ({ manual }: ManualHeaderProps) => {
<BrandLogo size="full" />
{manual?.campaignId && manual?.token && (
<Button
onClick={() =>
onClick={() => {
window.open(
`/campaigns/${manual.campaignId}/bugform/?token=${manual.token}`,
`${i18n.language === 'it' ? '/it' : ''}/campaigns/${
manual.campaignId
}/bugform/?token=${manual.token}`,
'_blank'
)
}
);
}}
isPrimary
isAccent
>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Manual/components/RightModalHelp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export const RightModalHelp = ({ campaignId }: { campaignId: string }) => {
});

const goToSupportCenter = () =>
window.open('https://docs.unguess.io', '_blank');
window.open(
`https://docs.unguess.io${i18n.language === 'it' ? '/it' : ''}`,
'_blank'
);

const manual = extractStrapiData(data);
let links;
Expand Down

0 comments on commit af4fe72

Please sign in to comment.