File tree Expand file tree Collapse file tree 4 files changed +22
-19
lines changed
tavla/app/(admin)/edit/[id] Expand file tree Collapse file tree 4 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 2
2
import { OverflowMenu } from '@entur/menu'
3
3
import { TBoard , TOrganizationID } from 'types/settings'
4
4
import { DuplicateBoard } from '../DuplicateBoard'
5
- import { Delete } from 'app/(admin)/boards/components/Column/Delete'
6
5
7
6
function ActionsMenu ( { board, oid } : { board : TBoard ; oid ?: TOrganizationID } ) {
8
7
return (
@@ -22,9 +21,8 @@ function OverflowActionsMenu({
22
21
} ) {
23
22
return (
24
23
< div className = "hidden md:flex" >
25
- < OverflowMenu position = " left">
24
+ < OverflowMenu placement = "bottom- left">
26
25
< DuplicateBoard board = { board } oid = { oid } />
27
- < Delete board = { board } type = "action" />
28
26
</ OverflowMenu >
29
27
</ div >
30
28
)
@@ -34,7 +32,6 @@ function ButtonsMenu({ board, oid }: { board: TBoard; oid?: TOrganizationID }) {
34
32
return (
35
33
< div className = "flex flex-col md:flex-row md:items-center gap-4 md:hidden" >
36
34
< DuplicateBoard board = { board } oid = { oid } type = "button" />
37
- < Delete board = { board } type = "button" />
38
35
</ div >
39
36
)
40
37
}
Original file line number Diff line number Diff line change 1
1
'use client'
2
- import { useToast } from '@entur/alert'
3
- import { Button , IconButton } from '@entur/button'
2
+ import { CopyableText , useToast } from '@entur/alert'
3
+ import { IconButton } from '@entur/button'
4
4
import { CopyIcon } from '@entur/icons'
5
5
import { Tooltip } from '@entur/tooltip'
6
6
import { useLink } from 'hooks/useLink'
@@ -10,20 +10,22 @@ function Copy({ type, bid }: { type?: 'button' | 'icon'; bid?: string }) {
10
10
const link = useLink ( bid )
11
11
const copy = ( ) => {
12
12
navigator . clipboard . writeText ( link ?? '' )
13
- addToast ( 'Lenke til Tavla kopiert' )
13
+ addToast ( 'Lenken til tavlen ble kopiert! ' )
14
14
}
15
15
16
16
if ( type === 'button' ) {
17
- return (
18
- < Button
19
- variant = "secondary"
20
- aria-label = "Kopier lenken til tavlen"
21
- onClick = { copy }
22
- >
23
- Kopier lenke
24
- < CopyIcon className = "!top-[-1px]" />
25
- </ Button >
26
- )
17
+ if ( link ) {
18
+ return (
19
+ < CopyableText
20
+ successHeading = ""
21
+ successMessage = "Lenken til tavlen ble kopiert!"
22
+ aria-label = "Kopier lenken til tavlen"
23
+ >
24
+ { link . toString ( ) }
25
+ </ CopyableText >
26
+ )
27
+ }
28
+ return
27
29
}
28
30
return (
29
31
< Tooltip
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ function DuplicateBoard({
37
37
aria-label = "Dupliser tavle"
38
38
onClick = { handleSelect }
39
39
>
40
- Dupliser Tavle
40
+ Dupliser tavle
41
41
< AddIcon />
42
42
</ Button >
43
43
)
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { ThemeSelect } from './components/ThemeSelect'
20
20
import { TileList } from './components/TileList'
21
21
import { getBoard } from 'Board/scenarios/Board/firebase'
22
22
import { getUserFromSessionCookie } from 'app/(admin)/utils/server'
23
+ import { Delete } from 'app/(admin)/boards/components/Column/Delete'
23
24
24
25
export type TProps = {
25
26
params : Promise < { id : TBoardID } >
@@ -60,10 +61,13 @@ export default async function EditPage(props: TProps) {
60
61
< div className = "flex flex-col md:flex-row md:items-center gap-4" >
61
62
< Open bid = { board . id } type = "button" />
62
63
< RefreshButton board = { board } />
63
- < Copy bid = { board . id } type = "button" />
64
+ < Delete board = { board } type = "button" />
64
65
< ActionsMenu board = { board } oid = { organization ?. id } />
65
66
</ div >
66
67
</ div >
68
+ < div className = "md:w-fit" >
69
+ < Copy bid = { board . id } type = "button" />
70
+ </ div >
67
71
68
72
< div className = "bg-background rounded-md py-8 px-6 flex flex-col gap-4" >
69
73
< Heading2 > Stoppesteder</ Heading2 >
You can’t perform that action at this time.
0 commit comments