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

Add app device name display in app list #190

Merged
merged 4 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions build/bundle.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/css/components/_h-scroll-menu-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
height: 23%;
}

&__device-name {
position: absolute;
top: 10px;
width: 100%;
height: 10%;
}

&.with-icon {
.hscrollmenu-item__image {
@include size(50px);
Expand Down
3 changes: 3 additions & 0 deletions src/js/HScrollMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export default class HScrollMenuItem extends React.Component {
<div
className={`hscrollmenu-item th-b-color th-tile-background-color ${menuItem.class}`}
onClick={() => this.props.onSelection(this.props.appID, this.props.cmdID, this.props.menuID)}>
<div className="hscrollmenu-item__device-name">
<p className="t-light th-f-color-secondary t-oneline">{ menuItem.devicename }</p>
</div>
<div className="hscrollmenu-item__image">
{ graphic }
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/js/containers/AppList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ const mapStateToProps = (state) => {
link = state.ui[app.appID].displayLayout ? state.ui[app.appID].displayLayout : defaultLink
}
var name = app.isCloudApplication ? app.appName + " (Cloud)" : app.appName;
var devicename = (app.deviceInfo.name.trim()) ? app.deviceInfo.name
: app.deviceInfo.transportType + ": " + app.deviceInfo.id.substring(0, 10) + "...";
return {
appID: app.appID,
class: 'with-image',
name: name,
devicename: devicename,
image: icon,
link: '/' + link,
cmdID: app.appID
Expand Down