mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Refresh presence info in history detail
This commit is contained in:
parent
a421d90d0c
commit
fa1f8386b4
1 changed files with 17 additions and 8 deletions
|
|
@ -196,14 +196,8 @@ struct HistoryContactFragment: View {
|
||||||
.padding(.top, 5)
|
.padding(.top, 5)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let avatarModel = historyModel.avatarModel {
|
if let avatar = historyModel.avatarModel {
|
||||||
Text(avatarModel.lastPresenceInfo)
|
AvatarPresenceView(avatarModel: avatar)
|
||||||
.foregroundStyle(avatarModel.lastPresenceInfo == "Online" ? Color.greenSuccess500 : Color.orangeWarning600)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
.default_text_style_300(styleSize: 12)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.frame(height: 20)
|
|
||||||
.padding(.top, 5)
|
|
||||||
} else {
|
} else {
|
||||||
Text("")
|
Text("")
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
|
|
@ -423,6 +417,21 @@ struct HistoryContactFragment: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct AvatarPresenceView: View {
|
||||||
|
@ObservedObject var avatarModel: ContactAvatarModel
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
Text(avatarModel.lastPresenceInfo)
|
||||||
|
.foregroundStyle(avatarModel.lastPresenceInfo == "Online" ? Color.greenSuccess500 : Color.orangeWarning600)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
|
.default_text_style_300(styleSize: 12)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.frame(height: 20)
|
||||||
|
.padding(.top, 5)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
HistoryContactFragment(
|
HistoryContactFragment(
|
||||||
isShowDeleteAllHistoryPopup: .constant(false),
|
isShowDeleteAllHistoryPopup: .constant(false),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue