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

New functionality for giphy input and display #127

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ let package = Package(
url: "https://github.com/exyte/ActivityIndicatorView",
from: "1.0.0"
),
.package(
url: "https://github.com/Giphy/giphy-ios-sdk",
from: "2.2.13"
),
],
targets: [
.target(
Expand All @@ -39,8 +43,10 @@ let package = Package(
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect"),
.product(name: "ExyteMediaPicker", package: "MediaPicker"),
.product(name: "FloatingButton", package: "FloatingButton"),
.product(name: "ActivityIndicatorView", package: "ActivityIndicatorView")
]
.product(name: "ActivityIndicatorView", package: "ActivityIndicatorView"),
.product(name: "GiphyUISDK", package: "giphy-ios-sdk")
fred-bowker marked this conversation as resolved.
Show resolved Hide resolved
],
path: "Sources"
),
.testTarget(
name: "ExyteChatTests",
Expand Down
20 changes: 10 additions & 10 deletions Sources/ExyteChat/ChatView/Attachments/AttachmentsEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import ExyteMediaPicker
import ActivityIndicatorView

struct AttachmentsEditor<InputViewContent: View>: View {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add these, this can be changed in xcode settings

Copy link
Contributor Author

@fred-bowker fred-bowker Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to see about getting #126 merged, that way I could just run the command to meet the projects formatting, I've added another commit, with the correct formatting so this should now be fixed

typealias InputViewBuilderClosure = ChatView<EmptyView, InputViewContent, DefaultMessageMenuAction>.InputViewBuilderClosure

@Environment(\.chatTheme) var theme
@Environment(\.mediaPickerTheme) var pickerTheme

fred-bowker marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -26,7 +26,7 @@ struct AttachmentsEditor<InputViewContent: View>: View {
var messageUseMarkdown: Bool
var orientationHandler: MediaPickerOrientationHandler
var mediaPickerSelectionParameters: MediaPickerParameters?
var availableInput: AvailableInputType
var availableInputs: [AvailableInputType]
var localization: ChatLocalization

@State private var seleсtedMedias: [Media] = []
Expand Down Expand Up @@ -103,10 +103,7 @@ struct AttachmentsEditor<InputViewContent: View>: View {
fullscreenPhotoBackground: theme.colors.mainBG,
cameraBackground: theme.colors.mainBG,
cameraSelectionBackground: theme.colors.mainBG),
selection: .init(
selectedTint: theme.colors.sendButtonBackground,
fullscreenTint: theme.colors.sendButtonBackground
)
selection: .init(selectedTint: theme.colors.sendButtonBackground)
)
}
}
Expand All @@ -125,15 +122,18 @@ struct AttachmentsEditor<InputViewContent: View>: View {
var inputView: some View {
Group {
if let inputViewBuilder = inputViewBuilder {
inputViewBuilder($inputViewModel.text, inputViewModel.attachments, inputViewModel.state, .signature, inputViewModel.inputViewAction()) {
inputViewBuilder(
$inputViewModel.text, inputViewModel.attachments, inputViewModel.state,
.signature, inputViewModel.inputViewAction()
) {
globalFocusState.focus = nil
}
} else {
InputView(
viewModel: inputViewModel,
inputFieldId: UUID(),
style: .signature,
availableInput: availableInput,
availableInputs: availableInputs,
messageUseMarkdown: messageUseMarkdown,
localization: localization
)
Expand Down Expand Up @@ -170,8 +170,8 @@ struct AttachmentsEditor<InputViewContent: View>: View {
.padding(.horizontal)
.padding(.bottom, 5)
}

func cameraSelectionHeaderView(cancelClosure: @escaping ()->()) -> some View {

HStack {
Button {
cancelClosure()
Expand Down
Loading