-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: when commiting add a commit message field to the commit modal
- Loading branch information
1 parent
fa6a41a
commit b0045b0
Showing
6 changed files
with
60 additions
and
79 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,46 @@ | ||
import React from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
import { useIntl } from 'react-intl'; | ||
|
||
import { Modal, modalTypeEnum, Body } from '../../components'; | ||
|
||
import { commitStagingData } from '../../store/actions/climateWarehouseActions'; | ||
|
||
const CommitModal = ({ onClose }) => { | ||
const intl = useIntl(); | ||
const dispatch = useDispatch(); | ||
|
||
const onCommit = () => { | ||
dispatch(commitStagingData('Projects')); | ||
onClose(); | ||
}; | ||
|
||
const onCommitAll = () => { | ||
dispatch(commitStagingData('all')); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
title={intl.formatMessage({ id: 'commit-message' })} | ||
body={ | ||
<div> | ||
this is where the field | ||
<Body size="Large"> | ||
{intl.formatMessage({ | ||
id: 'commit-projects-message-question', | ||
})} | ||
</Body> | ||
</div> | ||
} | ||
modalType={modalTypeEnum.basic} | ||
extraButtonLabel={intl.formatMessage({ id: 'everything' })} | ||
extraButtonOnClick={onCommitAll} | ||
onClose={() => onClose()} | ||
onOk={onCommit} | ||
label={intl.formatMessage({ id: 'only-projects' })} | ||
/> | ||
); | ||
}; | ||
|
||
export { CommitModal }; |
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