-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 #4312 from Giveth/add-delete-action-to-draft-projects
Add delete action to draft projects UI
- Loading branch information
Showing
10 changed files
with
157 additions
and
234 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
70 changes: 70 additions & 0 deletions
70
src/components/views/userProfile/projectsTab/DeleteProjectModal.tsx
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,70 @@ | ||
import styled from 'styled-components'; | ||
import { type FC } from 'react'; | ||
import { Button, Flex, IconTrash32, P } from '@giveth/ui-design-system'; | ||
import { useIntl } from 'react-intl'; | ||
import { IProject } from '@/apollo/types/types'; | ||
import { Modal } from '@/components/modals/Modal'; | ||
import { IModal } from '@/types/common'; | ||
import { useModalAnimation } from '@/hooks/useModalAnimation'; | ||
|
||
interface IDeleteProjectModal extends IModal { | ||
project: IProject; | ||
} | ||
|
||
const DeleteProjectModal: FC<IDeleteProjectModal> = ({ | ||
setShowModal, | ||
project, | ||
}) => { | ||
const { formatMessage } = useIntl(); | ||
const { isAnimating, closeModal } = useModalAnimation(setShowModal); | ||
|
||
return ( | ||
<Modal | ||
closeModal={closeModal} | ||
isAnimating={isAnimating} | ||
headerTitle='Confirm Project Removal' | ||
headerIcon={<IconTrash32 />} | ||
headerTitlePosition='left' | ||
> | ||
<ModalContainer> | ||
<P> | ||
{formatMessage( | ||
{ | ||
id: 'component.delete_project.confirmation', | ||
}, | ||
{ | ||
title: project.title, | ||
}, | ||
)} | ||
</P> | ||
<Flex gap='24px' $flexDirection='column' $alignItems='center'> | ||
<Button | ||
buttonType='primary' | ||
label={formatMessage({ | ||
id: 'component.delete_project.yes', | ||
})} | ||
size='small' | ||
onClick={() => setShowModal(true)} | ||
/> | ||
<Button | ||
buttonType='texty-gray' | ||
label={formatMessage({ | ||
id: 'component.delete_project.no', | ||
})} | ||
size='small' | ||
onClick={() => setShowModal(false)} | ||
/> | ||
</Flex> | ||
</ModalContainer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
const ModalContainer = styled(Flex)` | ||
padding: 24px; | ||
min-width: 450px; | ||
flex-direction: column; | ||
gap: 36px; | ||
`; | ||
|
||
export default DeleteProjectModal; |
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
Oops, something went wrong.