DEV: Add element wrapper to the body and screenshot (#30497)

This commit is contained in:
Ella E. 2024-12-30 18:09:04 -07:00 committed by GitHub
parent 86637403c7
commit d1b3b85584
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,65 +92,69 @@ export default class DiscourseNewFeatureItem extends Component {
{{/if}}
</div>
{{#if @item.screenshot_url}}
<img
src={{@item.screenshot_url}}
class="admin-new-feature-item__screenshot"
alt={{@item.title}}
/>
{{/if}}
<div class="admin-new-feature-item__body">
<div class="admin-new-feature-item__feature-description">
<CookText @rawText={{@item.description}} />
{{#if @item.link}}
<a
href={{@item.link}}
target="_blank"
rel="noopener noreferrer"
class="admin-new-feature-item__learn-more"
>
{{i18n "admin.dashboard.new_features.learn_more"}}
</a>
{{/if}}
</div>
{{#if @item.experiment_setting}}
<div class="admin-new-feature-item__feature-toggle">
<DTooltip>
<:trigger>
<DToggleSwitch
@state={{this.experimentEnabled}}
{{on "click" this.toggleExperiment}}
/>
</:trigger>
<:content>
<div class="admin-new-feature-item__tooltip">
<div class="admin-new-feature-item__tooltip-header">
{{i18n
(if
this.experimentEnabled
"admin.dashboard.new_features.experiment_tooltip.title_enabled"
"admin.dashboard.new_features.experiment_tooltip.title_disabled"
)
}}
</div>
<div class="admin-new-feature-item__tooltip-content">
{{htmlSafe
(i18n
(if
this.experimentEnabled
"admin.dashboard.new_features.experiment_tooltip.content_enabled"
"admin.dashboard.new_features.experiment_tooltip.content_disabled"
)
)
}}
</div>
</div>
</:content>
</DTooltip>
<div class="admin-new-feature-item__body-wrapper">
{{#if @item.screenshot_url}}
<div class="admin-new-feature-item__img-container">
<img
src={{@item.screenshot_url}}
class="admin-new-feature-item__screenshot"
alt={{@item.title}}
/>
</div>
{{/if}}
<div class="admin-new-feature-item__body">
<div class="admin-new-feature-item__feature-description">
<CookText @rawText={{@item.description}} />
{{#if @item.link}}
<a
href={{@item.link}}
target="_blank"
rel="noopener noreferrer"
class="admin-new-feature-item__learn-more"
>
{{i18n "admin.dashboard.new_features.learn_more"}}
</a>
{{/if}}
</div>
{{#if @item.experiment_setting}}
<div class="admin-new-feature-item__feature-toggle">
<DTooltip>
<:trigger>
<DToggleSwitch
@state={{this.experimentEnabled}}
{{on "click" this.toggleExperiment}}
/>
</:trigger>
<:content>
<div class="admin-new-feature-item__tooltip">
<div class="admin-new-feature-item__tooltip-header">
{{i18n
(if
this.experimentEnabled
"admin.dashboard.new_features.experiment_tooltip.title_enabled"
"admin.dashboard.new_features.experiment_tooltip.title_disabled"
)
}}
</div>
<div class="admin-new-feature-item__tooltip-content">
{{htmlSafe
(i18n
(if
this.experimentEnabled
"admin.dashboard.new_features.experiment_tooltip.content_enabled"
"admin.dashboard.new_features.experiment_tooltip.content_disabled"
)
)
}}
</div>
</div>
</:content>
</DTooltip>
</div>
{{/if}}
</div>
</div>
</div>
</div>