Skip to content

Commit

Permalink
[improvement] improve home and profile screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Achintha Isuru committed May 6, 2024
1 parent c4d54cb commit 82a0818
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ fun ProfileScreenContent(
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
ProfileImage(imageUrl = state.user?.imageUrl ?: "")
NameSection(
firstName = state.user?.firstName,
lastName = state.user?.lastName
)
if (state.user?.firstName != null || state.user?.lastName != null) {
NameSection(
firstName = state.user.firstName,
lastName = state.user.lastName
)
}
}
Spacer(modifier = Modifier.height(32.dp))
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.wso2_sample.api_auth_sample.features.home.domain.models.pet.Pet

Expand All @@ -42,9 +44,20 @@ fun PetsList(pets: List<Pet>) {
Column(
modifier = Modifier
.padding(top = 16.dp)
.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(16.dp)
.fillMaxWidth()
.align(Alignment.CenterHorizontally),
verticalArrangement = Arrangement.spacedBy(16.dp),
) {

if (pets.isEmpty()) {
Text(
text = "You don't have any pets yet",
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.tertiaryContainer,
textAlign = TextAlign.Center
)
}

pets.forEach { pet ->
PetCard(pet = pet)
}
Expand Down

0 comments on commit 82a0818

Please sign in to comment.