-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6984a4
commit d26d041
Showing
9 changed files
with
195 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
> Why do I have a folder named ".expo" in my project? | ||
The ".expo" folder is created when an Expo project is started using "expo start" command. | ||
|
||
> What do the files contain? | ||
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds. | ||
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator. | ||
- "settings.json": contains the server configuration that is used to serve the application manifest. | ||
|
||
> Should I commit the ".expo" folder? | ||
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine. | ||
|
||
Upon project creation, the ".expo" folder is already added to your ".gitignore" file. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"hostType": "lan", | ||
"lanType": "ip", | ||
"dev": true, | ||
"minify": false, | ||
"urlRandomness": null, | ||
"https": 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,53 @@ | ||
import { Pressable, StyleSheet, Text, View } from 'react-native'; | ||
import { Pressable, StyleSheet, Text, View, Image, Vibration, Platform } from 'react-native'; | ||
import Icon from 'react-native-vector-icons/dist/FontAwesome'; | ||
|
||
export default function Button({ text, pressHandler }) { | ||
export default function Button({ text, pressHandler, type }) { | ||
const ONE_SECOND_IN_MS = 1000; | ||
|
||
return ( | ||
<Pressable onPress={() => pressHandler()} style={[styles.button]}><Text style={[styles.text]}>C</Text></Pressable> | ||
); | ||
const PATTERN = [ | ||
1 * ONE_SECOND_IN_MS, | ||
2 * ONE_SECOND_IN_MS, | ||
3 * ONE_SECOND_IN_MS, | ||
]; | ||
|
||
const PATTERN_DESC = | ||
Platform.OS === 'android' | ||
? 'wait 1s, vibrate 2s, wait 3s' | ||
: 'wait 1s, vibrate, wait 2s, vibrate, wait 3s'; | ||
|
||
|
||
|
||
if (text == "back") { | ||
return <Pressable onPress={() => {pressHandler();Vibration.vibrate(10 * ONE_SECOND_IN_MS)}} style={[styles.button, {backgroundColor: "#2F2F39"}]}><Image source={require("../assets/delete-left-white.png")} style={[{width: 30, height: 30, color: "#fff"}]} /></Pressable> | ||
} | ||
|
||
|
||
if (type == "t1") { | ||
return ( | ||
<Pressable onPress={() => {pressHandler();Vibration.vibrate(10 * ONE_SECOND_IN_MS)}} style={[styles.button]}><Text style={[styles.text]}>{text}</Text></Pressable> | ||
); | ||
} | ||
|
||
if (type == "t2") { | ||
return <Pressable onPress={() => {pressHandler();Vibration.vibrate(10 * ONE_SECOND_IN_MS)}} style={[styles.button, {backgroundColor: "#4D5CFB"}]}><Text style={[styles.text]}>{text}</Text></Pressable> | ||
} | ||
|
||
if (type == "t3") { | ||
return ( | ||
<Pressable onPress={() => {pressHandler();Vibration.vibrate(10 * ONE_SECOND_IN_MS)}} style={[styles.button, {backgroundColor: "#2F2F39"}]}><Text style={[styles.text]}>{text}</Text></Pressable> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
button: { | ||
width: 50, height: 50, padding: 10, backgroundColor: "#4E505F", display: "flex", flexDirection: "row", justifyContent: "center", alignItems: "center", borderRadius: 15 | ||
width: 75, height: 75, padding: 10, backgroundColor: "#4E505F", display: "flex", flexDirection: "row", justifyContent: "center", alignItems: "center", borderRadius: 20 | ||
}, | ||
text: { | ||
color: "#fff", | ||
display: "flex" | ||
display: "flex", | ||
fontSize: 25, | ||
fontWeight: "600" | ||
} | ||
|
||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
> Why do I have a folder named ".expo" in my project? | ||
The ".expo" folder is created when an Expo project is started using "expo start" command. | ||
|
||
> What do the files contain? | ||
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds. | ||
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator. | ||
- "settings.json": contains the server configuration that is used to serve the application manifest. | ||
|
||
> Should I commit the ".expo" folder? | ||
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine. | ||
|
||
Upon project creation, the ".expo" folder is already added to your ".gitignore" file. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"hostType": "lan", | ||
"lanType": "ip", | ||
"dev": true, | ||
"minify": false, | ||
"urlRandomness": null, | ||
"https": false | ||
} |