Skip to content
Snippets Groups Projects
Commit 487a6947 authored by cabelt's avatar cabelt
Browse files

initial

parents
Branches
No related tags found
1 merge request!1initial
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
# dependencies
node_modules/
# Expo
.expo/
dist/
web-build/
# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
# Metro
.metro-health-check*
# debug
npm-debug.*
yarn-debug.*
yarn-error.*
# macOS
.DS_Store
*.pem
# local env files
.env*.local
# typescript
*.tsbuildinfo
App.js 0 → 100644
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, Button, View, Appearance, useColorScheme } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import Animated, { useSharedValue, withTiming, useAnimatedStyle, Easing, } from 'react-native-reanimated';
export default function App() {
const randomWidth = useSharedValue(10);
const config = {
duration: 500,
easing: Easing.bezier(0.5, 0.01, 0, 1),
};
const style = useAnimatedStyle(() => {
return {
width: withTiming(randomWidth.value, config),
};
});
const colorScheme = useColorScheme();
const themeTextStyle = colorScheme === 'light' ? styles.lightThemeText : styles.darkThemeText;
const themeContainerStyle =
colorScheme === 'light' ? styles.lightContainer : styles.darkContainer;
return (
<SafeAreaProvider>
<View style={[styles.container, themeContainerStyle]}>
<Animated.View style={[styles.box, style]} />
<Button
title="Press this to have rectangle change width"
onPress={() => {
randomWidth.value = Math.random() * 350;
}}
/>
<Text style={[styles.text, themeTextStyle]}>Hello World, it is Caroline Belt!</Text>
<StatusBar style="auto" />
</View>
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
lightContainer: {
// white
backgroundColor: '#FFFFFF',
},
darkContainer: {
// black
backgroundColor: '#000000',
},
lightThemeText: {
// white
color: '#000000',
},
darkThemeText: {
// black
color: '#FFFFFF',
},
box: {
width: 100,
height: 80,
backgroundColor: '#528AF6',
margin: 30,
},
});
app.json 0 → 100644
{
"expo": {
"name": "my-app",
"slug": "my-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#528AF6"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#528AF6"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
assets/adaptive-icon.png

14.7 KiB

assets/favicon.png

1.43 KiB

assets/icon.png

15.5 KiB

assets/splash.png

29.6 KiB

module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
'@babel/plugin-proposal-export-namespace-from',
'react-native-reanimated/plugin',
],
};
};
This diff is collapsed.
{
"name": "my-app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "^49.0.0",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",
"react": "18.2.0",
"react-native": "0.72.5",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-transform-export-namespace-from": "^7.22.11"
},
"private": true
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment