-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Criação da Tela de Cadastro do Tipo de ACC
- Loading branch information
1 parent
2586fa3
commit b47fedf
Showing
3 changed files
with
256 additions
and
5 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,54 @@ | ||
import React from 'react'; | ||
import { Box, createStandaloneToast } from '@chakra-ui/react'; | ||
import Noty from 'noty'; | ||
|
||
const NOTY_THEME = 'nest'; | ||
const toast = createStandaloneToast(); | ||
|
||
const notifySuccess = (text: string): any => { | ||
toast({ | ||
title: 'Sucesso!', | ||
status: 'success', | ||
duration: 3000, | ||
isClosable: true, | ||
position: 'bottom-right', | ||
render: props => ( | ||
<Box m={3} color="white" p={3} bg="teal.500" borderRadius="md"> | ||
<p> | ||
<strong>Sucesso!</strong> | ||
</p> | ||
<p>{text}</p> | ||
</Box> | ||
), | ||
}); | ||
}; | ||
|
||
function notifyError(text: string): void { | ||
toast({ | ||
title: 'Sucesso!', | ||
status: 'success', | ||
duration: 3000, | ||
isClosable: true, | ||
position: 'bottom-right', | ||
render: props => ( | ||
<Box m={3} color="white" p={3} bg="red.500" borderRadius="md"> | ||
<p> | ||
<strong>Ops!</strong> | ||
</p> | ||
<p>{text}</p> | ||
</Box> | ||
), | ||
}); | ||
} | ||
|
||
function notifyWarning(text: string): void { | ||
new Noty({ | ||
text, | ||
type: 'warning', | ||
theme: NOTY_THEME, | ||
timeout: 2000, | ||
progressBar: true, | ||
}).show(); | ||
} | ||
|
||
export { notifySuccess, notifyError, notifyWarning }; |
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ import { | |
Button, | ||
Flex, | ||
FormControl, | ||
FormHelperText, | ||
FormLabel, | ||
Heading, | ||
Input, | ||
|
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