forked from web-padawan/aybolit
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cxl-ui): refactor
cxl-light-card
component based on `cxl-base-…
- Loading branch information
1 parent
1a688fa
commit 4989403
Showing
4 changed files
with
42 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,27 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { LitElement, html, nothing } from 'lit'; | ||
import { customElement, property } from 'lit/decorators.js'; | ||
import { html } from 'lit'; | ||
import { customElement, state } from 'lit/decorators.js'; | ||
import '@conversionxl/cxl-lumo-styles'; | ||
import cxlLightCardStyles from '../styles/cxl-light-card-css.js'; | ||
import { CXLBaseCardElement } from './cxl-base-card.js'; | ||
|
||
@customElement('cxl-light-card') | ||
export class CXLLightCardElement extends LitElement { | ||
export class CXLLightCardElement extends CXLBaseCardElement { | ||
static get styles() { | ||
return [cxlLightCardStyles]; | ||
return [...super.styles, cxlLightCardStyles]; | ||
} | ||
|
||
@property({ type: String }) id = ''; | ||
@state() showTags = false; | ||
|
||
@property({ type: String }) theme = 'light-card'; | ||
@property({ type: String }) title = ''; | ||
@property({ type: String }) time = ''; | ||
@property({ type: String }) instructorPrefix = 'By:'; | ||
@property({ type: String }) instructor = ''; | ||
@property({ type: String }) avatar = ''; | ||
|
||
@property({ type: Boolean, reflect: true }) new = false; | ||
|
||
@property({ type: Boolean, reflect: true }) completed = false; | ||
@state() showTimeIcon = true; | ||
|
||
render() { | ||
return html` | ||
<header class="entry-header"> | ||
${this.new ? html`<vaadin-icon icon="cxl:new"></vaadin-icon>` : nothing} | ||
<div> | ||
<div class="entry-title"> | ||
${this.title} | ||
${this.completed ? html`<vaadin-icon icon="lumo:checkmark"></vaadin-icon>` : nothing} | ||
</div> | ||
<div class="entry-byline"> | ||
<div><vaadin-icon icon="lumo:clock"></vaadin-icon>${this.time}</div> | ||
<div>${this.instructorPrefix} ${this.instructor}</div> | ||
</div> | ||
</div> | ||
<img class="thumbnail" src="${this.avatar}" alt="${this.instructor}" /> | ||
</header> | ||
<slot name="footer"></slot> | ||
<div class="container"> | ||
${this._renderHeader()} | ||
<slot name="footer"></slot> | ||
<vaadin-icon class="badge-new" icon="cxl:new"></vaadin-icon> | ||
</div> | ||
`; | ||
} | ||
} |
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