Fix register view on WASM, remove edit buttons when viewing non-editable project
This commit is contained in:
@@ -181,7 +181,6 @@ fun LoginView(server: String?, error: String?, onSwitchSignup: () -> Unit, onLog
|
|||||||
Text("Log in", style = MaterialTheme.typography.headlineMedium)
|
Text("Log in", style = MaterialTheme.typography.headlineMedium)
|
||||||
|
|
||||||
ServerSelect(serverUrl) { serverUrl = it }
|
ServerSelect(serverUrl) { serverUrl = it }
|
||||||
// OutlinedTextField(serverUrl, { serverUrl = it }, Modifier.fillMaxWidth(), label = { Text("Server URL") }, singleLine = true)
|
|
||||||
|
|
||||||
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
||||||
OutlinedTextField(password, { password = it }, Modifier.fillMaxWidth(), label = { Text("Password") }, visualTransformation = PasswordVisualTransformation(), singleLine = true)
|
OutlinedTextField(password, { password = it }, Modifier.fillMaxWidth(), label = { Text("Password") }, visualTransformation = PasswordVisualTransformation(), singleLine = true)
|
||||||
@@ -213,7 +212,7 @@ fun SignupView(server: String?, error: String?, onSwitchLogin: () -> Unit, onSig
|
|||||||
Column(Modifier.padding(5.dp).widthIn(min = 250.dp).width(IntrinsicSize.Min), horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(Modifier.padding(5.dp).widthIn(min = 250.dp).width(IntrinsicSize.Min), horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
Text("Sign up", style = MaterialTheme.typography.headlineMedium)
|
Text("Sign up", style = MaterialTheme.typography.headlineMedium)
|
||||||
|
|
||||||
OutlinedTextField(serverUrl, { serverUrl = it }, Modifier.fillMaxWidth(), label = { Text("Server URL") }, singleLine = true)
|
ServerSelect(serverUrl) { serverUrl = it }
|
||||||
|
|
||||||
OutlinedTextField(inviteCode, { inviteCode = it }, Modifier.fillMaxWidth(), label = { Text("Invite code") }, singleLine = true)
|
OutlinedTextField(inviteCode, { inviteCode = it }, Modifier.fillMaxWidth(), label = { Text("Invite code") }, singleLine = true)
|
||||||
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ fun ProjectView(id: Uuid, forceBack: () -> Unit) {
|
|||||||
Box(Modifier.fillMaxSize().padding(15.dp)) {
|
Box(Modifier.fillMaxSize().padding(15.dp)) {
|
||||||
ProjectPlotArea(vm)
|
ProjectPlotArea(vm)
|
||||||
|
|
||||||
|
if(editable) {
|
||||||
if(addOpen) {
|
if(addOpen) {
|
||||||
CompositionLocalProvider(LocalIndication provides NoFeedbackIndication()) {
|
CompositionLocalProvider(LocalIndication provides NoFeedbackIndication()) {
|
||||||
Box(Modifier.clickable { addOpen = false }.fillMaxSize())
|
Box(Modifier.clickable { addOpen = false }.fillMaxSize())
|
||||||
@@ -123,6 +124,7 @@ fun ProjectView(id: Uuid, forceBack: () -> Unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(editing) ProjectEditDialog(name ?: "Unnamed Project", public, { editing = false }) { name, public ->
|
if(editing) ProjectEditDialog(name ?: "Unnamed Project", public, { editing = false }) { name, public ->
|
||||||
vm.update(name, public)
|
vm.update(name, public)
|
||||||
@@ -621,6 +623,7 @@ fun ProjectPlotArea(vm: ProjectVM){
|
|||||||
}
|
}
|
||||||
else Icon(Lucide.RulerDimensionLine, "Use as baseline")
|
else Icon(Lucide.RulerDimensionLine, "Use as baseline")
|
||||||
}
|
}
|
||||||
|
if(editable) {
|
||||||
IconButton({ deletingVersion = lbl }, Modifier.align(Alignment.CenterVertically)) {
|
IconButton({ deletingVersion = lbl }, Modifier.align(Alignment.CenterVertically)) {
|
||||||
Icon(Lucide.Trash, "Delete version")
|
Icon(Lucide.Trash, "Delete version")
|
||||||
}
|
}
|
||||||
@@ -630,6 +633,7 @@ fun ProjectPlotArea(vm: ProjectVM){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Spacer(Modifier.width(15.dp))
|
Spacer(Modifier.width(15.dp))
|
||||||
LazyColumn(Modifier.weight(0.5f)) {
|
LazyColumn(Modifier.weight(0.5f)) {
|
||||||
item { Text("Inputs", style = MaterialTheme.typography.headlineSmall) }
|
item { Text("Inputs", style = MaterialTheme.typography.headlineSmall) }
|
||||||
|
|||||||
Reference in New Issue
Block a user