Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update modal buttons alignments in element dialogs #3365

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/styleguide.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
&.bce,
&.bcp {
height: 600px;

.bcu {
height: 100%;
}
}

&.bcpr {
Expand Down
4 changes: 2 additions & 2 deletions src/elements/common/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
line-height: 20px;
letter-spacing: .3px;

// TODO: Remove when border-color in src/styles/_inputs.scss is accessible
input[type='text'],
input[type='date'],
input[type='password'],
Expand All @@ -23,7 +22,8 @@
input[type='number'],
div[contentEditable='true'],
textarea {
border-color: $bdl-gray-50;
width: 100%;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding width: 100% here can be a little risky since it'll apply the style to all text fields in all the elements.

I did testing in all the elements but haven't seen an issue yet. most uses of inputs/textareas are already using width: 100%. e.g:

border-color: $bdl-gray-50; // TODO: Remove when border-color in src/styles/_inputs.scss is accessible
}

/* stylelint-disable */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ const CreateFolderDialog = ({
<input ref={ref} onKeyDown={onKeyDown} required type="text" />
</label>
<div className="be-modal-btns">
<PrimaryButton data-testid="be-btn-create-folder" isLoading={isLoading} onClick={create} type="button">
<FormattedMessage {...messages.create} />
</PrimaryButton>
<Button
data-testid="be-btn-create-folder-cancel"
isDisabled={isLoading}
Expand All @@ -120,6 +117,9 @@ const CreateFolderDialog = ({
>
<FormattedMessage {...messages.cancel} />
</Button>
<PrimaryButton data-testid="be-btn-create-folder" isLoading={isLoading} onClick={create} type="button">
<FormattedMessage {...messages.create} />
</PrimaryButton>
</div>
</Modal>
);
Expand Down
8 changes: 1 addition & 7 deletions src/elements/common/header/Header.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import '../variables';

.be .be-header {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the .be on this selector breaks the .be-is-small & selector below

.be-header {
display: flex;
flex: 0 0 70px;
align-items: center;
Expand All @@ -16,10 +16,4 @@
flex: 1;
padding-left: 20px;
}

input[type='search'] {
width: 100%;
font: inherit;
-webkit-appearance: none;
}
Comment on lines -20 to -24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure what these lines were intended for. my assumption is this was related to a Safari issue but we don't target input[type='search'] for any other components so I don't know why this was needed.

I think it's okay to remove the block now:

}
9 changes: 7 additions & 2 deletions src/elements/common/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
.be-modal {
.be-modal-btns {
display: flex;
justify-content: center;
justify-content: flex-end;
padding: 15px 0 0;

.btn {
@include bdl-Button--large;

margin-left: 8px;
margin-top: 0;
margin-bottom: 0;

&:last-of-type {
margin-right: 0;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/elements/content-explorer/DeleteConfirmationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ const DeleteConfirmationDialog = ({
>
<FormattedMessage {...message} values={{ name: item.name }} />
<div className="be-modal-btns">
<PrimaryButton isLoading={isLoading} onClick={onDelete} type="button">
<FormattedMessage {...messages.delete} />
</PrimaryButton>
<Button autoFocus isDisabled={isLoading} onClick={onCancel} type="button">
<FormattedMessage {...messages.cancel} />
</Button>
<PrimaryButton isLoading={isLoading} onClick={onDelete} type="button">
<FormattedMessage {...messages.delete} />
</PrimaryButton>
</div>
</Modal>
);
Expand Down
6 changes: 3 additions & 3 deletions src/elements/content-explorer/RenameDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ const RenameDialog = ({
<input ref={ref} defaultValue={nameWithoutExt} onKeyDown={onKeyDown} required type="text" />
</label>
<div className="be-modal-btns">
<PrimaryButton isLoading={isLoading} onClick={rename} type="button">
<FormattedMessage {...messages.rename} />
</PrimaryButton>
<Button isDisabled={isLoading} onClick={onCancel} type="button">
<FormattedMessage {...messages.cancel} />
</Button>
<PrimaryButton isLoading={isLoading} onClick={rename} type="button">
<FormattedMessage {...messages.rename} />
</PrimaryButton>
</div>
</Modal>
);
Expand Down