-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2607 from anyproto/ios-3774-file-attachment-add-size
iOS-3774 Chat | File attachment - add size
- Loading branch information
Showing
15 changed files
with
206 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...sentationLayer/Modules/Chat/Subviews/InputPanel/Attachments/MessageLinkBookmarkView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import Foundation | ||
import SwiftUI | ||
import Services | ||
|
||
struct MessageLinkBookmarkContainerView: View { | ||
|
||
let icon: Icon | ||
let title: String | ||
let description: String | ||
let onTapRemove: () -> Void | ||
|
||
var body: some View { | ||
MessageLinkBookmarkView( | ||
icon: icon, | ||
title: title, | ||
description: description | ||
) | ||
.messageLinkObjectStyle() | ||
.messageLinkRemoveButton(onTapRemove: onTapRemove) | ||
} | ||
} | ||
|
||
struct MessageLinkBookmarkView: View { | ||
|
||
let icon: Icon | ||
let title: String | ||
let description: String | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 2) { | ||
HStack(spacing: 6) { | ||
IconView(icon: icon) | ||
.frame(width: 14, height: 14) | ||
Text(title) | ||
.anytypeStyle(.caption1Regular) | ||
.foregroundColor(.Text.secondary) | ||
.lineLimit(1) | ||
.padding(.bottom, 5) | ||
Spacer() | ||
} | ||
Text(description) | ||
.anytypeStyle(.uxTitle2Medium) | ||
.foregroundColor(.Text.primary) | ||
.lineLimit(1) | ||
} | ||
.padding(12) | ||
} | ||
} | ||
|
||
extension MessageLinkBookmarkContainerView { | ||
init(details: MessageAttachmentDetails, onTapRemove: @escaping () -> Void) { | ||
self = MessageLinkBookmarkContainerView( | ||
icon: details.objectIconImage, | ||
title: details.source ?? details.title, | ||
description: details.title, | ||
onTapRemove: onTapRemove | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...esentationLayer/Modules/Chat/Subviews/Message/Attachments/MessageObjectBookmarkView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Foundation | ||
import SwiftUI | ||
import Services | ||
|
||
struct MessageObjectBookmarkView: View { | ||
|
||
let icon: Icon | ||
let title: String | ||
let description: String | ||
|
||
var body: some View { | ||
MessageLinkBookmarkView( | ||
icon: icon, | ||
title: title, | ||
description: description | ||
) | ||
.frame(height: 64) | ||
.frame(minWidth: 231) | ||
.background(Color.Background.secondary) | ||
.cornerRadius(18, style: .continuous) | ||
} | ||
} | ||
|
||
extension MessageObjectBookmarkView { | ||
init(details: MessageAttachmentDetails) { | ||
self = MessageObjectBookmarkView( | ||
icon: details.objectIconImage, | ||
title: details.source ?? details.title, | ||
description: details.title | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.