Skip to content

Commit

Permalink
Adjusting modals and updating close icon on input (mattermost-communi…
Browse files Browse the repository at this point in the history
…ty#4458)

* Adjusting modals and updating close icon on input

* Updating test

* Updating css

* Updating dialog css
  • Loading branch information
asaadmahmood authored Jan 16, 2023
1 parent 7d663ef commit 297e8f4
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`components/boardSelector escape button should unmount the component 1`]
class="focalboard-body"
>
<div
class="Dialog dialog-back BoardSelector"
class="Dialog dialog-back BoardSelector size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -111,7 +111,7 @@ exports[`components/boardSelector renders with no results 1`] = `
class="focalboard-body"
>
<div
class="Dialog dialog-back BoardSelector"
class="Dialog dialog-back BoardSelector size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -217,7 +217,7 @@ exports[`components/boardSelector renders with some results 1`] = `
class="focalboard-body"
>
<div
class="Dialog dialog-back BoardSelector"
class="Dialog dialog-back BoardSelector size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -421,7 +421,7 @@ exports[`components/boardSelector renders without start searching 1`] = `
class="focalboard-body"
>
<div
class="Dialog dialog-back BoardSelector"
class="Dialog dialog-back BoardSelector size--medium"
>
<div
class="backdrop"
Expand Down
14 changes: 7 additions & 7 deletions webapp/src/components/__snapshots__/cardDialog.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`components/cardDialog already following card 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -215,7 +215,7 @@ exports[`components/cardDialog already following card 1`] = `
exports[`components/cardDialog limited card shows hidden view (no toolbar) 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -447,7 +447,7 @@ exports[`components/cardDialog limited card shows hidden view (no toolbar) 1`] =
exports[`components/cardDialog return a cardDialog readonly 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -578,7 +578,7 @@ exports[`components/cardDialog return a cardDialog readonly 1`] = `
exports[`components/cardDialog return cardDialog menu content 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -927,7 +927,7 @@ exports[`components/cardDialog return cardDialog menu content 1`] = `
exports[`components/cardDialog return cardDialog menu content and cancel delete confirmation do nothing 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -1139,7 +1139,7 @@ exports[`components/cardDialog return cardDialog menu content and cancel delete
exports[`components/cardDialog should match snapshot 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -1351,7 +1351,7 @@ exports[`components/cardDialog should match snapshot 1`] = `
exports[`components/cardDialog should match snapshot without permissions 1`] = `
<div>
<div
class="Dialog dialog-back cardDialog"
class="Dialog dialog-back cardDialog size--medium"
>
<div
class="backdrop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`/components/confirmAddUserForNotifications should match snapshot 1`] = `
<div>
<div
class="Dialog dialog-back confirmation-dialog-box"
class="Dialog dialog-back confirmation-dialog-box size--small"
>
<div
class="backdrop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`/components/confirmationDialogBox confirmDialog should match snapshot 1`] = `
<div>
<div
class="Dialog dialog-back confirmation-dialog-box"
class="Dialog dialog-back confirmation-dialog-box size--small"
>
<div
class="backdrop"
Expand Down Expand Up @@ -84,7 +84,7 @@ exports[`/components/confirmationDialogBox confirmDialog should match snapshot 1
exports[`/components/confirmationDialogBox confirmDialog with Confirm Button Text should match snapshot 1`] = `
<div>
<div
class="Dialog dialog-back confirmation-dialog-box"
class="Dialog dialog-back confirmation-dialog-box size--small"
>
<div
class="backdrop"
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/__snapshots__/dialog.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`components/dialog should match snapshot 1`] = `
<div>
<div
class="Dialog dialog-back undefined"
class="Dialog dialog-back undefined size--medium"
>
<div
class="backdrop"
Expand Down Expand Up @@ -50,7 +50,7 @@ exports[`components/dialog should match snapshot 1`] = `
exports[`components/dialog should return dialog and click on cancel button 1`] = `
<div>
<div
class="Dialog dialog-back undefined"
class="Dialog dialog-back undefined size--medium"
>
<div
class="backdrop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ exports[`components/boardTemplateSelector/boardTemplateSelectorItem should trigg
</div>
<div>
<div
class="Dialog dialog-back DeleteBoardDialog"
class="Dialog dialog-back DeleteBoardDialog size--medium"
>
<div
class="backdrop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`component/BoardSwitcherDialog base case 1`] = `
<div>
<div
class="Dialog dialog-back BoardSwitcherDialog"
class="Dialog dialog-back BoardSwitcherDialog size--medium"
>
<div
class="backdrop"
Expand Down
25 changes: 20 additions & 5 deletions webapp/src/components/cardDialog.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
.Dialog {
&.cardDialog {
.dialog {
.cardDialog {
.dialog {
width: 100%;
top: 0;
height: 100%;

>.CardDetail {
display: flex;
flex-direction: column;
align-items: flex-start;

@media not screen and (max-width: 975px) {
width: 800px;
max-width: 100%;
padding: 10px 126px;
}

@media screen and (max-width: 975px) {
padding: 16px 32px;
}
}

>.CardDetail--fullwidth {
padding-left: 78px;
}
}
}

Expand Down
19 changes: 0 additions & 19 deletions webapp/src/components/confirmationDialogBox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,11 @@
.confirmation-dialog-box {
.dialog {
@include z-index(confirmation-dialog-box);
color: rgb(var(--center-channel-color-rgb));
max-width: 512px;
width: 100%;
position: fixed;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
height: max-content;

background-color: rgb(var(--center-channel-bg-rgb));
box-shadow: rgba(var(--center-channel-color-rgb), 0.1) 0 0 0 1px,
rgba(var(--center-channel-color-rgb), 0.1) 0 2px 4px;

border-radius: var(--modal-rad);
padding: 0;
-webkit-overflow-scrolling: touch;
overflow-x: hidden;
overflow-y: auto;

> .toolbar {
position: absolute;
top: 0;
right: 0;
padding: 16px;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/confirmationDialogBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const ConfirmationDialogBox = (props: Props) => {

return (
<Dialog
size='small'
className='confirmation-dialog-box'
onClose={handleOnClose}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`components/createCategory/CreateCategory base case should match snapshot 1`] = `
<div>
<div
class="Dialog dialog-back CreateCategoryModal"
class="Dialog dialog-back CreateCategoryModal size--medium"
>
<div
class="backdrop"
Expand Down
99 changes: 54 additions & 45 deletions webapp/src/components/createCategory/createCategory.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,71 @@
width: 600px;
height: auto;
}
}

.CreateCategory {
display: flex;
flex-direction: column;
padding: 0 32px 24px;
gap: 24px;

.inputWrapper {
position: relative;
.CreateCategory {
display: flex;
flex-direction: column;
padding: 0 32px 24px;
gap: 24px;

.CloseCircle {
cursor: pointer;
position: absolute;
font-size: 18px;
width: 16px;
height: 16px;
right: 16px;
top: 6px;
color: rgba(var(--center-channel-color-rgb), 0.64);
}
}
.inputWrapper {
position: relative;

.categoryNameInput {
width: 100%;
.inputWrapper__close-wrapper {
position: absolute;
height: 100%;
top: 0;
right: 0;
display: flex;
align-items: center;
padding-right: 12px;
}

input {
height: 48px;
font-size: 16px;
border-radius: 4px;
border: 1px solid rgba(var(--center-channel-color-rgb), 0.16);
background: var(--center-channel-bg);
color: var(--center-channel-color);
padding: 0 16px;
flex: 1;
transition: border 0.15s ease-in;
.CloseCircle {
cursor: pointer;
font-size: 18px;
color: rgba(var(--center-channel-color-rgb), 0.64);

&:focus {
border-color: var(--button-bg);
box-shadow: inset 0 0 0 1px var(--button-bg);
&:hover {
color: rgba(var(--center-channel-color-rgb), 0.8);
}
}
}

.footer {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.categoryNameInput {
width: 100%;
}

.createCategoryActions {
display: flex;
flex-direction: row;
justify-content: flex-end;
margin-top: auto;
gap: 12px;
input {
height: 48px;
font-size: 16px;
border-radius: 4px;
border: 1px solid rgba(var(--center-channel-color-rgb), 0.16);
background: var(--center-channel-bg);
color: var(--center-channel-color);
padding: 0 16px;
flex: 1;
transition: border 0.15s ease-in;

&:focus {
border-color: var(--button-bg);
box-shadow: inset 0 0 0 1px var(--button-bg);
}
}

.footer {
display: flex;
flex-direction: row;
justify-content: flex-end;
}

.createCategoryActions {
display: flex;
flex-direction: row;
justify-content: flex-end;
margin-top: auto;
gap: 12px;
}
}
}
2 changes: 1 addition & 1 deletion webapp/src/components/createCategory/createCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CreateCategory = (props: Props): JSX.Element => {
{
Boolean(name) &&
<div
className='clearBtn'
className='clearBtn inputWrapper__close-wrapper'
onClick={() => setName('')}
>
<CloseCircle/>
Expand Down
Loading

0 comments on commit 297e8f4

Please sign in to comment.