Skip to content

Commit

Permalink
feat(connections): shorten the tab names
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Sep 13, 2023
1 parent 716fc2e commit 1a37a10
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
5 changes: 4 additions & 1 deletion src/components/ConnectionsTableDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export const ConnectionsTableDetailsModal: Component<{
selectedConnectionID?: string
}> = (props) => {
return (
<dialog id="connections-table-details-modal" class="modal">
<dialog
id="connections-table-details-modal"
class="modal modal-bottom sm:modal-middle"
>
<div class="modal-box">
<Show when={props.selectedConnectionID}>
<pre>
Expand Down
27 changes: 16 additions & 11 deletions src/components/ConnectionsTableOrderingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ export const ConnectionsTableOrderingModal = (props: {
}

return (
<dialog id="connections-table-ordering-modal" class="modal">
<div class="modal-box w-80" onContextMenu={(e) => e.preventDefault()}>
<dialog
id="connections-table-ordering-modal"
class="modal modal-bottom sm:modal-middle"
>
<div class="modal-box" onContextMenu={(e) => e.preventDefault()}>
<DragDropProvider
onDragStart={onDragStart}
onDragEnd={onDragEnd as DragEventHandler}
Expand All @@ -115,15 +118,17 @@ export const ConnectionsTableOrderingModal = (props: {
</DragOverlay>
</DragDropProvider>

<Button
class="btn-neutral btn-sm ml-auto mt-4 block"
onClick={() => {
props.onOrderChange(CONNECTIONS_TABLE_INITIAL_COLUMN_ORDER)
props.onVisibleChange(CONNECTIONS_TABLE_INITIAL_COLUMN_VISIBILITY)
}}
>
{t('reset')}
</Button>
<div class="modal-action">
<Button
class="btn-neutral btn-sm ml-auto mt-4 block"
onClick={() => {
props.onOrderChange(CONNECTIONS_TABLE_INITIAL_COLUMN_ORDER)
props.onVisibleChange(CONNECTIONS_TABLE_INITIAL_COLUMN_VISIBILITY)
}}
>
{t('reset')}
</Button>
</div>
</div>

<form method="dialog" class="modal-backdrop">
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default {
switchEndpoint: 'Switch Endpoint',
switchLanguage: 'Switch Language',
latencyTestTimeoutDuration: 'Latency Test Timeout Duration',
closedConnections: 'Closed Connections',
all: 'All',
sequence: 'Sequence',
payload: 'Payload',
Expand All @@ -78,4 +77,6 @@ export default {
global: 'Global',
rule: 'Rule',
direct: 'Direct',
active: 'Active',
closed: 'Closed',
}
3 changes: 2 additions & 1 deletion src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default {
switchEndpoint: '切换后端',
switchLanguage: '切换语言',
latencyTestTimeoutDuration: '测速超时时间',
closedConnections: '已关闭连接',
all: '全部',
sequence: '序列号',
payload: '内容',
Expand All @@ -78,4 +77,6 @@ export default {
global: '全局',
rule: '规则',
direct: '直连',
active: '活动',
closed: '已关闭',
}
14 changes: 7 additions & 7 deletions src/pages/Connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { writeClipboard } from '@solid-primitives/clipboard'
import { useI18n } from '@solid-primitives/i18n'
import { makePersisted } from '@solid-primitives/storage'
import {
IconCircleX,
IconInfoCircle,
IconInfoSmall,
IconPlayerPause,
IconPlayerPlay,
IconSettings,
IconSortAscending,
IconSortDescending,
IconX,
IconZoomInFilled,
IconZoomOutFilled,
} from '@tabler/icons-solidjs'
Expand Down Expand Up @@ -113,7 +113,7 @@ export default () => {
modal?.showModal()
}}
>
<IconInfoCircle size="16" />
<IconInfoSmall size="16" />
</Button>
</div>
),
Expand All @@ -131,7 +131,7 @@ export default () => {
class="btn-circle btn-xs"
onClick={() => closeSingleConnectionAPI(row.original.id)}
>
<IconCircleX size="16" />
<IconX size="16" />
</Button>
</div>
),
Expand Down Expand Up @@ -293,12 +293,12 @@ export default () => {
const tabs = createMemo(() => [
{
type: ActiveTab.activeConnections,
name: t('activeConnections'),
name: t('active'),
count: activeConnections().length,
},
{
type: ActiveTab.closedConnections,
name: t('closedConnections'),
name: t('closed'),
count: closedConnections().length,
},
])
Expand Down Expand Up @@ -350,7 +350,7 @@ export default () => {
}
}}
>
<IconCircleX />
<IconX />
</Button>

<Button
Expand Down

0 comments on commit 1a37a10

Please sign in to comment.