2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-05-27 20:11:56 +00:00
|
|
|
import "../../../../imports"
|
2020-05-27 21:09:12 +00:00
|
|
|
import "../../../../shared"
|
2020-05-27 20:11:56 +00:00
|
|
|
import "./"
|
|
|
|
|
2020-05-29 16:27:50 +00:00
|
|
|
ModalPopup {
|
2020-06-15 16:24:21 +00:00
|
|
|
function doJoin() {
|
|
|
|
if(channelName.text === "") return;
|
|
|
|
chatsModel.joinChat(channelName.text, Constants.chatTypePublic);
|
|
|
|
popup.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-05-27 20:11:56 +00:00
|
|
|
id: popup
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Join public chat"
|
|
|
|
title: qsTrId("new-public-group-chat")
|
2020-06-09 10:01:19 +00:00
|
|
|
|
2020-05-29 18:38:11 +00:00
|
|
|
onOpened: {
|
|
|
|
channelName.text = "";
|
|
|
|
channelName.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
}
|
|
|
|
|
2020-05-29 16:27:50 +00:00
|
|
|
Row {
|
|
|
|
id: description
|
|
|
|
Layout.fillHeight: false
|
|
|
|
Layout.fillWidth: true
|
|
|
|
width: parent.width
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-04 14:53:10 +00:00
|
|
|
width: parent.width
|
2020-05-29 16:27:50 +00:00
|
|
|
font.pixelSize: 15
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "A public chat is where you get to hang out with others, make friends and talk about subjects of your interest."
|
|
|
|
text: qsTrId("a-public-chat-is-where-you-get-to-hang-out-with-others,-make-friends-and-talk-about-subjects-of-your-interest.")
|
2020-05-29 16:27:50 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
verticalAlignment: Text.AlignTop
|
2020-05-27 20:11:56 +00:00
|
|
|
}
|
2020-05-29 16:27:50 +00:00
|
|
|
}
|
2020-05-27 20:11:56 +00:00
|
|
|
|
2020-06-15 16:24:21 +00:00
|
|
|
Input {
|
|
|
|
id: channelName
|
2020-05-29 16:27:50 +00:00
|
|
|
anchors.top: description.bottom
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "chat-name"
|
|
|
|
placeholderText: qsTrId("chat-name")
|
2020-06-15 16:24:21 +00:00
|
|
|
Keys.onEnterPressed: doJoin()
|
|
|
|
Keys.onReturnPressed: doJoin()
|
|
|
|
icon: "../../../img/hash.svg"
|
2020-05-29 16:27:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: row
|
|
|
|
Layout.fillHeight: false
|
|
|
|
Layout.fillWidth: true
|
|
|
|
anchors.right: parent.right
|
2020-06-25 22:32:03 +00:00
|
|
|
anchors.rightMargin: 35
|
2020-05-29 16:27:50 +00:00
|
|
|
anchors.left: parent.left
|
2020-06-25 22:32:03 +00:00
|
|
|
anchors.leftMargin: 35
|
2020-06-15 16:24:21 +00:00
|
|
|
anchors.top: channelName.bottom
|
2020-05-29 16:27:50 +00:00
|
|
|
anchors.topMargin: 37
|
2020-05-27 20:11:56 +00:00
|
|
|
|
2020-05-29 16:27:50 +00:00
|
|
|
Flow {
|
2020-05-27 20:11:56 +00:00
|
|
|
Layout.fillHeight: false
|
|
|
|
Layout.fillWidth: true
|
2020-05-29 16:27:50 +00:00
|
|
|
spacing: 20
|
2020-05-27 20:11:56 +00:00
|
|
|
|
2020-08-18 17:43:53 +00:00
|
|
|
SuggestedChannel { channel: "ethereum"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "status"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "general"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "dapps"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "crypto"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "introductions"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "tech"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "ama"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "gaming"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "sexychat"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "nsfw"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "science"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "music"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "movies"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "sports"; onJoin: function() { popup.close() } }
|
|
|
|
SuggestedChannel { channel: "politics"; onJoin: function() { popup.close() } }
|
2020-05-27 20:11:56 +00:00
|
|
|
}
|
2020-05-29 16:27:50 +00:00
|
|
|
}
|
2020-05-27 20:11:56 +00:00
|
|
|
|
2020-05-29 16:27:50 +00:00
|
|
|
footer: Button {
|
|
|
|
width: 44
|
|
|
|
height: 44
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
background: Rectangle {
|
|
|
|
color: "transparent"
|
2020-05-27 20:11:56 +00:00
|
|
|
}
|
2020-06-25 13:23:17 +00:00
|
|
|
SVGImage {
|
2020-05-29 16:27:50 +00:00
|
|
|
source: channelName.text == "" ? "../../../img/arrow-button-inactive.svg" : "../../../img/arrow-btn-active.svg"
|
2020-06-25 13:23:17 +00:00
|
|
|
width: 50
|
|
|
|
height: 50
|
2020-05-29 16:27:50 +00:00
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
id: btnMAJoinChat
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
2020-06-15 16:24:21 +00:00
|
|
|
onClicked : doJoin()
|
2020-05-27 20:11:56 +00:00
|
|
|
}
|
2020-06-15 16:24:21 +00:00
|
|
|
}
|
2020-05-27 20:11:56 +00:00
|
|
|
}
|