Commit 2179400d authored by Curt Clemens's avatar Curt Clemens Committed by Commit Bot

[Nearby] Set file preview icons grey on error

The file preview icon on the discovery page and confirmation page needs
to be grey whenever those pages are in an error state. This CL adds a
|disabled| property to nearby-preview that when true applies a css
class that makes the icon grey.

Bug: b/163036847
Change-Id: I4a0f24a1ed9f013d499eb2dff9bf24064f0898e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2554901Reviewed-by: default avatarJames Vecore <vecore@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Curt Clemens <cclem@google.com>
Cr-Commit-Position: refs/heads/master@{#830550}
parent 43eaeaee
...@@ -92,7 +92,9 @@ ...@@ -92,7 +92,9 @@
cancel-button-event-name="[[getCancelEventName_(needsConfirmation_)]]"> cancel-button-event-name="[[getCancelEventName_(needsConfirmation_)]]">
<div id="centerContent" slot="content"> <div id="centerContent" slot="content">
<div id="processRow"> <div id="processRow">
<nearby-preview send-preview="[[sendPreview]]"></nearby-preview> <nearby-preview send-preview="[[sendPreview]]"
disabled="[[errorTitle_]]">
</nearby-preview>
<div id="confirmationToken"> <div id="confirmationToken">
<template is="dom-if" if="[[confirmationToken_]]"> <template is="dom-if" if="[[confirmationToken_]]">
[[i18n('nearbyShareSecureConnectionId', confirmationToken_)]] [[i18n('nearbyShareSecureConnectionId', confirmationToken_)]]
......
...@@ -132,7 +132,9 @@ ...@@ -132,7 +132,9 @@
autoplay="true"> autoplay="true">
</cr-lottie> </cr-lottie>
<div id="process-row"> <div id="process-row">
<nearby-preview send-preview="[[sendPreview]]"></nearby-preview> <nearby-preview send-preview="[[sendPreview]]"
disabled="[[errorTitle_]]">
</nearby-preview>
<div id="placeholder" <div id="placeholder"
hidden="[[!isShareTargetsEmpty_(shareTargets_.*)]]"> hidden="[[!isShareTargetsEmpty_(shareTargets_.*)]]">
$i18n{nearbyShareDiscoveryPagePlaceholder} $i18n{nearbyShareDiscoveryPagePlaceholder}
......
...@@ -6,6 +6,11 @@ ...@@ -6,6 +6,11 @@
width: 68px; width: 68px;
} }
iron-icon.disabled {
--nearby-preview-color: var(--google-grey-600);
--nearby-preview-background-color: var(--google-grey-200);
}
#title { #title {
color: var(--google-grey-900); color: var(--google-grey-900);
font-size: 13px; font-size: 13px;
...@@ -20,5 +25,7 @@ ...@@ -20,5 +25,7 @@
} }
</style> </style>
<iron-icon icon="[[getIronIconName_(sendPreview)]]"></iron-icon> <iron-icon class$="[[getIconClass_(disabled)]]"
icon="[[getIronIconName_(sendPreview)]]">
</iron-icon>
<div id="title">[[getTitle_(sendPreview)]]</div> <div id="title">[[getTitle_(sendPreview)]]</div>
...@@ -31,6 +31,14 @@ Polymer({ ...@@ -31,6 +31,14 @@ Polymer({
value: null, value: null,
}, },
/**
* Controls whether the icon should be greyed out.
* @type {boolean}
*/
disabled: {
type: Boolean,
value: false,
},
}, },
/** /**
...@@ -94,4 +102,15 @@ Polymer({ ...@@ -94,4 +102,15 @@ Polymer({
return 'nearbysharetype68:unknown-file'; return 'nearbysharetype68:unknown-file';
} }
}, },
/**
* @return {string} The css class to be applied to the icon.
* @private
*/
getIconClass_() {
if (this.disabled) {
return 'disabled';
}
return '';
},
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment