Skip to content

Commit

Permalink
Modal Excluir
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrogomes18 committed Feb 19, 2024
1 parent e7d2f9b commit 8c36ef5
Show file tree
Hide file tree
Showing 24 changed files with 108 additions and 95 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.73.4",
"react-native-modal": "^13.0.1",
"react-native-pager-view": "^6.2.3",
"react-native-reanimated": "~3.6.2",
"react-native-safe-area-context": "4.8.2",
Expand Down
93 changes: 0 additions & 93 deletions public/assets/fonts/OFL.txt

This file was deleted.

Binary file removed public/assets/fonts/Poppins-Black.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-BlackItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-Bold.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-BoldItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-ExtraBold.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-ExtraBoldItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-ExtraLight.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-ExtraLightItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-Italic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-Light.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-LightItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-Medium.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-MediumItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-Regular.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-SemiBold.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-SemiBoldItalic.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-Thin.ttf
Binary file not shown.
Binary file removed public/assets/fonts/Poppins-ThinItalic.ttf
Binary file not shown.
Binary file added public/assets/img/warnnign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 33 additions & 1 deletion src/screens/SalesInspector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import useAuth from '@hooks/useAuth';
import SellerServices from '@services/SellerServices';
import ISeller from '@interfaces/Seller';
import { View } from 'react-native';
import Modal from 'react-native-modal';

const SalesInpector = ({ route }) => {
const navigation = useNavigation();
const { idVendedor } = route.params;
const { user } = useAuth();
const [seller, setSeller] = useState<ISeller | null>(null);
const [isModalVisible, setIsModalVisible] = useState(false);

useEffect(() => {
const fetchData = async () => {
Expand All @@ -28,6 +30,18 @@ const SalesInpector = ({ route }) => {
navigation.goBack();
};

const toggleModal = () => {
setIsModalVisible(!isModalVisible);
};

const handleDelete = async () => {
try {
console.log('DELETADO');
} catch (error) {
console.error('Erro ao excluir vendedor:', error);
}
};

return (
<S.Wrapper>
<S.DivButtonBack>
Expand All @@ -47,11 +61,29 @@ const SalesInpector = ({ route }) => {
<S.Funcao>{seller?.email || '[email protected]'}</S.Funcao>
</S.InfoUser>

<S.BtnLixeira>
<S.BtnLixeira onPress={toggleModal}>
<S.ImageVectorLixeira
source={require('@assets/img/lixeira.png')}
/>
</S.BtnLixeira>
<Modal isVisible={isModalVisible} onBackdropPress={toggleModal}>
<S.ContentModal>
<S.WrapperConteudo>
<S.ImageWarning
source={require('@assets/img/warnnign.png')}
/>
<S.TextModal>
Tem certeza que deseja excluir esse vendedor?
</S.TextModal>
</S.WrapperConteudo>
<S.BtnYes onPress={handleDelete}>
<S.TitleBtnYes>Sim</S.TitleBtnYes>
</S.BtnYes>
<S.BtnBack onPress={toggleModal}>
<S.TitleBtnBack>Voltar</S.TitleBtnBack>
</S.BtnBack>
</S.ContentModal>
</Modal>
</S.ViewInfoUser>
</S.Container>
</View>
Expand Down
58 changes: 58 additions & 0 deletions src/screens/SalesInspector/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,61 @@ export const ImageVectorLixeira = styled(Image)`
width: 24px;
height: 24px;
`;

export const ContentModal = styled(View)`
background-color: white;
padding: 32px 24px;
gap: 8px;
border-radius: 8px;
`;

export const WrapperConteudo = styled(View)`
display: flex;
justify-content: center;
align-items: center;
`;

export const ImageWarning = styled(Image)`
width: 48px;
height: 48px;
`;

export const TextModal = styled(Text)`
font-family: Poppins;
font-size: 14px;
margin: 16px auto;
text-align: center;
letter-spacing: 0.5px;
`;

export const BtnYes = styled(TouchableOpacity)`
background-color: #e5484d;
border-radius: 8px;
padding: 16px;
display: flex;
justify-content: center;
align-items: center;
`;

export const TitleBtnYes = styled(Text)`
font-family: PoppinsBold;
color: #f8faff;
letter-spacing: 1.25px;
text-transform: uppercase;
`;

export const BtnBack = styled(TouchableOpacity)`
border: 2px solid ${theme.colors.secundary.main};
border-radius: 8px;
padding: 16px;
display: flex;
justify-content: center;
align-items: center;
`;

export const TitleBtnBack = styled(Text)`
color: ${theme.colors.secundary.main};
font-family: PoppinsBold;
font-size: 14px;
text-transform: uppercase;
`;
17 changes: 16 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8811,7 +8811,7 @@ prompts@^2.3.2, prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"

prop-types@^15.8.1:
prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
Expand Down Expand Up @@ -8953,6 +8953,21 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

[email protected]:
version "1.3.3"
resolved "https://registry.yarnpkg.com/react-native-animatable/-/react-native-animatable-1.3.3.tgz#a13a4af8258e3bb14d0a9d839917e9bb9274ec8a"
integrity sha512-2ckIxZQAsvWn25Ho+DK3d1mXIgj7tITkrS4pYDvx96WyOttSvzzFeQnM2od0+FUMzILbdHDsDEqZvnz1DYNQ1w==
dependencies:
prop-types "^15.7.2"

react-native-modal@^13.0.1:
version "13.0.1"
resolved "https://registry.yarnpkg.com/react-native-modal/-/react-native-modal-13.0.1.tgz#691f1e646abb96fa82c1788bf18a16d585da37cd"
integrity sha512-UB+mjmUtf+miaG/sDhOikRfBOv0gJdBU2ZE1HtFWp6UixW9jCk/bhGdHUgmZljbPpp0RaO/6YiMmQSSK3kkMaw==
dependencies:
prop-types "^15.6.2"
react-native-animatable "1.3.3"

react-native-pager-view@^6.2.3:
version "6.2.3"
resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-6.2.3.tgz#698f6387fdf06cecc3d8d4792604419cb89cb775"
Expand Down

0 comments on commit 8c36ef5

Please sign in to comment.