new chat view
This commit is contained in:
		
							parent
							
								
									44f7336c8d
								
							
						
					
					
						commit
						67125b230f
					
				@ -270,9 +270,6 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "Вложение" : {
 | 
					    "Вложение" : {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "Вложения" : {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "Войти" : {
 | 
					    "Войти" : {
 | 
				
			||||||
      "localizations" : {
 | 
					      "localizations" : {
 | 
				
			||||||
 | 
				
			|||||||
@ -209,29 +209,27 @@ struct PrivateChatView: View {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private var composer: some View {
 | 
					    private var composer: some View {
 | 
				
			||||||
        VStack(spacing: 10) {
 | 
					        VStack(spacing: 10) {
 | 
				
			||||||
            Divider()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            HStack(spacing: 12) {
 | 
					 | 
				
			||||||
                composerToolbarButton(systemName: "paperclip", label: NSLocalizedString("Вложения", comment: "")) {
 | 
					 | 
				
			||||||
                    // TODO: hook to attachments action
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                composerModeButton(.chat)
 | 
					 | 
				
			||||||
                composerModeButton(.stickers)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                Spacer(minLength: 0)
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            HStack(alignment: .bottom, spacing: 12) {
 | 
					            HStack(alignment: .bottom, spacing: 12) {
 | 
				
			||||||
                HStack(alignment: .center, spacing: 8) {
 | 
					           
 | 
				
			||||||
                    Image(systemName: inputTab.iconName)
 | 
					                Button(action: {  }) { // переключатель на стикеры
 | 
				
			||||||
 | 
					                    Image(systemName: "paperclip")
 | 
				
			||||||
 | 
					                        .font(.system(size: 18, weight: .semibold))
 | 
				
			||||||
 | 
					                        .frame(width: 40, height: 40)
 | 
				
			||||||
                        .foregroundColor(.secondary)
 | 
					                        .foregroundColor(.secondary)
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                HStack(alignment: .center, spacing: 8) {
 | 
				
			||||||
                    TextField(inputTab.placeholder, text: $draftText, axis: .vertical)
 | 
					                    TextField(inputTab.placeholder, text: $draftText, axis: .vertical)
 | 
				
			||||||
                        .lineLimit(1...4)
 | 
					                        .lineLimit(1...4)
 | 
				
			||||||
                        .focused($isComposerFocused)
 | 
					                        .focused($isComposerFocused)
 | 
				
			||||||
                        .submitLabel(.send)
 | 
					                        .submitLabel(.send)
 | 
				
			||||||
                        .disabled(viewModel.isSending || currentUserId == nil)
 | 
					                        .disabled(viewModel.isSending || currentUserId == nil)
 | 
				
			||||||
                        .onSubmit { sendCurrentMessage() }
 | 
					                        .onSubmit { sendCurrentMessage() }
 | 
				
			||||||
 | 
					                    Button(action: {  }) { // переключатель на стикеры
 | 
				
			||||||
 | 
					                        Image(systemName: "face.smiling")
 | 
				
			||||||
 | 
					                            .font(.system(size: 18, weight: .semibold))
 | 
				
			||||||
 | 
					                            .foregroundColor(.secondary)
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                .padding(.vertical, 10)
 | 
					                .padding(.vertical, 10)
 | 
				
			||||||
                .padding(.horizontal, 12)
 | 
					                .padding(.horizontal, 12)
 | 
				
			||||||
@ -242,10 +240,8 @@ struct PrivateChatView: View {
 | 
				
			|||||||
                    Button(action: { isVideoPreferred.toggle() }) {
 | 
					                    Button(action: { isVideoPreferred.toggle() }) {
 | 
				
			||||||
                        Image(systemName: isVideoPreferred ? "video.fill" : "mic.fill")
 | 
					                        Image(systemName: isVideoPreferred ? "video.fill" : "mic.fill")
 | 
				
			||||||
                            .font(.system(size: 18, weight: .semibold))
 | 
					                            .font(.system(size: 18, weight: .semibold))
 | 
				
			||||||
                            .foregroundColor(.accentColor)
 | 
					 | 
				
			||||||
                            .frame(width: 40, height: 40)
 | 
					                            .frame(width: 40, height: 40)
 | 
				
			||||||
                            .background(Color.accentColor.opacity(0.12))
 | 
					                            .foregroundColor(.secondary)
 | 
				
			||||||
                            .clipShape(Circle())
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    .buttonStyle(.plain)
 | 
					                    .buttonStyle(.plain)
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
@ -280,21 +276,11 @@ struct PrivateChatView: View {
 | 
				
			|||||||
        .buttonStyle(.plain)
 | 
					        .buttonStyle(.plain)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private func composerToolbarButton(systemName: String, label: String, action: @escaping () -> Void) -> some View {
 | 
					//    private func composerToolbarButton(systemName: String, action: @escaping () -> Void) -> some View {
 | 
				
			||||||
        Button(action: action) {
 | 
					//        Button(action: action) {
 | 
				
			||||||
            VStack(spacing: 4) {
 | 
					//            Image(systemName: systemName)
 | 
				
			||||||
                Image(systemName: systemName)
 | 
					//                .font(.system(size: 16, weight: .medium))
 | 
				
			||||||
                    .font(.system(size: 16, weight: .medium))
 | 
					//    }
 | 
				
			||||||
                Text(label)
 | 
					 | 
				
			||||||
                    .font(.caption2)
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            .foregroundColor(.primary)
 | 
					 | 
				
			||||||
            .frame(width: 64, height: 44)
 | 
					 | 
				
			||||||
            .background(Color(.secondarySystemBackground))
 | 
					 | 
				
			||||||
            .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        .buttonStyle(.plain)
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private func composerModeButton(_ tab: ComposerTab) -> some View {
 | 
					    private func composerModeButton(_ tab: ComposerTab) -> some View {
 | 
				
			||||||
        Button(action: { inputTab = tab }) {
 | 
					        Button(action: { inputTab = tab }) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user