Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
krizzu committed Mar 14, 2024
1 parent 5a16094 commit 0cab7d7
Show file tree
Hide file tree
Showing 60 changed files with 1,644 additions and 1,600 deletions.
2 changes: 0 additions & 2 deletions packages/sqlite-storage/example/.bundle/config

This file was deleted.

70 changes: 70 additions & 0 deletions packages/sqlite-storage/example/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React, { useState } from "react";
import {
Button,
SafeAreaView,
ScrollView,
Text,
StatusBar,
StyleSheet,
useColorScheme,
View,
} from "react-native";
import { Colors } from "react-native/Libraries/NewAppScreen";
import { multiply } from "@react-native-async-storage/sqlite-storage";

function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === "dark";
const [result, setResult] = useState<string | null>(null);

const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};

async function test() {
const random = Math.round(Math.random() * 100);
const result = await multiply(random, 2);
setResult(`${random} * 2 = ${result}`);
}

return (
<SafeAreaView style={[backgroundStyle, styles.container]}>
<StatusBar
barStyle={isDarkMode ? "light-content" : "dark-content"}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}
>
<Button title="test module" onPress={() => test()} />
<View style={styles.result}>
{result ? <Text style={styles.title}>{result}</Text> : null}
</View>
</ScrollView>
</SafeAreaView>
);
}

const styles = StyleSheet.create({
container: {
marginTop: 32,
paddingHorizontal: 24,
},
title: {
fontSize: 24,
fontWeight: "600",
textAlign: "center",
},
sectionDescription: {
marginTop: 8,
fontSize: 24,
fontWeight: "400",
},
result: {
fontSize: 24,
marginTop: 24,
fontWeight: "700",
},
});

export default App;
9 changes: 0 additions & 9 deletions packages/sqlite-storage/example/Gemfile

This file was deleted.

119 changes: 0 additions & 119 deletions packages/sqlite-storage/example/android/app/build.gradle

This file was deleted.

Binary file not shown.
10 changes: 0 additions & 10 deletions packages/sqlite-storage/example/android/app/proguard-rules.pro

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

0 comments on commit 0cab7d7

Please sign in to comment.