Skip to content

Commit

Permalink
refactor: #312 일부 기능 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
musma-sujan7 committed Dec 22, 2023
1 parent 781939b commit 076324c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-bikes-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@musma/react-component": patch
---

refactor: #312 일부 기능 수정
39 changes: 38 additions & 1 deletion packages/libraries-test/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react'
import { Controller, useForm } from 'react-hook-form'

import { useTheme } from '@emotion/react'
import { Box, Form, TextInput } from '@musma/react-component'
import { Box, Form, Table, TableColumn, TableData, TextInput } from '@musma/react-component'

type CCC = {
aaa: string
Expand All @@ -19,6 +19,22 @@ const AAA = [
},
]

const TABLE_COLUMNS: TableColumn[] = [
{
columnLabel: 'No',
columnName: 'no',
},
{
columnLabel: '이름',
columnName: 'name',
},
]

interface TableRowData extends TableData {
no: number
name: string
}

export const Component = () => {
const theme = useTheme()

Expand All @@ -32,6 +48,10 @@ export const Component = () => {
},
})

const handleRowClick = (rowData: TableRowData) => {
console.log('테이블 row 클릭!')
}

return (
<Box>
<Box
Expand Down Expand Up @@ -59,6 +79,23 @@ export const Component = () => {
}}
/>
</Box>

<Table
data={[
{
id: '1',
no: 1,
name: '아무개',
},
{
id: '2',
no: 2,
name: '길동',
},
]}
onRowClick={handleRowClick}
columns={TABLE_COLUMNS}
/>
</Box>
)
}
Expand Down

0 comments on commit 076324c

Please sign in to comment.