Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(support): add support email buttons #1534

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions next-tavla/app/(admin)/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
'use client'
import Image from 'next/image'
import TavlaLogo from 'assets/logos/Tavla-white.svg'
import { Heading3, Link as EnturLink, Paragraph } from '@entur/typography'
import Link from 'next/link'
import { ExternalIcon, GithubIcon } from '@entur/icons'
import { usePostHog } from 'posthog-js/react'

function Footer() {
const posthog = usePostHog()
return (
<footer className="eds-contrast">
<div className="container mx-auto pt-16 pb-4">
Expand All @@ -22,9 +25,26 @@ function Footer() {
<br />
917 422 575
</Paragraph>
<Paragraph className="mb-4 items-center flex flex-row gap-1">
<Paragraph
className="mb-4 items-center flex flex-row gap-1"
margin="none"
>
<EnturLink href="https://www.entur.org/kontakt-oss/">
Kontakt oss
Kontakt kundesenteret
</EnturLink>
<ExternalIcon className="!top-0" />
</Paragraph>
<Paragraph className="mb-4 items-center flex flex-row gap-1">
lindtvedtsebastian marked this conversation as resolved.
Show resolved Hide resolved
<EnturLink
href="mailto:[email protected]"
target="_blank"
onClick={() =>
posthog.capture('SUPPORT_EMAIL', {
type: 'footer',
})
}
>
Kontakt Tavla
</EnturLink>
<ExternalIcon className="!top-0" />
</Paragraph>
Expand Down
23 changes: 23 additions & 0 deletions next-tavla/app/components/FloatingContact.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client'
import { EmailIcon } from '@entur/icons'
import Link from 'next/link'
import { usePostHog } from 'posthog-js/react'

function FloatingContact() {
const posthog = usePostHog()
return (
<div className="fixed bottom-12 right-12">
<Link
onClick={() =>
posthog.capture('SUPPORT_EMAIL', { type: 'floating' })
}
href="mailto:[email protected]"
target="_blank"
className="flex items-center justify-center w-14 h-14 rounded-full border-primary border-2 bg-primary hover:bg-secondary"
>
<EmailIcon size={20} />
</Link>
</div>
)
}
export { FloatingContact }
4 changes: 4 additions & 0 deletions next-tavla/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { ReactNode } from 'react'
import { Metadata } from 'next'
import dynamic from 'next/dynamic'
import { EnturToastProvider, PHProvider } from './providers'
import { Footer } from './(admin)/components/Footer'
import { FloatingContact } from './components/FloatingContact'

export const metadata: Metadata = {
title: 'Entur Tavla',
Expand Down Expand Up @@ -44,6 +46,8 @@ function RootLayout({ children }: { children: ReactNode }) {
<body>
<PostHogPageView />
{children}
<FloatingContact />
<Footer />
</body>
</EnturToastProvider>
</PHProvider>
Expand Down
3 changes: 0 additions & 3 deletions next-tavla/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
LeadParagraph,
Paragraph,
} from '@entur/typography'
import { Footer } from './(admin)/components/Footer'
import { Preview } from './(admin)/components/Preview'
import { previewBoards } from '../src/Shared/utils/previewBoards'
import { Welcome } from './components/Welcome'
Expand Down Expand Up @@ -89,8 +88,6 @@ async function Landing() {
</div>
</div>
</main>

<Footer />
</>
)
}
Expand Down