-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:standard cluster purchase process (#4225)
* feat:standard cluster purchase process Signed-off-by: jingyang <[email protected]> * fix cronjob Signed-off-by: jingyang <[email protected]> --------- Signed-off-by: jingyang <[email protected]>
- Loading branch information
Showing
3 changed files
with
104 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { | ||
Center, | ||
Flex, | ||
Modal, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalOverlay, | ||
Text, | ||
useDisclosure | ||
} from '@chakra-ui/react'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { useCallback, useRef } from 'react'; | ||
|
||
export const useConfirm = () => { | ||
const { isOpen, onOpen, onClose } = useDisclosure(); | ||
const { t } = useTranslation(); | ||
const confirmCb = useRef<any>(); | ||
const cancelCb = useRef<any>(); | ||
|
||
return { | ||
openConfirm: useCallback( | ||
(confirm?: any, cancel?: any) => { | ||
return function () { | ||
onOpen(); | ||
confirmCb.current = confirm; | ||
cancelCb.current = cancel; | ||
}; | ||
}, | ||
[onOpen] | ||
), | ||
ConfirmChild: useCallback( | ||
() => ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalCloseButton /> | ||
<Flex | ||
flexDirection={'column'} | ||
px="37px" | ||
pt="90px" | ||
pb="42px" | ||
alignItems={'center'} | ||
justifyContent={'center'} | ||
> | ||
<Text color={'#24282C'} fontWeight={500} fontSize={'24px'}> | ||
将为您新建一个标准版集群 | ||
</Text> | ||
<Text mt="28px" fontSize={'14px'} fontWeight={400} color={'#7B838B'}> | ||
点击立即开始后将会新建一个集群 | ||
</Text> | ||
<Center | ||
mt="62px" | ||
w="218px" | ||
h="44px" | ||
bg={'#24282C'} | ||
color={'white'} | ||
fontSize={'14px'} | ||
fontWeight={500} | ||
borderRadius={'4px'} | ||
cursor={'pointer'} | ||
onClick={() => { | ||
onClose(); | ||
typeof confirmCb.current === 'function' && confirmCb.current(); | ||
}} | ||
> | ||
立即开始 | ||
</Center> | ||
<Center | ||
mt="16px" | ||
w="218px" | ||
h="20px" | ||
bg={'white'} | ||
color={'#7B838B'} | ||
fontSize={'14px'} | ||
fontWeight={400} | ||
cursor={'pointer'} | ||
onClick={() => { | ||
onClose(); | ||
typeof cancelCb.current === 'function' && cancelCb.current(); | ||
}} | ||
> | ||
已有集群 | ||
</Center> | ||
</Flex> | ||
</ModalContent> | ||
</Modal> | ||
), | ||
[isOpen, onClose] | ||
) | ||
}; | ||
}; |
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