atharesinc / athares

Expo Web and Native Codebase
0 stars 0 forks source link

DEV: Implement Cross Platform Alerts #7

Closed actuallydan closed 4 years ago

actuallydan commented 4 years ago

Currently Alerts in RN don't work as intended in the web, so a MeshStorage like implementation should be used to bridge the gap.

const MeshAlert = {
    success: (config)=>{
        // If Platform.OS === "web"
        //     use sweetalert swal(config.title, config.text)
        // else
        // Alert.alert(config.title, config.text)
    }
    error: (config, confirm, exit)
}

Ideally, this would use sweetalert for web and just native Alert for Android and iOS, the styles can be grabbed from the athares-browser repo for swal-overrides and chucked into the web/index.html template.