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
import React, { useState } from 'react'; | |
import { | |
View, | |
Text, | |
StyleSheet, | |
TouchableOpacity, | |
Image, | |
ScrollView | |
} from 'react-native'; | |
import { AntDesign } from '@expo/vector-icons'; |
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
import React from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import { useHarperDB } from 'use-harperdb'; | |
function App() { | |
const [data, loading, error, refresh] = useHarperDB({ | |
query: { operation: 'sql', sql: 'select * from dev.books' } | |
}); |
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
Starting build | |
Download project archive | |
Unpacking project archive | |
Running yarn | |
yarn install v1.17.3 | |
[1/4] Resolving packages... | |
[2/4] Fetching packages... | |
info fsevents@1.2.13: The platform "linux" is incompatible with this module. | |
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. | |
info fsevents@2.1.3: The platform "linux" is incompatible with this module. |
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
// RN or Expo apps | |
import React from 'react'; | |
import { Text as RNText, StyleSheet } from 'react-native'; | |
import { Typography, FontWeight } from '@config'; | |
export default function Text({ | |
header = false, | |
title1 = false, |
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
<TouchableOpacity style={styles.button} onPress={addEventToCalendar}> | |
<Text style={[styles.text, { color: 'white' }]}> | |
Add this event to the calendar | |
</Text> | |
</TouchableOpacity> |
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
function addEventToCalendar(title, startDateUTC) { | |
const eventConfig = { | |
title: eventTitle, | |
startDate: utcDateToString(startDateUTC), | |
endDate: utcDateToString(moment.utc(startDateUTC).add(1, 'hours')), | |
notes: 'Default Event Description' | |
}; | |
AddCalendarEvent.presentEventCreatingDialog(eventConfig) | |
.then(eventInfo => { |
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
const utcDateToString = momentInUTC => { | |
let s = moment.utc(momentInUTC).format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); | |
return s; | |
}; |
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
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
alignItems: 'center', | |
backgroundColor: '#f8f8f2', | |
paddingTop: 60 | |
}, | |
title: { | |
fontSize: 20, | |
textAlign: 'center' |
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
export default function App() { | |
const [eventTitle, setEventTitle] = useState('Default event'); | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.title}> | |
Add Event in device's Calendar from React Native App | |
</Text> | |
<View style={styles.inputContainer}> | |
<Text style={styles.text}>Enter the Event title:</Text> |
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
export default function App() { | |
const [eventTitle, setEventTitle] = useState('Default event'); | |
// rest of the code | |
} |