-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add addDatasetAlert, removeDatasetAlert
- Loading branch information
1 parent
de2fcd8
commit 417c300
Showing
8 changed files
with
74 additions
and
38 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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { createContext, useContext } from 'react' | ||
|
||
import { DatasetAlert } from '../../dataset/domain/models/Dataset' | ||
import { DatasetAlert, DatasetAlertMessageKey } from '../../dataset/domain/models/Dataset' | ||
|
||
interface DatasetAlertContextProps { | ||
datasetAlerts: DatasetAlert[] | ||
setDatasetAlerts: (datasetAlerts: DatasetAlert[]) => void | ||
datasetAlerts: DatasetAlert[] | ||
addDatasetAlert: (newAlert: DatasetAlert) => void | ||
removeDatasetAlert: (alertId: DatasetAlertMessageKey) => void | ||
} | ||
|
||
export const DatasetAlertContext = createContext<DatasetAlertContextProps>({ | ||
datasetAlerts: [], | ||
setDatasetAlerts: /* istanbul ignore next */ () => {} | ||
setDatasetAlerts: /* istanbul ignore next */ () => {}, | ||
addDatasetAlert: () => {}, | ||
removeDatasetAlert: () => {} | ||
}) | ||
export const useDatasetAlertContext = () => useContext(DatasetAlertContext) |
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