Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-3897 Updated profile card design #2672

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Anytype/Generated/ImageAssets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ internal extension ImageAsset {
static let download = ImageAsset.bundle(name: "x32/Download")
static let dragDrop = ImageAsset.bundle(name: "x32/Drag & Drop")
static let duplicate = ImageAsset.bundle(name: "x32/Duplicate")
static let edit = ImageAsset.bundle(name: "x32/Edit")
static let empty = ImageAsset.bundle(name: "x32/Empty")
static let export = ImageAsset.bundle(name: "x32/Export")
enum Favorite {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Edit.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ struct ImageCharIconView: View {
Config(side: 40, fontSize: 24),
Config(side: 48, fontSize: 30),
Config(side: 64, fontSize: 36),
Config(side: 80, fontSize: 48)
Config(side: 80, fontSize: 48),
Config(side: 112, fontSize: 88)
].sorted(by: { $0.side > $1.side }) // Order by DESC side for simple search

let text: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,59 @@ struct ProfileView: View {
private func content(_ details: ObjectDetails) -> some View {
VStack(spacing: 0) {
DragIndicator()
Spacer.fixedHeight(35)
actionRow

if details.description.isNotEmpty {
viewWithDescription(details)
} else {
viewWithoutDescription(details)
}

Spacer.fixedHeight(16)

}
.padding(.horizontal, 16)
.background(Color.Background.secondary)
}

private var actionRow: some View {
Group {
if model.isOwner {
StandardButton(Loc.editProfile, style: .secondaryLarge) { model.showSettings.toggle() }
HStack(spacing: 12) {
Spacer()
Button {
model.showSettings.toggle()
} label: {
IconView(asset: .X32.edit).frame(width: 32, height: 32)
}
}
} else {
Spacer.fixedHeight(30)
Spacer.fixedHeight(32)
}

Spacer.fixedHeight(32)
}
.padding(.horizontal, 32)
.background(Color.Background.secondary)
}

private func viewWithDescription(_ details: ObjectDetails) -> some View {
Group {
Spacer.fixedHeight(30)
IconView(icon: details.objectIconImage).frame(width: 112, height: 112)
Spacer.fixedHeight(12)
AnytypeText(details.name, style: .heading).lineLimit(1)
Spacer.fixedHeight(4)
AnytypeText(details.identity, style: .caption1Regular).foregroundColor(.Text.secondary).lineLimit(1)
Spacer.fixedHeight(4)
AnytypeText(details.description, style: .previewTitle2Regular)
Spacer.fixedHeight(78)
}
}

private func viewWithoutDescription(_ details: ObjectDetails) -> some View {
Group {
Spacer.fixedHeight(30)
IconView(icon: details.objectIconImage).frame(width: 184, height: 184)
Spacer.fixedHeight(12)
AnytypeText(details.name, style: .heading).lineLimit(1)
Spacer.fixedHeight(4)
AnytypeText(details.identity, style: .caption1Regular).foregroundColor(.Text.secondary).lineLimit(1)
Spacer.fixedHeight(84)
}
}
}
Expand Down
Loading