-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
BasicDrawer.svelte
82 lines (79 loc) · 2.53 KB
/
BasicDrawer.svelte
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<script lang="typescript">
import { Drawer } from '@nativescript-community/ui-drawer';
let drawer: Drawer;
function onOpenDrawer() {
drawer.open();
}
function onCloseDrawer() {
drawer.close();
}
</script>
<page>
<actionBar title="Basic Drawer" />
<drawer bind:this={drawer} class="drawer">
<gridlayout prop:leftDrawer width="300" backgroundColor="white" rows="auto, *">
<stacklayout row="0">
<stacklayout backgroundColor="#eeeeee" padding="25">
<gridlayout columns="80, *" height="100">
<stacklayout col="0" class="avatar">
<label text="JS" />
</stacklayout>
</gridlayout>
<stacklayout>
<label text="John Smith" fontWeight="bold" />
<label text="john.smith@example.com" />
</stacklayout>
</stacklayout>
<stacklayout>
<button text="My Profile" class="button" on:tap={onCloseDrawer} />
<button text="Settings" class="button" on:tap={onCloseDrawer} />
<button text="Rate Us" class="button" on:tap={onCloseDrawer} />
<button text="Support" class="button" on:tap={onCloseDrawer} />
<button text="Contact" class="button" on:tap={onCloseDrawer} />
</stacklayout>
</stacklayout>
</gridlayout>
<stacklayout prop:mainContent backgroundColor="white">
<button on:tap={onOpenDrawer} text="Open Drawer" width="250" marginTop="25" />
</stacklayout>
</drawer>
</page>
<style>
ActionBar {
background-color: #b52e31;
color: white;
}
.avatar {
background-color: #b52e31;
border-radius: 40;
height: 80;
vertical-align: middle;
}
.avatar Label {
vertical-align: middle;
horizontal-align: center;
font-size: 30;
color: white;
}
.drawer .button {
background-color: transparent;
margin: 0;
padding: 0;
border-color: #ccc;
z-index: 0;
border-width: 0 0 0.5 0;
color: #222222;
text-align: left;
padding-left: 25;
height: 50;
font-size: 14;
}
.drawer .button:highlighted {
background-color: #eeeeee;
color: #222222;
}
Button {
background-color: #b52e31;
color: white;
}
</style>