Skip to content

Commit

Permalink
feat(cc-tile-requests): implement cc-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-sanders-cc authored and roberttran-cc committed Jun 26, 2023
1 parent 8450410 commit 73e98d6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/assets/cc-clever.icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 1 addition & 59 deletions src/assets/info.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions src/components/cc-tile-requests/cc-tile-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import { BarController, BarElement, CategoryScale, Chart, LinearScale, Title, To
import ChartDataLabels from 'chartjs-plugin-datalabels';
import { css, html, LitElement } from 'lit';
import { classMap } from 'lit/directives/class-map.js';
import { iconCleverInfo as iconInfo } from '../../assets/cc-clever.icons.js';
import { iconRemixCloseLine as iconClose } from '../../assets/cc-remix.icons.js';
import { i18n } from '../../lib/i18n.js';
import { withResizeObserver } from '../../mixins/with-resize-observer/with-resize-observer.js';
import { tileStyles } from '../../styles/info-tiles.js';
import { skeletonStyles } from '../../styles/skeleton.js';

const closeSvg = new URL('../../assets/close.svg', import.meta.url).href;
const infoSvg = new URL('../../assets/info.svg', import.meta.url).href;

Chart.register(BarController, BarElement, Tooltip, CategoryScale, LinearScale, Title);

/** @type {RequestsData[]} */
Expand Down Expand Up @@ -251,8 +250,8 @@ export class CcTileRequests extends withResizeObserver(LitElement) {
<div class="tile_title tile_title--image">
${i18n('cc-tile-requests.title')}
<cc-button
class="docs-toggle"
image=${displayDocs ? closeSvg : infoSvg}
class="docs-toggle ${displayDocs ? 'close' : 'info'}"
.icon=${displayDocs ? iconClose : iconInfo}
hide-text
outlined
primary
Expand Down Expand Up @@ -294,6 +293,14 @@ export class CcTileRequests extends withResizeObserver(LitElement) {
font-size: 0.8em;
}
.docs-toggle.close {
--cc-icon-size: 1.5em;
}
.docs-toggle.info {
--cc-icon-size: 1.25em;
}
.chart-container {
position: absolute;
width: 100%;
Expand Down

0 comments on commit 73e98d6

Please sign in to comment.