Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing the implementation of the app to React-Native #6

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions .expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules/
.expo/
dist/
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store
91 changes: 91 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { StyleSheet, Text, View, TextInput, Button } from 'react-native';
import { useState } from 'react';



export default function App() {

// -------------------- states ---------------------------------------


// ------------------- event handlers ---------------------------------


// a function that listens for words for user to enter

function wordInputHandler(enteredText) {
console.log(enteredText)
};

// a function that fires up when Translate button is clicked

function translateHandler() {

};




// ------------------------------ The app view --------------------------

return (
<View style={styles.container}>

<View style={styles.InputContainer}>

<TextInput placeholder='type any word...' style={styles.textInput} onChangeText={wordInputHandler}/>
<Button title='Translate' onPress={translateHandler} />

</View>

<View style={styles.goalsContainer}>

</View>

</View>
);
}



// --------------------- styling ----------------------------------------

const styles = StyleSheet.create(
{
container: {
padding: 50,
flex: 1,
paddingHorizontal: 30,
borderWidth: 1,
borderColor: 'blue'
},

InputContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: 24,
borderBottomWidth: 1,
borderBottomColor: 'black',
flex: 1,

},

textInput: {
borderWidth: 1,
borderColor: 'blue',
width: '70%',
marginRight: 10,
padding: 8,
},


goalsContainer: {
flex: 4

}

}
);


11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Translator-Flutter-App
Translator Flutter App designed to translate between native Australian languages.
# Translator-React-App
Translator React-Native App designed to translate between native Australian languages.

### Contributors
1. @DotNickCore
1. @DotNickCore (Nick)
2. @haisoncao
3. @bismillah-s

## Instruction on how to run the App.

Run `npm start` in the same directory. This will generate a QR-Code which you can scan on the Expo Go App (https://expo.dev/client), which allows you to see real time changes to the App.

For further information on how to run the App, <a href='https://reactnative.dev/docs/environment-setup'> read the environment setup </a>
33 changes: 33 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"expo": {
"name": "Translator-Flutter-App",
"slug": "Translator-Flutter-App",
"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"
}
}
}
Binary file added assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
Loading