Compare commits

4 Commits

Author SHA1 Message Date
3c80ac3125 Fix bug with error when decoding 2020-07-10 18:54:32 +02:00
db5a363bff Merge branch 'retheme' 2020-02-09 00:38:26 +01:00
bc6b12afa1 Blocking scroll to reload 2019-07-30 16:06:22 +00:00
6424f66732 Blocking pull to reload. 2019-07-30 16:02:43 +00:00
3 changed files with 726 additions and 651 deletions

View File

@ -4,69 +4,76 @@ import Refresh from "feather-icons/dist/icons/refresh-cw.svg";
import "./footer.scss";
import Notifications from "../notifications";
export class Footer extends Component<{}, { synced: boolean, syncing: boolean }> {
constructor(props) {
super(props);
this.state = { synced: false, syncing: false };
this.onSyncedChange = this.onSyncedChange.bind(this);
this.onSyncChange = this.onSyncChange.bind(this);
}
export class Footer extends Component<
{},
{ synced: boolean; syncing: boolean }
> {
constructor(props) {
super(props);
this.state = { synced: false, syncing: false };
this.onSyncedChange = this.onSyncedChange.bind(this);
this.onSyncChange = this.onSyncChange.bind(this);
}
async componentWillMount() {
Notes.syncedObservable.subscribe(this.onSyncedChange);
Notes.syncObservable.subscribe(this.onSyncChange);
this.setState({ synced: await Notes.isSynced() })
}
async componentWillMount() {
Notes.syncedObservable.subscribe(this.onSyncedChange);
Notes.syncObservable.subscribe(this.onSyncChange);
this.setState({ synced: await Notes.isSynced() });
}
componentWillUnmount() {
Notes.syncedObservable.unsubscribe(this.onSyncedChange);
Notes.syncObservable.unsubscribe(this.onSyncChange);
}
componentWillUnmount() {
Notes.syncedObservable.unsubscribe(this.onSyncedChange);
Notes.syncObservable.unsubscribe(this.onSyncChange);
}
onSyncChange(state: boolean) {
console.log("sync", state);
this.setState({ syncing: state })
}
onSyncChange(state: boolean) {
console.log("sync", state);
this.setState({ syncing: state });
}
onSyncedChange(state: boolean) {
console.log("synced", state);
this.setState({ synced: state })
}
onSyncedChange(state: boolean) {
console.log("synced", state);
this.setState({ synced: state });
}
onSyncClick() {
Notes.sync().then(() => {
Notifications.sendInfo("Finished Synchronisation");
})
}
onSyncClick() {
Notes.sync().then(() => {
Notifications.sendInfo("Finished Synchronisation");
});
}
render() {
let extrac = undefined;
let color;
let text;
if (this.state.syncing) {
color = "orange";
text = "syncing";
extrac = "reloading"
} else {
if (this.state.synced) {
color = "green";
text = "synced";
} else {
color = "red";
text = "not synced";
}
}
return <footer class="elv-8">
render() {
let extrac = undefined;
let color;
let text;
if (this.state.syncing) {
color = "orange";
text = "syncing";
extrac = "reloading";
} else {
if (this.state.synced) {
color = "green";
text = "synced";
} else {
color = "red";
text = "not synced";
}
}
return (
<footer class="elv-8">
<span>
<span class={extrac} ><a onClick={() => this.onSyncClick()} ><Refresh style="height: 1em; width: 1em;"></Refresh></a></span>
<span style={"margin-left: 8px; color:" + color}>{text}</span>
<span class={extrac}>
<a onClick={() => this.onSyncClick()}>
<Refresh style="height: 1em; width: 1em;"></Refresh>
</a>
</span>
<span style={"margin-left: 8px; color:" + color}>{text}</span>
</span>
<span>
Welcome <b>{Notes.name}</b>
Welcome <b>{Notes.name}</b>
</span>
<span style="color: lightgrey;">
v1.4
</span>
</footer>
}
}
<span style="color: lightgrey;">v1.5</span>
</footer>
);
}
}

8
src/index.scss Executable file → Normal file
View File

@ -1,5 +1,8 @@
@import "./vars.scss";
body {
overscroll-behavior-y: contain;
}
// html {
// min-height: 100%;
@ -49,6 +52,11 @@
// }
body {
overscroll-behavior-y: contain;
}
.def-shadow {
box-shadow: 0px 5px 8px 2px rgba(66, 66, 66, 0.53);
}

File diff suppressed because it is too large Load Diff