-
Notifications
You must be signed in to change notification settings - Fork 2
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 #1214 from CBIIT/bugfix/ICDC-3770
MUI 5 style style fix / reduce table button complexity / Typed implementation
- Loading branch information
Showing
10 changed files
with
477 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { useContext } from 'react'; | ||
import { TableContext as UntypedTableContext } from '../../../bento-core'; | ||
|
||
interface tableState { | ||
selectedRows: string[]; | ||
title: string; | ||
query: string; | ||
paginationAPIField: string; | ||
dataKey: string; | ||
columns: unknown; | ||
count: number; | ||
selectedFileIds: string[]; | ||
tableMsg: string; | ||
sortBy: string; | ||
sortOrder: string; | ||
extendedViewConfig: unknown; | ||
columnGroups: unknown; | ||
rowsPerPage: number; | ||
page: number; | ||
} | ||
|
||
interface TableContextType { | ||
context: tableState; | ||
} | ||
|
||
// Set table context and table state to Types | ||
const PgInitTableContext = | ||
UntypedTableContext as React.Context<TableContextType>; | ||
|
||
export const PaginatedTableContext = () => { | ||
const context = useContext(PgInitTableContext); | ||
if (!context) { | ||
throw new Error('Context must be used within a TableProvider'); | ||
} | ||
return context; | ||
}; |
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,9 @@ | ||
import { btnTypes } from '../../../bento-core'; | ||
|
||
interface ButtonType { | ||
ADD_ALL_FILES: string; | ||
ADD_SELECTED_FILES: string; | ||
DOWNLOAD_MANIFEST: string; | ||
} | ||
|
||
export const PgTableButton = btnTypes as ButtonType; |
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,13 @@ | ||
import styled from '@emotion/styled'; | ||
import { Link } from '@mui/material'; | ||
|
||
export const MyCartLink = styled(Link)({ | ||
height: '65px', | ||
color: '#3E6886', | ||
fontSize: '12px', | ||
fontFamily: 'Lato', | ||
borderBottom: '1px solid #3E6886', | ||
textDecoration: 'none', | ||
marginLeft: '55px', | ||
display: 'block', | ||
}); |
Oops, something went wrong.