aboutsummaryrefslogtreecommitdiff
path: root/static/pages/settings/index.js
blob: c11a3e9db6af6a76b3a7d661f814f8299a606059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import * as sfw from 'sfw';
const { Div, Img } = sfw.element.native;

import Editable from '../../widgets/editable/index.js';

import icons from '../../icons/index.js';

const css = await sfw.css(import.meta.url, './index.css');

export default class SettingsView extends sfw.element.Container {
	constructor() {
		super({ css });
		
		this.onlogout = () => {};

		this.body.append(
			Div.new({
				id: 'container',
				children: [
					Div.new({
						id: 'profile-image',
						children: [
							Div.new({
								id: 'image-container',
								children: [
									Img.new(),
								]
							}),
							Div.new({
								id: 'edit',
								children: [ icons.edit ]
							}),
						]
					}),
					Editable.new({
						title: 'Name',
						value: 'Nathan Reiner'
					}),
					Editable.new({
						title: 'Birthday',
						type: 'date',
						value: '2002-08-06',
					}),
					Div.new({
						id: 'logout',
						innerText: 'Logout',
						onclick: () => this.onlogout(),
					}),
					Div.new({
						id: 'info-box',
						children: [
							Div.new({ id: 'name', innerText: 'Memora' }),
							Div.new({ id: 'version', innerText: '0.0.1-unstable' }),
						]
					}),
				]
			})
		)
	}
}