11import QtQuick
2+ import QtQuick.Controls
23import QtQuick.Layouts
4+ import QtQml
35
46import StatusQ
57import StatusQ.Core
@@ -51,6 +53,9 @@ StatusSectionLayout {
5153 readonly property int preventShadowClipMargin: Theme .padding
5254
5355 readonly property bool searchMode: searcher .text .length > 0
56+
57+ // Read-only flag that turns true when the component enters a “compact” layout automatically on resize.
58+ readonly property bool compactMode: root .width < 600
5459 }
5560
5661 SortFilterProxyModel {
@@ -87,31 +92,32 @@ StatusSectionLayout {
8792 ]
8893 }
8994
90- centerPanel: Item {
95+ centerPanel: ColumnLayout {
96+ id: column
97+
9198 anchors .fill : parent
9299
93100 anchors .topMargin : d .layoutTopMargin
94101 anchors .leftMargin : Theme .xlPadding * 2
95102 anchors .rightMargin : Theme .xlPadding
96103
97- ColumnLayout {
98- id: column
99-
100- anchors .fill : parent
101- spacing: 18
104+ spacing: 18
105+
106+ StatusBaseText {
107+ Layout .fillWidth : true
108+ text: qsTr (" Discover Communities" )
109+ font .weight : Font .Bold
110+ font .pixelSize : d .titlePixelSize
111+ color: Theme .palette .directColor1
112+ elide: Text .ElideRight
113+ wrapMode: Text .Wrap
114+ maximumLineCount: 2
115+ }
102116
103- StatusBaseText {
104- text: qsTr (" Discover Communities" )
105- font .weight : Font .Bold
106- font .pixelSize : d .titlePixelSize
107- color: Theme .palette .directColor1
108- }
117+ ColumnLayout {
118+ spacing: Theme .padding
109119
110120 RowLayout {
111- Layout .fillWidth : true
112- Layout .preferredHeight : 38
113- spacing: Theme .bigPadding
114-
115121 SearchBox {
116122 id: searcher
117123 Layout .fillWidth : true
@@ -122,71 +128,92 @@ StatusSectionLayout {
122128 bottomPadding: 0
123129 }
124130
125- // Just a row filler to fit design
126- Item { Layout .fillWidth : true }
127-
128- StatusButton {
131+ // filler
132+ Item {
129133 Layout .fillWidth : true
130- Layout .preferredHeight : 38
131- Layout .maximumWidth : implicitWidth
132- text: qsTr (" Join Community" )
133- verticalPadding: 0
134- onClicked: Global .importCommunityPopupRequested ()
135134 }
136135
137- StatusButton {
138- objectName: " createCommunityButton"
139- visible: root .createCommunityEnabled
140- Layout .preferredHeight : 38
141- verticalPadding: 0
142- text: qsTr (" Create New Community" )
143- type: StatusBaseButton .Type .Primary
144- onClicked: {
145- // Global.openPopup(chooseCommunityCreationTypePopupComponent) // hidden as part of https://github.com/status-im/status-desktop/issues/17726
146- root .communitiesStore .setCreateCommunityPopupSeen ()
147- Global .createCommunityPopupRequested (false /* isDiscordImport*/ )
148- }
136+ LayoutItemProxy {
137+ visible: ! d .compactMode
149138
150- StatusNewBadge {
151- visible: root .createCommunityBadgeVisible
152- }
139+ Layout .fillWidth : true
140+ Layout .alignment : Qt .AlignHCenter
141+
142+ target: buttonsRow
153143 }
154144 }
155145
156- TagsRow {
157- id: communityTags
146+ LayoutItemProxy {
147+ visible: d .compactMode
148+
158149 Layout .fillWidth : true
159150
160- tags : root . communitiesStore . communityTags
151+ target : buttonsRow
161152 }
153+ }
162154
163- Item {
164- Layout .fillWidth : true
165- Layout .fillHeight : true
166- Layout .leftMargin : - d .preventShadowClipMargin
167- Layout .rightMargin : - d .preventShadowClipMargin
155+ TagsRow {
156+ id: communityTags
157+ Layout .fillWidth : true
158+
159+ tags: root .communitiesStore .communityTags
160+ }
168161
169- clip: true
170162
171- CommunitiesGridView {
172- id: communitiesGrid
163+ CommunitiesGridView {
164+ id: communitiesGrid
173165
174- anchors . fill : parent
175- anchors . rightMargin : d . preventShadowClipMargin
176- anchors .leftMargin : d .preventShadowClipMargin
177- contentWidth : availableWidth
166+ Layout . fillWidth : true
167+ Layout . fillHeight : true
168+ Layout .leftMargin : d .preventShadowClipMargin
169+ Layout . rightMargin : d . preventShadowClipMargin
178170
179- padding: 0
180- bottomPadding: d .layoutBottomMargin
171+ contentWidth: availableWidth
172+ padding: 0
173+ bottomPadding: d .layoutBottomMargin
181174
182- model: filteredCommunitiesModel
183- searchLayout: d .searchMode
175+ model: filteredCommunitiesModel
176+ searchLayout: d .searchMode
184177
185- assetsModel: root .assetsModel
186- collectiblesModel: root .collectiblesModel
178+ assetsModel: root .assetsModel
179+ collectiblesModel: root .collectiblesModel
187180
188- onCardClicked : (communityId ) => root .communitiesStore .navigateToCommunity (communityId)
189- }
181+ onCardClicked : (communityId ) => root .communitiesStore .navigateToCommunity (communityId)
182+ }
183+ }
184+
185+ RowLayout {
186+ id: buttonsRow
187+ Layout .fillWidth : true
188+ Layout .preferredHeight : 38
189+ spacing: Theme .bigPadding
190+
191+ StatusButton {
192+ Layout .fillWidth : true
193+ Layout .preferredHeight : 38
194+ Layout .maximumWidth : implicitWidth
195+ text: qsTr (" Join Community" )
196+ verticalPadding: 0
197+ onClicked: Global .importCommunityPopupRequested ()
198+ }
199+
200+ StatusButton {
201+ objectName: " createCommunityButton"
202+ Layout .fillWidth : true
203+ Layout .preferredHeight : 38
204+ Layout .maximumWidth : implicitWidth
205+ visible: root .createCommunityEnabled
206+ verticalPadding: 0
207+ text: qsTr (" Create New Community" )
208+ type: StatusBaseButton .Type .Primary
209+ onClicked: {
210+ // Global.openPopup(chooseCommunityCreationTypePopupComponent) // hidden as part of https://github.com/status-im/status-desktop/issues/17726
211+ root .communitiesStore .setCreateCommunityPopupSeen ()
212+ Global .createCommunityPopupRequested (false /* isDiscordImport*/ )
213+ }
214+
215+ StatusNewBadge {
216+ visible: root .createCommunityBadgeVisible
190217 }
191218 }
192219 }
@@ -216,8 +243,8 @@ StatusSectionLayout {
216243 BannerPanel {
217244 readonly property bool importInProgress: root .communitiesStore .discordImportInProgress && ! root .communitiesStore .discordImportCancelled
218245 text: importInProgress ?
219- qsTr (" '%1' import in progress..." ).arg (root .communitiesStore .discordImportCommunityName || root .communitiesStore .discordImportChannelName ) :
220- qsTr (" Import existing Discord community into Status" )
246+ qsTr (" '%1' import in progress..." ).arg (root .communitiesStore .discordImportCommunityName || root .communitiesStore .discordImportChannelName ) :
247+ qsTr (" Import existing Discord community into Status" )
221248 buttonText: qsTr (" Import existing" )
222249 icon .name : " download"
223250 buttonTooltipText: qsTr (" Your current import must be finished or cancelled before a new import can be started." )
0 commit comments