-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiaryEntryCardView.swift
36 lines (32 loc) · 1.23 KB
/
DiaryEntryCardView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// DiaryEntryCardView.swift
// Lucify (iOS)
//
// Created by Patrick Elfert on 25.06.22.
//
import SwiftUI
struct DiaryEntryCardView: View {
var title: String
var content: String
var isLucid: Bool
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 8) {
HStack {
Text(title).font(Font.title3.weight(.bold)).lineLimit(2)
Spacer()
if isLucid {
Text("Lucid").font(Font.headline).padding(.horizontal, 10).background(PrimaryLight).cornerRadius(10).foregroundColor(.black)
}
}
Text(content).font(Font.body).opacity(0.8).padding(.leading, 3).lineLimit(5)
}.padding()
Spacer()
}.frame(maxWidth: 327).background(Primary).cornerRadius(17).padding(.leading, 2)
}
}
struct DiaryEntryCardView_Previews: PreviewProvider {
static var previews: some View {
DiaryEntryCardView(title: "Some Dream", content: "This is the content of the dream, normally the dream has more content and i am testing if 6 lines is the right amount of lines to display a preview here so it seems 5 is way more", isLucid: true)
}
}