-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from nebulabroadcast/93-rundown-edit
Experimental: Rundown editing in the web interface
- Loading branch information
Showing
66 changed files
with
2,374 additions
and
1,013 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const BodyCell = ({ rowData, column, cellFormatter }) => { | ||
if (cellFormatter) return cellFormatter(rowData, column.name) | ||
return <td>{rowData[column.name]}</td> | ||
} | ||
export default BodyCell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useMemo } from 'react' | ||
|
||
const SortIcon = ({ children }) => ( | ||
<span className="icon material-symbols-outlined">{children}</span> | ||
) | ||
|
||
const HeaderCell = ({ name, width, title, sortDirection, onSort }) => { | ||
const sortArrowElement = useMemo(() => { | ||
if (!onSort) return | ||
if (sortDirection === 'asc') return <SortIcon>arrow_drop_up</SortIcon> | ||
if (sortDirection === 'desc') return <SortIcon>arrow_drop_down</SortIcon> | ||
return <SortIcon>more_vert</SortIcon> | ||
}, [sortDirection, onSort]) | ||
|
||
const onClick = () => { | ||
if (!onSort) return | ||
if (sortDirection === 'asc') { | ||
onSort(name, 'desc') | ||
} else { | ||
onSort(name, 'asc') | ||
} | ||
} | ||
return ( | ||
<th style={{ width: width }} onClick={onClick}> | ||
<div> | ||
{title} | ||
{sortArrowElement} | ||
</div> | ||
</th> | ||
) | ||
} | ||
|
||
export default HeaderCell |
Oops, something went wrong.