Skip to content

Commit

Permalink
feat(connections): reset the ordering of columns
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Sep 2, 2023
1 parent 281bf45 commit 9d3706f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/ConnectionsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useI18n } from '@solid-primitives/i18n'
import type {
DragEventHandler,
Draggable,
Expand All @@ -24,6 +25,7 @@ export default (props: {
onOrderChange: (value: ColumnOrder) => void
onVisibleChange: (value: ColumnVisibility) => void
}) => {
const [t] = useI18n()
const [activeKey, setActiveKey] = createSignal<AccessorKey | null>(null)
const onDragStart = ({ draggable }: { draggable: Draggable }) =>
setActiveKey(draggable.id as AccessorKey)
Expand Down Expand Up @@ -100,7 +102,15 @@ export default (props: {
<div class="sortable">{activeKey()}</div>
</DragOverlay>
</DragDropProvider>

<button
class="btn btn-neutral btn-sm ml-auto mt-4 block"
onClick={() => props.onOrderChange(Object.values(AccessorKey))}
>
{t('reset')}
</button>
</div>

<label class="modal-backdrop" for="connection-modal" />
</div>
</>
Expand Down
Empty file removed src/config/user
Empty file.
2 changes: 2 additions & 0 deletions src/i18n/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const dict = {
source: 'Source',
destination: 'Destination',
close: 'Close',
reset: 'Reset',
},
'zh-Hans': {
add: '添加',
Expand Down Expand Up @@ -70,6 +71,7 @@ const dict = {
source: '源地址',
destination: '目标地址',
close: '关闭',
reset: '重置',
},
}

Expand Down

0 comments on commit 9d3706f

Please sign in to comment.