commit
1f5fb21691
@ -0,0 +1,257 @@
|
|||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/reactnative
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=reactnative
|
||||||
|
|
||||||
|
### ReactNative ###
|
||||||
|
# React Native Stack Base
|
||||||
|
|
||||||
|
.expo
|
||||||
|
__generated__
|
||||||
|
|
||||||
|
### ReactNative.Xcode Stack ###
|
||||||
|
## User settings
|
||||||
|
xcuserdata/
|
||||||
|
|
||||||
|
## Xcode 8 and earlier
|
||||||
|
*.xcscmblueprint
|
||||||
|
*.xccheckout
|
||||||
|
|
||||||
|
### ReactNative.Gradle Stack ###
|
||||||
|
.gradle
|
||||||
|
**/build/
|
||||||
|
!src/**/build/
|
||||||
|
|
||||||
|
# Ignore Gradle GUI config
|
||||||
|
gradle-app.setting
|
||||||
|
|
||||||
|
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||||
|
!gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Avoid ignore Gradle wrappper properties
|
||||||
|
!gradle-wrapper.properties
|
||||||
|
|
||||||
|
# Cache of project
|
||||||
|
.gradletasknamecache
|
||||||
|
|
||||||
|
# Eclipse Gradle plugin generated files
|
||||||
|
# Eclipse Core
|
||||||
|
.project
|
||||||
|
# JDT-specific (Eclipse Java Development Tools)
|
||||||
|
.classpath
|
||||||
|
|
||||||
|
### ReactNative.macOS Stack ###
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
### ReactNative.Linux Stack ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
### ReactNative.Node Stack ###
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Snowpack dependency directory (https://snowpack.dev/)
|
||||||
|
web_modules/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional stylelint cache
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
|
# Microbundle cache
|
||||||
|
.rpt2_cache/
|
||||||
|
.rts2_cache_cjs/
|
||||||
|
.rts2_cache_es/
|
||||||
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
.env
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
.parcel-cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
.nuxt
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Gatsby files
|
||||||
|
.cache/
|
||||||
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# vuepress v2.x temp and cache directory
|
||||||
|
.temp
|
||||||
|
|
||||||
|
# Docusaurus cache and generated files
|
||||||
|
.docusaurus
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
# Stores VSCode versions used for testing VSCode extensions
|
||||||
|
.vscode-test
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
|
|
||||||
|
### ReactNative.Buck Stack ###
|
||||||
|
buck-out/
|
||||||
|
.buckconfig.local
|
||||||
|
.buckd/
|
||||||
|
.buckversion
|
||||||
|
.fakebuckversion
|
||||||
|
|
||||||
|
### ReactNative.Android Stack ###
|
||||||
|
# Gradle files
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Local configuration file (sdk path, etc)
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
# Log/OS Files
|
||||||
|
|
||||||
|
# Android Studio generated files and folders
|
||||||
|
captures/
|
||||||
|
.externalNativeBuild/
|
||||||
|
.cxx/
|
||||||
|
*.apk
|
||||||
|
output.json
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
*.iml
|
||||||
|
.idea/
|
||||||
|
misc.xml
|
||||||
|
deploymentTargetDropDown.xml
|
||||||
|
render.experimental.xml
|
||||||
|
|
||||||
|
# Keystore files
|
||||||
|
*.jks
|
||||||
|
*.keystore
|
||||||
|
|
||||||
|
# Google Services (e.g. APIs or Firebase)
|
||||||
|
google-services.json
|
||||||
|
|
||||||
|
# Android Profiling
|
||||||
|
*.hprof
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/reactnative
|
@ -0,0 +1,20 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar';
|
||||||
|
import { StyleSheet, Text, View } from 'react-native';
|
||||||
|
|
||||||
|
export default function App() {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Text>Vroum Vroum i'm in my mom's car </Text>
|
||||||
|
<StatusBar style="auto" />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,32 @@
|
|||||||
|
# React-Native BUT2 Notation
|
||||||
|
|
||||||
|
Duration : 10 * 2h
|
||||||
|
|
||||||
|
## Documentation (4 pts)
|
||||||
|
|
||||||
|
* Application sketches
|
||||||
|
|
||||||
|
## Basics (10 pts)
|
||||||
|
|
||||||
|
* Navigation (2 pts)
|
||||||
|
* Tab bottom navigation + at least one button
|
||||||
|
* Store (2 pts)
|
||||||
|
* Read data from redux store
|
||||||
|
* Actions (1 pts)
|
||||||
|
* Update data to redux store
|
||||||
|
* Display list of items (2 pts)
|
||||||
|
* FlatList, VirtualizedList or SectionList
|
||||||
|
* Display image (1 pts)
|
||||||
|
* Child props (1 pts)
|
||||||
|
* TextInput (1 pts)
|
||||||
|
|
||||||
|
## Application features (6 pts)
|
||||||
|
|
||||||
|
* Retrieve data using the Web API (2 pts)
|
||||||
|
* Store favorite data into phone storage (2 pts)
|
||||||
|
* Write Tests (2 pts)
|
||||||
|
|
||||||
|
## Bonus (only taken into account if the basics are all mastered)
|
||||||
|
|
||||||
|
* Dark/Light mode switch (2pts)
|
||||||
|
* Sexy UI (2 pts)
|
@ -0,0 +1 @@
|
|||||||
|
[Slides](https://iutsa01.blob.core.windows.net/react-native/ReactNative.pdf)
|
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"expo": {
|
||||||
|
"name": "expo-init",
|
||||||
|
"slug": "expo-init",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"icon": "./assets/icon.png",
|
||||||
|
"userInterfaceStyle": "light",
|
||||||
|
"splash": {
|
||||||
|
"image": "./assets/splash.png",
|
||||||
|
"resizeMode": "contain",
|
||||||
|
"backgroundColor": "#ffffff"
|
||||||
|
},
|
||||||
|
"updates": {
|
||||||
|
"fallbackToCacheTimeout": 0
|
||||||
|
},
|
||||||
|
"assetBundlePatterns": [
|
||||||
|
"**/*"
|
||||||
|
],
|
||||||
|
"ios": {
|
||||||
|
"supportsTablet": true
|
||||||
|
},
|
||||||
|
"android": {
|
||||||
|
"adaptiveIcon": {
|
||||||
|
"foregroundImage": "./assets/adaptive-icon.png",
|
||||||
|
"backgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"web": {
|
||||||
|
"favicon": "./assets/favicon.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 46 KiB |
@ -0,0 +1,6 @@
|
|||||||
|
module.exports = function(api) {
|
||||||
|
api.cache(true);
|
||||||
|
return {
|
||||||
|
presets: ['babel-preset-expo'],
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1,188 @@
|
|||||||
|
export class City {
|
||||||
|
private _name: string;
|
||||||
|
private _latitude: number;
|
||||||
|
private _longitude: number;
|
||||||
|
|
||||||
|
constructor(name: string, latitude: number, longitude: number) {
|
||||||
|
this._name = name;
|
||||||
|
this._latitude = latitude;
|
||||||
|
this._longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
get name(): string {
|
||||||
|
return this._name;
|
||||||
|
}
|
||||||
|
|
||||||
|
set name(value: string) {
|
||||||
|
this._name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get latitude(): number {
|
||||||
|
return this._latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
set latitude(value: number) {
|
||||||
|
this._latitude = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get longitude(): number {
|
||||||
|
return this._longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
set longitude(value: number) {
|
||||||
|
this._longitude = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Weather {
|
||||||
|
private _at: string;
|
||||||
|
private _visibility: number;
|
||||||
|
private _weatherType: string;
|
||||||
|
private _weatherDescription: string;
|
||||||
|
private _temperature: number;
|
||||||
|
private _temperatureFeelsLike: number;
|
||||||
|
private _humidity: number;
|
||||||
|
private _windSpeed: number;
|
||||||
|
private _pressure: number;
|
||||||
|
private _city: City;
|
||||||
|
|
||||||
|
constructor(at: string, visibility: number, weatherType: string, weatherDescription: string, temperature: number, temperatureFeelsLike: number, humidity: number, windSpeed: number, pressure: number, city: City) {
|
||||||
|
this._at = at;
|
||||||
|
this._visibility = visibility;
|
||||||
|
this._weatherType = weatherType;
|
||||||
|
this._weatherDescription = weatherDescription;
|
||||||
|
this._temperature = temperature;
|
||||||
|
this._temperatureFeelsLike = temperatureFeelsLike;
|
||||||
|
this._humidity = humidity;
|
||||||
|
this._windSpeed = windSpeed;
|
||||||
|
this._pressure = pressure;
|
||||||
|
this._city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
get at(): string {
|
||||||
|
return this._at;
|
||||||
|
}
|
||||||
|
|
||||||
|
set at(value: string) {
|
||||||
|
this._at = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get visibility(): number {
|
||||||
|
return this._visibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
set visibility(value: number) {
|
||||||
|
this._visibility = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get weatherType(): string {
|
||||||
|
return this._weatherType;
|
||||||
|
}
|
||||||
|
|
||||||
|
set weatherType(value: string) {
|
||||||
|
this._weatherType = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get weatherDescription(): string {
|
||||||
|
return this._weatherDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
set weatherDescription(value: string) {
|
||||||
|
this._weatherDescription = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get temperature(): number {
|
||||||
|
return this._temperature;
|
||||||
|
}
|
||||||
|
|
||||||
|
set temperature(value: number) {
|
||||||
|
this._temperature = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get temperatureFeelsLike(): number {
|
||||||
|
return this._temperatureFeelsLike;
|
||||||
|
}
|
||||||
|
|
||||||
|
set temperatureFeelsLike(value: number) {
|
||||||
|
this._temperatureFeelsLike = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get humidity(): number {
|
||||||
|
return this._humidity;
|
||||||
|
}
|
||||||
|
|
||||||
|
set humidity(value: number) {
|
||||||
|
this._humidity = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get windSpeed(): number {
|
||||||
|
return this._windSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
set windSpeed(value: number) {
|
||||||
|
this._windSpeed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get pressure(): number {
|
||||||
|
return this._pressure;
|
||||||
|
}
|
||||||
|
|
||||||
|
set pressure(value: number) {
|
||||||
|
this._pressure = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get city(): City {
|
||||||
|
return this._city;
|
||||||
|
}
|
||||||
|
|
||||||
|
set city(value: City) {
|
||||||
|
this._city = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CITIES_DATA: City[] = [
|
||||||
|
new City("Paris", 48.866667, 2.333333),
|
||||||
|
new City("Clermont-Ferrand", 45.777222, 3.087025),
|
||||||
|
new City("Lyon", 45.764043, 4.835659),
|
||||||
|
new City("Marseille", 43.296482, 5.36978),
|
||||||
|
new City("Bruxelles", 50.85034, 4.35171),
|
||||||
|
];
|
||||||
|
|
||||||
|
export const FAVORITE_CITY_DATA =
|
||||||
|
new City("Clermont-Ferrand", 45.777222, 3.087025);
|
||||||
|
|
||||||
|
export const DEFAULT_SELECTED_CITY_DATA: City =
|
||||||
|
new City("Paris", 48.866667, 2.333333);
|
||||||
|
|
||||||
|
export const WEATHER_DATA: Weather[] = [
|
||||||
|
new Weather("2023-01-22 09:55:59", 10000, "Nuageux",
|
||||||
|
"couvert", 0.52, -4.34,
|
||||||
|
82, 5.14, 1032,
|
||||||
|
new City("Paris", 48.866667, 2.333333)
|
||||||
|
),
|
||||||
|
new Weather("2023-01-22 09:55:59", 10000, "Nuageux",
|
||||||
|
"couvert", 0.52, -4.34,
|
||||||
|
82, 5.14, 1032,
|
||||||
|
new City("Clermont-Ferrand", 45.777222, 3.087025)
|
||||||
|
),
|
||||||
|
new Weather("2023-01-22 09:55:59", 10000, "Nuageux",
|
||||||
|
"couvert", 0.52, -4.34,
|
||||||
|
82, 5.14, 1032,
|
||||||
|
new City("Lyon", 45.764043, 4.835659)
|
||||||
|
),
|
||||||
|
new Weather("2023-01-22 09:55:59", 10000, "Nuageux",
|
||||||
|
"couvert", 0.52, -4.34,
|
||||||
|
82, 5.14, 1032,
|
||||||
|
new City("Marseille", 43.296482, 5.36978)
|
||||||
|
),
|
||||||
|
new Weather("2023-01-22 09:55:59", 10000, "Nuageux",
|
||||||
|
"couvert", 0.52, -4.34,
|
||||||
|
82, 5.14, 1032,
|
||||||
|
new City("Bruxelles", 50.85034, 4.35171)
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
export const getCurrentWeather = (cityName: string) => {
|
||||||
|
if (cityName === undefined) return {};
|
||||||
|
return WEATHER_DATA.filter(elt => elt.city.name === cityName)[0];
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "expo-init",
|
||||||
|
"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": "~47.0.12",
|
||||||
|
"expo-status-bar": "~1.4.2",
|
||||||
|
"react": "18.1.0",
|
||||||
|
"react-dom": "18.1.0",
|
||||||
|
"react-native": "0.70.5",
|
||||||
|
"react-native-web": "~0.18.9"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.12.9",
|
||||||
|
"@types/react": "~18.0.14",
|
||||||
|
"@types/react-native": "~0.70.6",
|
||||||
|
"typescript": "^4.6.3"
|
||||||
|
},
|
||||||
|
"private": true
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "expo/tsconfig.base",
|
||||||
|
"compilerOptions": {
|
||||||
|
"strict": true
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue