diff --git a/tasks/components/FeedbackButton.tsx b/tasks/components/FeedbackButton.tsx new file mode 100644 index 000000000..6ef4eeca7 --- /dev/null +++ b/tasks/components/FeedbackButton.tsx @@ -0,0 +1,28 @@ +import { Button } from '@helpwave/common/components/Button' +import { PropsWithLanguage, useTranslation } from '@helpwave/common/hooks/useTranslation'; +import { Languages } from '@helpwave/common/hooks/useLanguage'; + +type FeedbackButtonTranslation = { + text: string +} + +const defaultFeedbackButtonTranslation: Record = { + en: { + text: 'Issue or Feedback?' + }, + de: { + text: 'Fehler oder Feedback?' + } +} + +export const FeedbackButton = ({ language }: PropsWithLanguage) => { + const translation = useTranslation(language, defaultFeedbackButtonTranslation) + + const onClick = () => window.open('https://share-eu1.hsforms.com/1Libxb_ANSm-CpMCQ37Ti6Qfsrtd', '_blank') + + return ( + + ) +} diff --git a/tasks/components/layout/PageWithHeader.tsx b/tasks/components/layout/PageWithHeader.tsx index 702cc180f..feee75ce8 100644 --- a/tasks/components/layout/PageWithHeader.tsx +++ b/tasks/components/layout/PageWithHeader.tsx @@ -6,6 +6,7 @@ import { UserMenu } from '../UserMenu' import type { Crumb } from '../BreadCrumb' import { BreadCrumb } from '../BreadCrumb' import { useAuth } from '../../hooks/useAuth' +import { FeedbackButton } from '../FeedbackButton'; type PageWithHeaderProps = Partial & { crumbs?: Crumb[] @@ -28,6 +29,7 @@ export const PageWithHeader = ({ if (!user) return null + const feedbackButton = const userMenu = return ( @@ -36,7 +38,7 @@ export const PageWithHeader = ({ title={title} withIcon={withIcon} leftSide={[(crumbs ? : undefined), ...(leftSide ?? [])]} - rightSide={[...(rightSide ?? []), userMenu]} + rightSide={[...(rightSide ?? []), feedbackButton, userMenu]} /> {children}