Skip to content
Snippets Groups Projects
Verified Commit 021283f5 authored by Mikolai Gütschow's avatar Mikolai Gütschow
Browse files

show UiPlaceholder if no contact selected

parent c9dc349f
No related branches found
No related tags found
1 merge request!33Finish view model for contact list
......@@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier
import org.briarproject.briar.desktop.contact.ContactInfoDrawerState.MakeIntro
import org.briarproject.briar.desktop.contact.ContactList
import org.briarproject.briar.desktop.contact.ContactsViewModel
import org.briarproject.briar.desktop.ui.UiPlaceholder
import org.briarproject.briar.desktop.ui.VerticalDivider
@Composable
......@@ -24,7 +25,7 @@ fun PrivateMessageView(
ContactList(contacts)
VerticalDivider()
Column(modifier = Modifier.weight(1f).fillMaxHeight()) {
contacts.selectedContact.value?.let { selectedContact ->
contacts.selectedContact.value?.also { selectedContact ->
Conversation(
selectedContact,
contacts.contactList,
......@@ -34,7 +35,7 @@ fun PrivateMessageView(
setInfoDrawer,
contactDrawerState
)
}
} ?: UiPlaceholder()
}
}
}
package org.briarproject.briar.desktop.ui
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import org.briarproject.briar.desktop.contact.ContactsViewModel
import org.briarproject.briar.desktop.conversation.PrivateMessageView
import org.briarproject.briar.desktop.navigation.BriarSidebar
......@@ -35,9 +29,7 @@ fun MainScreen(
when (uiMode) {
UiMode.CONTACTS -> PrivateMessageView(contactsViewModel)
UiMode.SETTINGS -> PlaceHolderSettingsView(isDark, setDark)
else -> Surface(modifier = Modifier.fillMaxSize().background(MaterialTheme.colors.background)) {
Text("TBD")
}
else -> UiPlaceholder()
}
}
}
package org.briarproject.briar.desktop.ui
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@Composable
fun UiPlaceholder() = Surface(Modifier.fillMaxSize().background(MaterialTheme.colors.background)) {
Text("TBD")
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment