Skip to content

Commit

Permalink
First cta is always primary in card
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Oct 15, 2023
1 parent 6bd5e4c commit 2a58f20
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:host {
&:not(.active) { display: none; }
&:not(.visible) { display: none; }
app-card-action {
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Card } from '../consts';
templateUrl: './card-action-nav.component.html',
styleUrls: ['./card-action-nav.component.less'],
host: {
'[class.active]': 'active',
'[class.visible]': 'active',
}
})
export class CardActionNavComponent implements OnChanges {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<app-card-action kind='phone' [card]='card' [display]='display' [action]='action' [primary]='true' [compact]='compact' [label]='"ביצוע שיחת טלפון ל" + orgname + " במספר " + display'></app-card-action>
<app-card-action kind='phone' [card]='card' [display]='display' [action]='action' [compact]='compact' [label]='"ביצוע שיחת טלפון ל" + orgname + " במספר " + display'></app-card-action>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:host {
&:not(.active) { display: none; }
&:not(.visible) { display: none; }
app-card-action {
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Card } from '../consts';
templateUrl: './card-action-url.component.html',
styleUrls: ['./card-action-url.component.less'],
host: {
'[class.active]': 'active',
'[class.visible]': 'active',
}
})
export class CardActionUrlComponent implements OnChanges {
Expand Down
11 changes: 7 additions & 4 deletions projects/srm/src/app/quick-actions/quick-actions.component.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { Component, Input, OnInit } from '@angular/core';
import { AfterViewInit, Component, ElementRef, Input, OnInit } from '@angular/core';
import { Card } from '../consts';

@Component({
selector: 'app-quick-actions',
templateUrl: './quick-actions.component.html',
styleUrls: ['./quick-actions.component.less']
})
export class QuickActionsComponent implements OnInit {
export class QuickActionsComponent implements AfterViewInit {

@Input() card: Card;

constructor() { }
constructor(private el: ElementRef) { }

ngAfterViewInit(): void {
const first = this.el.nativeElement.querySelector('.visible app-card-action a') as HTMLElement;
first.classList.add('primary');

ngOnInit(): void {
}

}

0 comments on commit 2a58f20

Please sign in to comment.