Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Prompt user to leave rooms/subspaces in a space when leaving space #6424

Merged
merged 9 commits into from
Jul 29, 2021
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
@import "./views/dialogs/_IncomingSasDialog.scss";
@import "./views/dialogs/_InviteDialog.scss";
@import "./views/dialogs/_KeyboardShortcutsDialog.scss";
@import "./views/dialogs/_LeaveSpaceDialog.scss";
@import "./views/dialogs/_ManageRestrictedJoinRuleDialog.scss";
@import "./views/dialogs/_MessageEditHistoryDialog.scss";
@import "./views/dialogs/_ModalWidgetDialog.scss";
Expand Down
48 changes: 24 additions & 24 deletions res/css/views/dialogs/_AddExistingToSpaceDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,6 @@ limitations under the License.
font-weight: $font-semi-bold;
line-height: $font-15px;
}

.mx_AddExistingToSpace_entry {
display: flex;
margin-top: 12px;

// we can't target .mx_BaseAvatar here as it'll break the decorated avatar styling
.mx_DecoratedRoomAvatar {
margin-right: 12px;
}

.mx_AddExistingToSpace_entry_name {
font-size: $font-15px;
line-height: 30px;
flex-grow: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 12px;
}

.mx_Checkbox {
align-items: center;
}
}
}

.mx_AddExistingToSpace_section_spaces {
Expand Down Expand Up @@ -279,3 +255,27 @@ limitations under the License.
display: contents;
}
}

.mx_AddExistingToSpace_entry {
display: flex;
margin-top: 12px;

// we can't target .mx_BaseAvatar here as it'll break the decorated avatar styling
.mx_DecoratedRoomAvatar {
margin-right: 12px;
}

.mx_AddExistingToSpace_entry_name {
font-size: $font-15px;
line-height: 30px;
flex-grow: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 12px;
}

.mx_Checkbox {
align-items: center;
}
}
110 changes: 110 additions & 0 deletions res/css/views/dialogs/_LeaveSpaceDialog.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_LeaveSpaceDialog_wrapper {
.mx_Dialog {
display: flex;
flex-direction: column;
padding: 24px 32px;
}
}

.mx_LeaveSpaceDialog {
width: 440px;
display: flex;
flex-direction: column;
flex-wrap: nowrap;

&.mx_LeaveSpaceDialog_hasChildren {
height: 500px;
}

.mx_Dialog_content {
flex-grow: 1;
margin: 0 0 24px;
color: $tertiary-fg-color;
overflow-y: auto;

.mx_Dropdown_input {
border-radius: 8px;
border-color: $input-border-color;
}

.mx_Dropdown_option {
font-size: $font-15px;
}

.mx_SearchBox {
// To match the space around the title
margin: 0 0 15px 0;
flex-grow: 0;
border-radius: 8px;
}

.mx_LeaveSpaceDialog_noResults {
display: block;
margin-top: 24px;
}

.mx_LeaveSpaceDialog_section {
margin: 16px 0;

.mx_Dropdown + span {
display: inline-block;
margin-top: 8px;
}
}

.mx_LeaveSpaceDialog_section_warning {
position: relative;
border-radius: 8px;
margin: 12px 0;
padding: 12px 8px 12px 42px;
background-color: $header-panel-bg-color;

font-size: $font-12px;
line-height: $font-15px;
color: $secondary-fg-color;

&::before {
content: '';
position: absolute;
left: 10px;
top: calc(50% - 8px); // vertical centering
height: 16px;
width: 16px;
background-color: $secondary-fg-color;
mask-repeat: no-repeat;
mask-size: contain;
mask-image: url('$(res)/img/element-icons/room/room-summary.svg');
mask-position: center;
}
}

> p {
color: $primary-fg-color;
}
}

.mx_Dialog_buttons {
margin-top: 20px;

.mx_Dialog_primary {
background-color: $notice-primary-color !important; // override default colour
border-color: $notice-primary-color;
}
}
}
2 changes: 1 addition & 1 deletion src/components/views/dialogs/AddExistingToSpaceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface IProps extends IDialogProps {
onCreateRoomClick(space: Room): void;
}

const Entry = ({ room, checked, onChange }) => {
export const Entry = ({ room, checked, onChange }) => {
return <label className="mx_AddExistingToSpace_entry">
{ room?.isSpaceRoom()
? <RoomAvatar room={room} height={32} width={32} />
Expand Down
Loading