Attempt to implement settings syncing

This commit is contained in:
ransurf 2021-10-10 21:08:13 -07:00
parent b53b8758ba
commit 9824d2ba31
10 changed files with 118 additions and 10 deletions

View file

@ -1,12 +1,15 @@
import * as React from "react";
import { getTasks } from "./habiticaAPI"
import TodoItem from "./TodoItem"
const username = "<key>"
const credentials = "<key>"
let username = ""
let credentials = ""
class App extends React.Component<any,any> {
constructor(props: any) {
super(props)
username = this.props.username
credentials = this.props.apiToken
this.state = {
isLoaded: false,
tasks: ""
@ -40,7 +43,8 @@ class App extends React.Component<any,any> {
return <div>Loading...</div>;
} else {
const listItems = tasks.map((tasks: any) =>
<li>{tasks.text}</li>
<TodoItem key={tasks.id} task={tasks}/>
);
return (
<ul>{listItems}</ul>

12
view/TodoItem.tsx Normal file
View file

@ -0,0 +1,12 @@
import * as React from "react";
function TodoItem(props: any) {
return (
<div className="todo-item">
<input type="checkbox" />
<p>{props.task.text}</p>
</div>
)
}
export default TodoItem