Skip to content

Commit

Permalink
feat: add on profile account details btn WPB-970
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-kaczmarek committed Nov 21, 2024
1 parent 7cd4bd6 commit 370094d
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ package com.wire.android.mapper
import com.wire.android.ui.home.conversations.avatar
import com.wire.android.ui.userprofile.self.model.OtherAccount
import com.wire.android.util.ui.WireSessionImageLoader
import com.wire.kalium.logic.data.team.Team
import com.wire.kalium.logic.data.user.SelfUser
import javax.inject.Inject

class OtherAccountMapper @Inject constructor(
private val wireSessionImageLoader: WireSessionImageLoader
) {
fun toOtherAccount(selfUser: SelfUser, team: Team?): OtherAccount = OtherAccount(
fun toOtherAccount(selfUser: SelfUser): OtherAccount = OtherAccount(
id = selfUser.id,
fullName = selfUser.name ?: "",
avatarData = selfUser.avatar(wireSessionImageLoader, selfUser.connectionStatus),
teamName = team?.name
handle = selfUser.handle
)
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class SelfUserProfileViewModel @Inject constructor(
Pair(
selfUser,
list.filter { it.first.id != selfUser.id }
.map { (selfUser, team) -> otherAccountMapper.toOtherAccount(selfUser, team) }
.map { (selfUser, _) -> otherAccountMapper.toOtherAccount(selfUser) }
)
}
.distinctUntilChanged()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ data class OtherAccount(
val id: UserId,
val fullName: String,
val avatarData: UserAvatarData = UserAvatarData(),
val teamName: String? = null
val handle: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ import com.wire.android.ui.common.dimensions
import com.wire.android.ui.destinations.TeamMigrationTeamNameStepScreenDestination
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.theme.wireTypography
import com.wire.android.ui.userprofile.teammigration.common.BottomLineButtons
import com.wire.android.ui.userprofile.teammigration.PersonalToTeamMigrationNavGraph
import com.wire.android.ui.userprofile.teammigration.TeamMigrationViewModel
import com.wire.android.ui.userprofile.teammigration.common.BottomLineButtons
import com.wire.android.util.CustomTabsHelper
import com.wire.android.util.ui.PreviewMultipleThemes

Expand Down Expand Up @@ -235,7 +235,7 @@ private fun AdvantageRow(
)
}
Divider(
color = colorsScheme().dividerPersonalToTeamMigration
color = colorsScheme().dividerNew
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,14 @@
<!-- User Profile -->
<string name="user_profile_title">User Profile</string>
<string name="user_profile_close_description">Close User profile</string>
<string name="user_profile_logout">Log out</string>
<string name="user_profile_logout">Logout</string>
<string name="user_profile_other_accs">Your Other Accounts</string>
<string name="user_profile_status_availability">Availability</string>
<string name="user_profile_status_available">Available</string>
<string name="user_profile_status_busy">Busy</string>
<string name="user_profile_status_away">Away</string>
<string name="user_profile_status_none">None</string>
<string name="user_profile_new_account_text">New Team or Account</string>
<string name="user_profile_new_account_text">New Team or Add Account</string>
<string name="user_profile_details_tab">Details</string>
<string name="user_profile_devices_tab">Devices</string>
<string name="user_profile_group_tab">Group</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ data class WireColorScheme(
val switchEnabledChecked: Color, val switchDisabledChecked: Color,
val switchEnabledUnchecked: Color, val switchDisabledUnchecked: Color,
val divider: Color,
val dividerPersonalToTeamMigration: Color,
val dividerNew: Color,
val windowPersonalToTeamMigration: Color,
val secondaryText: Color,
val outline: Color,
Expand Down Expand Up @@ -177,7 +177,7 @@ private val LightWireColorScheme = WireColorScheme(
switchEnabledChecked = WireColorPalette.LightGreen500, switchDisabledChecked = WireColorPalette.LightGreen200,
switchEnabledUnchecked = WireColorPalette.Gray70, switchDisabledUnchecked = WireColorPalette.Gray50,
divider = WireColorPalette.Gray20,
dividerPersonalToTeamMigration = WireColorPalette.Gray40,
dividerNew = WireColorPalette.Gray40,
windowPersonalToTeamMigration = WireColorPalette.Gray100,
secondaryText = WireColorPalette.Gray70,
outline = WireColorPalette.Gray40,
Expand Down Expand Up @@ -325,7 +325,7 @@ private val DarkWireColorScheme = WireColorScheme(
switchEnabledChecked = WireColorPalette.DarkGreen500, switchDisabledChecked = WireColorPalette.DarkGreen200,
switchEnabledUnchecked = WireColorPalette.Gray40, switchDisabledUnchecked = WireColorPalette.Gray60,
divider = WireColorPalette.Gray100,
dividerPersonalToTeamMigration = WireColorPalette.Gray90,
dividerNew = WireColorPalette.Gray90,
windowPersonalToTeamMigration = WireColorPalette.Gray100,
secondaryText = WireColorPalette.Gray60,
outline = WireColorPalette.Gray90,
Expand Down

0 comments on commit 370094d

Please sign in to comment.