From 7fa57e35be602c95440c1aa9ad82d6bb22d8d6f0 Mon Sep 17 00:00:00 2001 From: Marnanel Thurman Date: Fri, 10 Dec 2021 23:58:57 +0000 Subject: [PATCH] Start of moving to expo. grok.js still doesn't work because it relies on the cordova advanced-http library. Moved images to the new correct folder. --- .babelrc | 1 - App.js | 130 +++++++++++++++++++++++ app.json | 35 ++++++ assets/images/adaptive-icon.png | Bin 345203 -> 252040 bytes assets/images/favicon.png | Bin 3391 -> 2408 bytes assets/images/hdpi.png | Bin 5747 -> 3784 bytes assets/images/icon.png | Bin 3391 -> 2408 bytes assets/images/ldpi.png | Bin 2336 -> 1780 bytes assets/images/{pxxxhdpi.png => logo.png} | Bin assets/images/mdpi.png | Bin 3391 -> 2408 bytes assets/images/padaptive-icon.png | Bin 252040 -> 0 bytes assets/images/pfavicon.png | Bin 2408 -> 0 bytes assets/images/phdpi.png | Bin 3784 -> 0 bytes assets/images/picon.png | Bin 2408 -> 0 bytes assets/images/pldpi.png | Bin 1780 -> 0 bytes assets/images/pmdpi.png | Bin 2408 -> 0 bytes assets/images/psplash.png | Bin 64423 -> 0 bytes assets/images/pxhdpi.png | Bin 5040 -> 0 bytes assets/images/pxxhdpi.png | Bin 7837 -> 0 bytes assets/images/splash.png | Bin 83383 -> 64423 bytes assets/images/xhdpi.png | Bin 7774 -> 5040 bytes assets/images/xxhdpi.png | Bin 12241 -> 7837 bytes assets/images/xxxhdpi.png | Bin 16941 -> 10829 bytes src/grok.js => grok.js | 10 +- www/lavender-dream-by-huhu.jpg | Bin 82684 -> 0 bytes 25 files changed, 174 insertions(+), 2 deletions(-) delete mode 100644 .babelrc create mode 100644 App.js create mode 100644 app.json rename assets/images/{pxxxhdpi.png => logo.png} (100%) delete mode 100644 assets/images/padaptive-icon.png delete mode 100644 assets/images/pfavicon.png delete mode 100644 assets/images/phdpi.png delete mode 100644 assets/images/picon.png delete mode 100644 assets/images/pldpi.png delete mode 100644 assets/images/pmdpi.png delete mode 100644 assets/images/psplash.png delete mode 100644 assets/images/pxhdpi.png delete mode 100644 assets/images/pxxhdpi.png rename src/grok.js => grok.js (95%) delete mode 100644 www/lavender-dream-by-huhu.jpg diff --git a/.babelrc b/.babelrc deleted file mode 100644 index f9e1d60..0000000 --- a/.babelrc +++ /dev/null @@ -1 +0,0 @@ -{ "presets": ["@babel/preset-env", "@babel/preset-react"] } diff --git a/App.js b/App.js new file mode 100644 index 0000000..48af548 --- /dev/null +++ b/App.js @@ -0,0 +1,130 @@ +import React from 'react'; +import { + StyleSheet, Text, View, TextInput, + Image, + Button, +} from 'react-native'; +import { + grok_set_url, + grok_login1, + grok_login2, +} from './grok.js'; +import logo from './assets/images/logo.png'; + +export default class App extends React.Component { + + state = { + username: '', + password: '', + message: '...', + }; + + constructor(props) { + super(props); + }; + + handle_login1(login1) { + ui_login_show_message("Logging in..."); + grok_login2( + this.handle_login2, + login1['auth'], + this.state.username, + this.state.password, + ) + } + + start_login() { + console.log('Start login!'); + console.log(this.state); + this.setState({ + message: 'Connecting...', + }); + grok_login1(this.handle_login1); + }; + + ui_login_show_message(message) { + $("#login-message").show().text(message); + console.log(message); + }; + + render() { + return ( + + + + + + Welcome to dwim! + + Username: + { this.state.username = text} } + style={styles.input} + /> + + Password: + { this.state.password = text} } + secureTextEntry={true} + style={styles.input} + /> + +