Skip to content

Commit 782d06b

Browse files
authored
Merge pull request #17 from archit-p/header-refactoring
Break down header code into components
2 parents 61d346a + a94d9f8 commit 782d06b

File tree

9 files changed

+978
-790
lines changed

9 files changed

+978
-790
lines changed

package-lock.json

Lines changed: 547 additions & 437 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Header.jsx

Lines changed: 0 additions & 351 deletions
This file was deleted.

src/Table.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useSortBy,
88
} from 'react-table';
99
import Cell from './cells/Cell';
10-
import Header from './Header';
10+
import Header from './header/Header';
1111
import PlusIcon from './img/Plus';
1212
import { ActionTypes } from './utils';
1313
import { FixedSizeList } from 'react-window';

src/header/AddColumnHeader.jsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import PlusIcon from '../img/Plus';
2+
import React from 'react';
3+
import { ActionTypes, Constants } from '../utils';
4+
5+
export default function AddColumnHeader({ getHeaderProps, dataDispatch }) {
6+
return (
7+
<div {...getHeaderProps()} className="th noselect d-inline-block">
8+
<div
9+
className="th-content d-flex justify-content-center"
10+
onClick={e =>
11+
dataDispatch({
12+
type: ActionTypes.ADD_COLUMN_TO_LEFT,
13+
columnId: Constants.ADD_COLUMN_ID,
14+
focus: true,
15+
})
16+
}
17+
>
18+
<span className="svg-icon-sm svg-gray">
19+
<PlusIcon />
20+
</span>
21+
</div>
22+
</div>
23+
);
24+
}

0 commit comments

Comments
 (0)