|
1 | 1 | import { createSignal, Show, type VoidComponent, createEffect, createResource } from 'solid-js'
|
2 |
| -import Icon from '~/components/material/Icon' |
| 2 | +import clsx from 'clsx' |
| 3 | + |
3 | 4 | import { setRoutePublic, setRoutePreserved, getRoute, getPreservedRoutes } from '~/api/route'
|
| 5 | +import Icon from '~/components/material/Icon' |
4 | 6 |
|
5 | 7 | interface RouteActionsProps {
|
6 | 8 | routeName: string
|
@@ -75,7 +77,7 @@ const RouteActions: VoidComponent<RouteActionsProps> = (props) => {
|
75 | 77 | } else {
|
76 | 78 | const currentValue = isPreserved()
|
77 | 79 | if (currentValue === undefined) return
|
78 |
| - |
| 80 | + |
79 | 81 | try {
|
80 | 82 | const newValue = !currentValue
|
81 | 83 | await setRoutePreserved(props.routeName, newValue)
|
@@ -110,11 +112,14 @@ const RouteActions: VoidComponent<RouteActionsProps> = (props) => {
|
110 | 112 | 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"
|
111 | 113 | >
|
112 | 114 | <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> |
116 | 121 | </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> |
118 | 123 | </button>
|
119 | 124 | </div>
|
120 | 125 |
|
|
0 commit comments