diff --git a/src/components/ConfigTitle.tsx b/src/components/ConfigTitle.tsx new file mode 100644 index 0000000..125092f --- /dev/null +++ b/src/components/ConfigTitle.tsx @@ -0,0 +1,14 @@ +import { children, ParentComponent } from 'solid-js' + +export const ConfigTitle: ParentComponent<{ withDivider?: boolean }> = ( + props, +) => ( +
+ {children(() => props.children)()} +
+) diff --git a/src/components/ConnectionsTableOrderingModal.tsx b/src/components/ConnectionsSettingsModal.tsx similarity index 66% rename from src/components/ConnectionsTableOrderingModal.tsx rename to src/components/ConnectionsSettingsModal.tsx index 96d6437..aecd383 100644 --- a/src/components/ConnectionsTableOrderingModal.tsx +++ b/src/components/ConnectionsSettingsModal.tsx @@ -14,17 +14,20 @@ import { useDragDropContext, } from '@thisbeyond/solid-dnd' import { Component, For, Show, createSignal } from 'solid-js' -import { Button } from '~/components' +import { Button, ConfigTitle } from '~/components' import { CONNECTIONS_TABLE_ACCESSOR_KEY, CONNECTIONS_TABLE_INITIAL_COLUMN_ORDER, CONNECTIONS_TABLE_INITIAL_COLUMN_VISIBILITY, + MODAL, + TAILWINDCSS_SIZE, } from '~/constants' +import { connectionsTableSize, setConnectionsTableSize } from '~/signals' type ColumnVisibility = Partial> type ColumnOrder = CONNECTIONS_TABLE_ACCESSOR_KEY[] -export const ConnectionsTableOrderingModal = (props: { +export const ConnectionsSettingsModal = (props: { order: ColumnOrder visible: ColumnVisibility onOrderChange: (value: ColumnOrder) => void @@ -76,8 +79,9 @@ export const ConnectionsTableOrderingModal = (props: { 'transition-transform': !!state.active.draggable, }} > -
+
{t(key)} + - ) } diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index 8de517a..46ba4c9 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -1,15 +1,21 @@ import { useI18n } from '@solid-primitives/i18n' -import { IconBrandSpeedtest, IconReload } from '@tabler/icons-solidjs' +import { + IconBrandSpeedtest, + IconReload, + IconSettings, +} from '@tabler/icons-solidjs' import { For, Show, createSignal } from 'solid-js' import { twMerge } from 'tailwind-merge' import { Button, Collapse, ForTwoColumns, + ProxiesSettingsModal, ProxyCardGroups, ProxyNodePreview, SubscriptionInfo, } from '~/components' +import { MODAL } from '~/constants' import { formatTimeFromNow, sortProxiesByOrderingType, @@ -123,6 +129,21 @@ export default () => { /> + +
+ +
@@ -274,6 +295,8 @@ export default () => { />
+ + ) } diff --git a/src/signals/config.ts b/src/signals/config.ts index ed3fed0..fdc767b 100644 --- a/src/signals/config.ts +++ b/src/signals/config.ts @@ -48,9 +48,13 @@ export const [renderInTwoColumns, setRenderInTwoColumns] = makePersisted( createSignal(true), { name: 'renderInTwoColumn', storage: localStorage }, ) -export const [tableSize, setTableSize] = makePersisted( +export const [connectionsTableSize, setConnectionsTableSize] = makePersisted( createSignal(TAILWINDCSS_SIZE.XS), - { name: 'tableSize', storage: localStorage }, + { name: 'connectionsTableSize', storage: localStorage }, +) +export const [logsTableSize, setLogsTableSize] = makePersisted( + createSignal(TAILWINDCSS_SIZE.XS), + { name: 'logsTableSize', storage: localStorage }, ) export const [logLevel, setLogLevel] = makePersisted(