Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
937ec0d0
Commit
937ec0d0
authored
4 years ago
by
cruxfilm
Browse files
Options
Downloads
Patches
Plain Diff
suuure, whatever
parent
1f95a102
No related branches found
No related tags found
1 merge request
!81
Resolve "Add Pull to Refresh to MailListView" & Redesign ContactView
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift
+69
-0
69 additions, 0 deletions
enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift
with
69 additions
and
0 deletions
enzevalos_iphone/SwiftUI/Inbox/MailRowView.swift
0 → 100644
+
69
−
0
View file @
937ec0d0
//
// MailRow.swift
// enzevalos_iphone
//
// Created by Oliver Wiese on 27.10.20.
// Modified by Chris Offner & Claire Bräuer in March 2021.
// Copyright © 2020 fu-berlin. All rights reserved.
//
import
SwiftUI
struct
MailRowView
<
M
:
DisplayMail
>
:
View
{
let
mail
:
M
var
body
:
some
View
{
HStack
{
avatar
VStack
(
alignment
:
.
leading
)
{
HStack
{
// Sender name
Text
(
mail
.
sender
.
name
)
.
fontWeight
(
mail
.
isRead
?
.
regular
:
.
medium
)
.
lineLimit
(
1
)
Spacer
()
// Arrival time
Text
(
mail
.
date
.
timeAgoText
())
.
font
(
.
caption
)
}
HStack
{
// Subject
Text
(
mail
.
subject
)
.
font
(
.
caption
)
.
lineLimit
(
2
)
Spacer
()
// Attachment indicator if relevant
if
!
mail
.
displayAttachments
.
isEmpty
{
Image
(
systemName
:
"paperclip"
)
.
font
(
.
caption
)
.
foregroundColor
(
.
secondary
)
}
}
}
.
foregroundColor
(
mail
.
isRead
?
.
secondary
:
.
primary
)
}
.
padding
(
4
)
.
frame
(
height
:
65
)
}
private
var
avatar
:
some
View
{
mail
.
sender
.
avatar
.
resizable
()
.
aspectRatio
(
contentMode
:
.
fit
)
.
shadow
(
radius
:
2
)
.
opacity
(
mail
.
isRead
?
0.45
:
1
)
}
}
struct
MailRow_Previews
:
PreviewProvider
{
static
var
previews
:
some
View
{
MailRowView
(
mail
:
ProxyData
.
PlainMail
)
.
previewLayout
(
.
sizeThatFits
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment