Skip to content

Commit 7d580ad

Browse files
authored
fix(RouteActions): wrap route ID when no space (#195)
1 parent 6a2485c commit 7d580ad

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/components/RouteActions.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { createSignal, Show, type VoidComponent, createEffect, createResource } from 'solid-js'
2-
import Icon from '~/components/material/Icon'
2+
import clsx from 'clsx'
3+
34
import { setRoutePublic, setRoutePreserved, getRoute, getPreservedRoutes } from '~/api/route'
5+
import Icon from '~/components/material/Icon'
46

57
interface RouteActionsProps {
68
routeName: string
@@ -75,7 +77,7 @@ const RouteActions: VoidComponent<RouteActionsProps> = (props) => {
7577
} else {
7678
const currentValue = isPreserved()
7779
if (currentValue === undefined) return
78-
80+
7981
try {
8082
const newValue = !currentValue
8183
await setRoutePreserved(props.routeName, newValue)
@@ -110,11 +112,14 @@ const RouteActions: VoidComponent<RouteActionsProps> = (props) => {
110112
class="flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-surface-container-high bg-surface-container-lowest p-4 hover:bg-surface-container-low"
111113
>
112114
<div class="lg:text-body-lg">
113-
{currentRouteId().split('/')[0] || ''}/
114-
<br />
115-
{currentRouteId().split('/')[1] || ''}
115+
<span class="break-keep inline-block">
116+
{currentRouteId().split('/')[0] || ''}/
117+
</span>
118+
<span class="break-keep inline-block">
119+
{currentRouteId().split('/')[1] || ''}
120+
</span>
116121
</div>
117-
<Icon size="24" class={`mr-5 ${copied() ? 'text-green-300' : ''}`}>{copied() ? 'check' : 'file_copy'}</Icon>
122+
<Icon size="24" class={clsx('ml-2', copied() && 'text-green-300')}>{copied() ? 'check' : 'file_copy'}</Icon>
118123
</button>
119124
</div>
120125

0 commit comments

Comments
 (0)