Skip to content

Instantly share code, notes, and snippets.

View josiasbudaydeveloper's full-sized avatar
💭
Open to businesses

Josias Buday Dias josiasbudaydeveloper

💭
Open to businesses
View GitHub Profile
import { Alert, Platform } from "react-native";
type button = {
text: string;
onPress: () => void;
style?: "default" | "cancel" | "destructive" | undefined;
}
export default function callAlert(title: string, message: string, buttons?: button[]) {
if (Platform.OS === 'web') {
@josiasbudaydeveloper
josiasbudaydeveloper / expo-simple-web-pdf-viewer.js
Last active February 26, 2024 07:39
WebView for PDF viewing in React Native Expo apps
import * as React from 'react';
import { WebView } from 'react-native-webview';
import { StyleSheet } from 'react-native';
import Constants from 'expo-constants';
// the URL of the PDF file must end with '.pdf' to work
const bookURL = "http://www.book-url-example.pdf";
export default function SimplePDFViewer() {
return (