Skip to content

Commit 58af4a0

Browse files
committed
feat: add sorting of my tasks
1 parent f425af6 commit 58af4a0

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

web/pages/tasks/index.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Page } from '@/components/layout/Page'
33
import titleWrapper from '@/utils/titleWrapper'
44
import { useTasksTranslation } from '@/i18n/useTasksTranslation'
55
import { ContentPanel } from '@/components/layout/ContentPanel'
6-
import { Avatar, CheckboxUncontrolled, IconButton, SolidButton, Table } from '@helpwave/hightide'
6+
import { Avatar, CheckboxUncontrolled, FillerRowElement, IconButton, SolidButton, Table } from '@helpwave/hightide'
77
import { useMemo } from 'react'
88
import type { ColumnDef } from '@tanstack/table-core'
99
import {
@@ -65,6 +65,7 @@ const TasksPage: NextPage = () => {
6565
{
6666
id: 'done',
6767
header: translation('status'),
68+
accessorKey: 'done',
6869
cell: ({ row }) => (
6970
<CheckboxUncontrolled
7071
checked={row.original.done}
@@ -78,9 +79,9 @@ const TasksPage: NextPage = () => {
7879
className={clsx('rounded-full')}
7980
/>
8081
),
81-
minSize: 75,
82-
size: 75,
83-
maxSize: 75,
82+
minSize: 120,
83+
size: 120,
84+
maxSize: 120,
8485
enableResizing: false,
8586
},
8687
{
@@ -214,6 +215,16 @@ const TasksPage: NextPage = () => {
214215
className="w-full h-full"
215216
data={tasks}
216217
columns={columns}
218+
fillerRow={() => (
219+
<FillerRowElement className="min-h-17.25"/>
220+
)}
221+
initialState={{
222+
sorting: [
223+
{ id: 'done', desc: true },
224+
{ id: 'updateDate', desc: true },
225+
]
226+
}}
227+
enableMultiSort={true}
217228
/>
218229
</ContentPanel>
219230
</Page>

0 commit comments

Comments
 (0)