diff --git a/.gitignore b/.gitignore index 67cfd3f8..397f0537 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,7 @@ dist .nyc_output .tox .pytest_cache -android/app/src/main/assets/vendor.js -android/app/src/main/assets/android.js +android/app/src/main/assets ios/send-ios/assets/ios.js ios/send-ios/assets/vendor.js ios/send-ios.xcodeproj/project.xcworkspace/xcuserdata/* diff --git a/android/android.js b/android/android.js index a19dd05e..4fc7c85e 100644 --- a/android/android.js +++ b/android/android.js @@ -20,12 +20,42 @@ window.DEFAULTS = { }; const choo = require('choo'); +const html = require('choo/html'); +const assets = require('../common/assets'); +const header = require('../app/ui/header'); +const locale = require('../common/locales'); +const home = require('../app/ui/home'); const app = choo(); +function body(main) { + return function(state, emit) { + return html`
+ ${header(state, emit)} + +
+
+ ${main(state, emit)}
+ `;
+
+ function clickPreferences(event) {
+ event.preventDefault();
+ emit('pushState', '/preferences');
+ }
+ };
+}
+
+app.use((state, emitter) => {
+ state.translate = locale.getTranslator();
+ state.capabilities = {}; //TODO
+
+ // for debugging
+ window.appState = state;
+ window.appEmit = emitter.emit.bind(emitter);
+});
app.use(require('./stores/state').default);
app.use(require('../app/fileManager').default);
app.use(require('./stores/intents').default);
-app.route('/', require('./pages/home').default);
+app.route('/', body(home));
app.route('/options', require('./pages/options').default);
app.route('/upload', require('./pages/upload').default);
app.route('/share/:id', require('./pages/share').default);
diff --git a/android/app/src/main/assets/background_1.jpg b/android/app/src/main/assets/background_1.jpg
deleted file mode 100644
index c92d3fb1..00000000
Binary files a/android/app/src/main/assets/background_1.jpg and /dev/null differ
diff --git a/android/app/src/main/assets/cloud-upload.png b/android/app/src/main/assets/cloud-upload.png
deleted file mode 100644
index 1667ca78..00000000
Binary files a/android/app/src/main/assets/cloud-upload.png and /dev/null differ
diff --git a/android/app/src/main/assets/copy-link.png b/android/app/src/main/assets/copy-link.png
deleted file mode 100644
index 31ad553d..00000000
Binary files a/android/app/src/main/assets/copy-link.png and /dev/null differ
diff --git a/android/app/src/main/assets/encrypted-envelope.png b/android/app/src/main/assets/encrypted-envelope.png
deleted file mode 100644
index 94073533..00000000
Binary files a/android/app/src/main/assets/encrypted-envelope.png and /dev/null differ
diff --git a/android/app/src/main/assets/index.css b/android/app/src/main/assets/index.css
deleted file mode 100644
index c1e37fad..00000000
--- a/android/app/src/main/assets/index.css
+++ /dev/null
@@ -1,124 +0,0 @@
-html {
- height: 100vh;
-}
-
-body {
- box-sizing: border-box;
- margin: 0;
- min-height: 100vh;
- background-image: repeating-linear-gradient(
- 45deg,
- white,
- white 5px,
- #ea000e 5px,
- #ea000e 25px,
- white 25px,
- white 30px,
- #0083ff 30px,
- #0083ff 50px
- );
-}
-
-#white {
- display: flex;
- flex-direction: column;
- min-height: 100vh;
- background-color: white;
- margin: 0 10px;
- padding: 10px;
- text-align: center;
-}
-
-#centering {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- height: 100%;
- width: 100%;
-}
-
-#label {
- position: fixed;
- right: 2em;
- bottom: 1em;
-}
-
-#label img {
- height: 60px;
- width: 60px;
-}
-
-#input {
- display: none;
-}
-
-#url {
- display: none;
-}
-
-#copy-link {
- text-align: right;
-}
-
-#copy-image {
- position: relative;
- top: 6px;
- height: 30px;
- width: 30px;
-}
-
-.spacer {
- height: 12em;
-}
-
-#send-another {
- margin-bottom: 1em;
- height: 60px;
- width: 60px;
- position: fixed;
- right: 2em;
- bottom: 1em;
-}
-
-.card {
- margin: 6px;
- padding: 6px;
- border: 1px solid white;
- border-radius: 5px;
- box-shadow: 5px 5px 5px 5px #d5d5d5;
- text-align: left;
-}
-
-.progress {
- display: inline-block;
- height: 4px;
- border-radius: 2px;
- background-color: #1b96ef;
- color: white;
-}
-
-.cancel {
- text-align: right;
-}
-
-#preferences {
- text-align: left;
-}
-
-#hamburger {
- position: fixed;
- right: 2em;
- top: 1em;
-}
-
-#top-banner {
- position: fixed;
- top: 1em;
- left: 2em;
-}
-
-#options {
- text-align: left;
-}
diff --git a/android/app/src/main/assets/index.html b/android/app/src/main/assets/index.html
deleted file mode 100644
index 404ff156..00000000
--- a/android/app/src/main/assets/index.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-