-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-react.tsx
188 lines (155 loc) · 4.23 KB
/
demo-react.tsx
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
"use strict";
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {debugHistory} from "./router";
import {contextJs} from "./install";
var queryString = window.location.search;
let params = new URLSearchParams(queryString);
let pod = params.get("pod");
switch (pod) {
case "none":
contextJs.installer.installLocalAuthForLocalInstallation(contextJs, (error) => {
error && debugHistory.error(error)
})
break;
case "mock":
contextJs.podAPI = parent.api
contextJs.installer.installLocalAuthForLocalInstallation(contextJs, (error) => {
error && debugHistory.error(error)
})
contextJs.cache.podAPI = parent.api
parent && parent.setUserCVUs();
break;
case undefined:
case null:
break;
default:
contextJs.installer.installLocalAuthForExistingPod(contextJs, pod, "", localStorage.ownerKey, localStorage.databaseKey, (error) => {
error && debugHistory.error(error)
})
break;
}
console.log(contextJs);
import {Application} from "./memri/gui/Application";
function importCssString(cssText, id) {
cssText += "\n/*# sourceURL=css:/" + id + " */";
var style = document.createElement("style");
style.appendChild(document.createTextNode(cssText));
document.head.appendChild(style);
};
importCssString(`
/* Frutiger Neue LT - main font */
@font-face {
font-family: 'Frutiger Neue LT';
src: url('/memri/Resources/fonts/FrutigerNeueLT.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Frutiger Neue LT';
src: url('/memri/Resources/fonts/FrutigerNeueLTLight.woff') format('woff');
font-weight: 100;
}
@font-face {
font-family: 'Frutiger Neue LT';
src: url('/memri/Resources/fonts/FrutigerNeueLTBook.woff') format('woff');
font-weight: 300;
}
@font-face {
font-family: 'Frutiger Neue LT';
src: url('/memri/Resources/fonts/FrutigerNeueLTBold.woff') format('woff');
font-weight: 500;
}
@font-face {
font-family: 'Frutiger Neue LT';
src: url('/memri/Resources/fonts/FrutigerNeueLTHeavy.woff') format('woff');
font-weight: 600;
}
body {margin: 0; font-family: 'Frutiger Neue LT', sans-serif;}
.Application {
display: flex;
align-items: center;
justify-content: center;
}
.ScreenSizer {
outline: solid;
}
.HStack {
flex-direction: row;
display: flex;
box-sizing: border-box;
}
.MemriText {
box-sizing: border-box;
}
.VStack {
flex-direction: column;
display: flex;
box-sizing: border-box;
}
.ZStack {
display: grid;
position: relative;
box-sizing: border-box;
}
.ZStack > * {
grid-area: 1/1/1/1;
}
::-webkit-scrollbar {
width: 3px;
}
::-webkit-scrollbar-thumb {
background: #8888;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
.NavigationView .NavigationViewContent .MuiButton-root {
width: 100%;
}
.NavigationView .NavigationViewContent .Form {
margin-left: 5%;
margin-right: 5%;
width: 90%;
}
.NavigationView .NavigationViewContent .NavigationLink.MuiButton-root {
background: #fff;
justify-content: space-between
}
.NavigationView .NavigationViewContent .SectionContent {
background: #fff;
margin-left: 10px;
margin-right: 10px;
border-radius: 10px;
padding: 5px;
align-items: center
}
.NavigationView .NavigationViewContent .Section .MemriText {
margin-left: 25px;
margin-top: 10px;
margin-bottom: 10px;
color: #888
}
.NavigationView .NavigationViewContent .SectionContent .MemriText {
color: #000;
margin: 0px;
}
.NavigationView .NavigationViewContent .HStack .MemriText {
color: #000;
margin: 0px;
}
.NavigationView .NavigationViewContent .MemriRealButton .MemriText {
color: #1d88ff;
margin: 0px;
}
.NavigationView .MemriList .MemriRealButton .MemriText, .NavigationView .MemriRealButton .NavigationLink .MemriText {
color: #000
}
`, "main.css")
function App() {//TODO: don't ask, please, about link inside div =)
return <div><link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<Application context={contextJs}/>
</div>
}
var div = document.body.appendChild(document.createElement("div"))
ReactDOM.render(App(), div)