-
Notifications
You must be signed in to change notification settings - Fork 8
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 #390 from adhocteam/main
Draft alert and report bug fixes
- Loading branch information
Showing
8 changed files
with
114 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, { useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
function DismissingComponentWrapper({ | ||
shown, timeVisibleInSec, hideFromScreenReader, children, updateShown, | ||
}) { | ||
useEffect(() => { | ||
let id; | ||
if (shown) { | ||
id = setTimeout(() => { | ||
updateShown(false); | ||
}, [timeVisibleInSec * 1000]); | ||
} else { | ||
clearTimeout(id); | ||
} | ||
|
||
return () => { | ||
clearTimeout(id); | ||
}; | ||
}, [shown]); | ||
|
||
return ( | ||
<> | ||
{shown && ( | ||
<div aria-hidden={hideFromScreenReader}> | ||
{children} | ||
</div> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
DismissingComponentWrapper.propTypes = { | ||
shown: PropTypes.bool.isRequired, | ||
timeVisibleInSec: PropTypes.number, | ||
hideFromScreenReader: PropTypes.bool, | ||
updateShown: PropTypes.func.isRequired, | ||
children: PropTypes.node, | ||
}; | ||
|
||
DismissingComponentWrapper.defaultProps = { | ||
timeVisibleInSec: 30, | ||
hideFromScreenReader: true, | ||
children: null, | ||
}; | ||
|
||
export default DismissingComponentWrapper; |
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
19 changes: 19 additions & 0 deletions
19
src/migrations/20210315234158-seed-non-grantee-recipients.js
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,19 @@ | ||
module.exports = { | ||
up: (queryInterface) => queryInterface.bulkInsert('NonGrantees', [ | ||
{ name: 'CCDF / Child Care Administrator' }, | ||
{ name: 'Head Start Collaboration Office' }, | ||
{ name: 'QRIS System' }, | ||
{ name: 'Regional Head Start Association' }, | ||
{ name: 'Regional TTA/Other Specialists' }, | ||
{ name: 'State CCR&R' }, | ||
{ name: 'State Early Learning Standards' }, | ||
{ name: 'State Education System' }, | ||
{ name: 'State Health System' }, | ||
{ name: 'State Head Start Association' }, | ||
{ name: 'State Professional Development / Continuing Education' }, | ||
], | ||
{ | ||
ignoreDuplicates: true, | ||
}), | ||
down: (queryInterface) => queryInterface.bulkDelete('Regions', null, {}), | ||
}; |
This file was deleted.
Oops, something went wrong.
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