forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
personalization: add zero state for ambient subpage
When ambient mode is disabled, show zero state image and message. BUG=b/224550204 TEST=browser_tests --gtest_filter="PersonalizationAppComponentBrowserTest" Screenshot: https://screenshot.googleplex.com/6kcjM8aqpiMM22B Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome Change-Id: Ic1e2d8555056f8142a0d9b092bf4d6d7846626ad Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3522727 Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org> Commit-Queue: Jason Thai <jasontt@chromium.org> Cr-Commit-Position: refs/heads/main@{#980949}
- Loading branch information
Jason Thai
authored and
Chromium LUCI CQ
committed
Mar 15, 2022
1 parent
5ba00f6
commit 3b72df1
Showing
11 changed files
with
335 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
ash/webui/personalization_app/resources/common/ambient_mode_disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions
85
ash/webui/personalization_app/resources/common/ambient_mode_disabled_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
ash/webui/personalization_app/resources/trusted/ambient/zero_state_element.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<style include="trusted-style common-style"> | ||
:host { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
margin: 34px 0; | ||
overflow: hidden; | ||
} | ||
|
||
div { | ||
color: var(--cros-text-color-secondary); | ||
font: var(--cros-body-1-font); | ||
max-width: 236px; | ||
text-align: center; | ||
} | ||
|
||
img { | ||
width: 260px; | ||
} | ||
</style> | ||
|
||
<iron-media-query query="(prefers-color-scheme: dark)" | ||
query-matches="{{isDarkModeActive_}}"> | ||
</iron-media-query> | ||
<img src="[[getImageSource_(isDarkModeActive_)]]" aria-hidden="true"> | ||
<div>$i18n{ambientModeZeroStateMessage}</div> |
48 changes: 48 additions & 0 deletions
48
ash/webui/personalization_app/resources/trusted/ambient/zero_state_element.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* @fileoverview Polymer element that displays the Ambient zero state. | ||
*/ | ||
|
||
import '../../common/styles.js'; | ||
|
||
import 'chrome://resources/polymer/v3_0/iron-media-query/iron-media-query.js'; | ||
import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {WithPersonalizationStore} from '../personalization_store.js'; | ||
|
||
export class AmbientZeroState extends WithPersonalizationStore { | ||
static get is() { | ||
return 'ambient-zero-state'; | ||
} | ||
|
||
static get template() { | ||
return html`{__html_template__}`; | ||
} | ||
|
||
static get properties() { | ||
return { | ||
isDarkModeActive_: { | ||
type: Boolean, | ||
value: false, | ||
}, | ||
}; | ||
} | ||
|
||
/** Whether the page is being rendered in dark mode. */ | ||
private isDarkModeActive_: boolean; | ||
|
||
/** | ||
* Returns the image source based on whether the page is being | ||
* rendered in dark mode. | ||
*/ | ||
private getImageSource_() { | ||
return this.isDarkModeActive_ ? | ||
'chrome://personalization/common/ambient_mode_disabled_dark.svg' : | ||
'chrome://personalization/common/ambient_mode_disabled.svg'; | ||
} | ||
} | ||
|
||
customElements.define(AmbientZeroState.is, AmbientZeroState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.