/**
* 充电弹窗组件
* @邠心vbe on 2021/04/25
*/
import React from "react";
import { Image, Pressable, StyleSheet, Text, View } from "react-native";
import Modal from "react-native-modal";
import { ModalProps } from "../../components/BottomModal";
import Button from "../../components/Button";
import { Styles } from "../../components/Toolbar";
import { PageList } from "../Router";
import app from "../../../app.json"
export const DialogMaxWidth = $vw(85) > 500 ? 500 : $vw(85);
export const LoginDialog = ({onHide, onClose}) => {
return (
Oops!
You need to be registered user of {app.displayName}
Login to use this feature
);
}
export const ErrorDialog = ({visible, code, message, onClose}) => {
return (
Oops!
{message}
);
}
export const LowCreditDialog = ({visible, onClose}) => {
return (
Low Credits
Your credit is below S$5.
{"This charging session will end if there is insufficient credits.\n"}
onClose(false)} />
);
}
export const CancelReserveDialog = ({visible, onClose}) => {
return (
Cancel
Are you sure you want to cancel the reservation?
onClose(false)}>
);
}
export const RegisterDialog = ({address, onClose}) => {
return (
Thank you for registering with
a confirmation email has been sent to
{address}
);
}
const ErrorImage = ({code}) => {
switch (code) {
case 'A1':
return (
);
case 'A4':
return (
);
case 'A5':
return (
);
case 'A9':
return (
);
default:
return (
);
}
}
const styles = StyleSheet.create({
dialog: {
width: DialogMaxWidth,
paddingTop: 16,
paddingLeft: 20,
paddingRight: 20,
paddingBottom: 16,
marginLeft: 'auto',
marginRight: 'auto',
borderRadius: isIOS ? 20 : 3,
backgroundColor: 'white'
},
title: {
color: '#000',
fontSize: 24,
textAlign: "center"
},
message: {
zIndex: 2,
color: '#333',
fontSize: 14,
lineHeight: 22,
paddingTop: 16,
paddingLeft: 32,
paddingRight: 32,
paddingBottom: 2,
textAlign: "center"
},
loginTipView: {
zIndex: 1,
marginTop: -18,
paddingLeft: 12,
paddingRight: 12,
alignItems: 'flex-end',
flexDirection: "row"
},
tipText: {
flex: 1,
color: '#999',
fontSize: 12,
paddingBottom: 12
},
tipImage: {
width: 96.6,
height: 83.4
},
loginButton: {
marginTop: -2,
borderRadius: 10
},
loginButtonView: {
flex: 1,
height: 54,
alignItems: 'center',
justifyContent: 'center'
},
signUpView: {
color: '#333',
paddingTop: 16,
flexDirection: "row",
alignItems: "center",
justifyContent: "center"
},
signUpText: {
color: '#333',
fontSize: 12
},
signUpLink: {
fontSize: 12,
padding: 8,
...ui.link,
textDecorationLine: "underline"
},
closeIcon: {
top: 12,
right: 12,
position: "absolute"
},
errorImage: {
width: DialogMaxWidth,
height: DialogMaxWidth * 0.2,
marginTop: 4,
marginLeft: -20
},
regTitleText: {
color: '#000',
fontSize: 20,
...$padding(32, 0, 16),
textAlign: 'center'
},
regMessageText: {
color: '#000',
fontSize: 14,
paddingTop: 24,
lineHeight: 20
},
regMessageLink: {
...ui.link,
fontSize: 14,
paddingBottom: 16
},
cancelCloseBtn: {
flex: 1,
marginLeft: 16,
backgroundColor: '#ddd'
}
})