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

chore(edit): rename btn #1661

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions tavla/app/(admin)/edit/[id]/components/Buttons/Open.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { ExternalIcon } from '@entur/icons'
import { Tooltip } from '@entur/tooltip'
import { useLink } from 'hooks/useLink'
import Link from 'next/link'
import { usePostHog } from 'posthog-js/react'
import React from 'react'

function Open({ type, bid }: { type?: 'button' | 'icon'; bid?: string }) {
const link = useLink(bid)
const posthog = usePostHog()
if (type === 'button') {
return (
<Button
Expand All @@ -16,6 +18,7 @@ function Open({ type, bid }: { type?: 'button' | 'icon'; bid?: string }) {
aria-label="Åpne tavle"
href={link ?? '/'}
target="_blank"
onClick={() => posthog.capture('OPEN_BOARD_BTN')}
>
Åpne tavle
<ExternalIcon className="!top-[-2px]" />
Expand All @@ -30,6 +33,7 @@ function Open({ type, bid }: { type?: 'button' | 'icon'; bid?: string }) {
aria-label="Åpne tavle"
href={link ?? '/'}
target="_blank"
onClick={() => posthog.capture('OPEN_BOARD_BTN')}
>
<ExternalIcon />
</IconButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { TBoard } from 'types/settings'
import { refreshBoard } from './actions'
import { useToast } from '@entur/alert'
import { RefreshIcon } from '@entur/icons'
import { usePostHog } from 'posthog-js/react'

function RefreshButton({ board }: { board: TBoard }) {
const toast = useToast()
const posthog = usePostHog()
const refresh = async () => {
posthog.capture('PUBLISH_BOARD_BTN')
const status = await refreshBoard(board)
if (status)
toast.addToast({
Expand All @@ -24,7 +27,7 @@ function RefreshButton({ board }: { board: TBoard }) {
}
return (
<Button variant="secondary" onClick={refresh} className="flex flex-row">
Oppdater tavle
Publiser tavle
<RefreshIcon inline />
</Button>
)
Expand Down
2 changes: 1 addition & 1 deletion tavla/app/components/Expandable.tsx
SelmaBergstrand marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Expandable({
children: React.ReactNode
}) {
return (
<div className="fixed bottom-0 right-3 w-full max-w-screen-sm z-10 drop-shadow-lg ">
<div className="fixed bottom-0 right-3 w-full min-w-96 md:w-1/3 max-w-screen-sm z-10 drop-shadow-lg ">
<div
onClick={() => setIsOpen(!isOpen)}
className="flex justify-between items-center px-6 py-4 bg-blue80 w-full rounded-t"
Expand Down