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

Use existing title class #1

Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,12 @@

.embPanel__titleText {
@include euiTextTruncate;
}

.embPanel__titleLink {
font-weight: $euiFontWeightBold;
}

.embPanel__placeholderTitleText {
@include euiTextTruncate;
font-weight: $euiFontWeightRegular;
color: $euiColorMediumShade;
font-weight: $euiFontWeightRegular;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,22 @@ export function PanelHeader({
let titleComponent;
if (showTitle) {
titleComponent = isViewMode ? (
<span className={title ? 'embPanel__titleText' : 'embPanel__placeholderTitleText'}>
<span
className={classNames('embPanel__titleText', {
// eslint-disable-next-line @typescript-eslint/naming-convention
embPanel__placeholderTitleText: !title,
})}
>
{title || placeholderTitle}
</span>
) : (
<EuiLink
color="text"
data-test-subj={'embeddablePanelTitleLink'}
className={
title ? 'embPanel__titleText embPanel__titleLink' : 'embPanel__placeholderTitleText'
}
className={classNames('embPanel__titleText', {
// eslint-disable-next-line @typescript-eslint/naming-convention
embPanel__placeholderTitleText: !title,
})}
aria-label={i18n.translate('embeddableApi.panel.editTitleAriaLabel', {
defaultMessage: 'Click to edit title: {title}',
values: { title: title || placeholderTitle },
Expand Down