Browse Source

Fix toolbar and share buttons (#2646)

pull/2663/head
Vladyslav 7 years ago
committed by GitHub
parent
commit
4ede9a3a4d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.html
  2. 29
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-toolbar.component.scss
  3. 8
      ui-ngx/src/app/shared/components/socialshare-panel.component.html
  4. 12
      ui-ngx/src/app/shared/components/socialshare-panel.component.ts

2
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-form.component.html

@ -69,7 +69,7 @@
</mat-form-field> </mat-form-field>
<div fxLayout="column" [fxShow]="!isEdit && (dashboardScope === 'tenant' && isPublic(entity) <div fxLayout="column" [fxShow]="!isEdit && (dashboardScope === 'tenant' && isPublic(entity)
|| dashboardScope === 'customer' && isCurrentPublicCustomer(entity))"> || dashboardScope === 'customer' && isCurrentPublicCustomer(entity))">
<tb-social-share-panel style="padding-bottom: 10px;" <tb-social-share-panel style="padding-bottom: 1.25em;"
shareTitle="{{ 'dashboard.socialshare-title' | translate:{dashboardTitle: entity?.title} }}" shareTitle="{{ 'dashboard.socialshare-title' | translate:{dashboardTitle: entity?.title} }}"
shareText="{{ 'dashboard.socialshare-text' | translate:{dashboardTitle: entity?.title} }}" shareText="{{ 'dashboard.socialshare-text' | translate:{dashboardTitle: entity?.title} }}"
shareLink="{{ publicLink }}" shareLink="{{ publicLink }}"

29
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-toolbar.component.scss

@ -24,29 +24,12 @@ $mobile-toolbar-height-total: 84px !default;
tb-dashboard-toolbar { tb-dashboard-toolbar {
mat-fab-toolbar { mat-fab-toolbar {
mat-fab-trigger { mat-fab-trigger {
.mat-button { .mat-fab {
&.mat-fab { width: 36px;
width: 36px; height: 36px;
height: 36px; margin: 4px 0 0 4px;
margin: 4px 0 0 4px; .mat-button-wrapper {
line-height: 36px; padding: 0;
.mat-button-wrapper {
width: 36px;
height: 36px;
padding: 0 6px;
box-sizing: border-box;
}
mat-icon {
display: block;
position: absolute;
top: 25%;
width: 18px;
min-width: 18px;
height: 18px;
min-height: 18px;
margin: 0;
line-height: 18px;
}
} }
} }
} }

8
ui-ngx/src/app/shared/components/socialshare-panel.component.html

@ -16,7 +16,7 @@
--> -->
<div fxLayout="row" fxLayoutGap="12px" [fxHide]="isShareLinkLocal()"> <div fxLayout="row" fxLayoutGap="12px" [fxHide]="isShareLinkLocal()">
<button mat-button mat-icon-button mat-raised-button class="mat-primary" <button mat-icon-button mat-raised-button class="mat-primary"
shareButton="facebook" shareButton="facebook"
title="{{ shareTitle }}" title="{{ shareTitle }}"
description="{{ shareText }}" description="{{ shareText }}"
@ -25,7 +25,7 @@
matTooltip="{{ 'action.share-via' | translate:{provider:'Facebook'} }}"> matTooltip="{{ 'action.share-via' | translate:{provider:'Facebook'} }}">
<mat-icon svgIcon="mdi:facebook"></mat-icon> <mat-icon svgIcon="mdi:facebook"></mat-icon>
</button> </button>
<button mat-button mat-icon-button mat-raised-button class="mat-primary" <button mat-icon-button mat-raised-button class="mat-primary"
shareButton="twitter" shareButton="twitter"
title="{{ shareTitle }}" title="{{ shareTitle }}"
tags="{{ shareHashTags }}" tags="{{ shareHashTags }}"
@ -34,7 +34,7 @@
matTooltip="{{ 'action.share-via' | translate:{provider:'Twitter'} }}"> matTooltip="{{ 'action.share-via' | translate:{provider:'Twitter'} }}">
<mat-icon svgIcon="mdi:twitter"></mat-icon> <mat-icon svgIcon="mdi:twitter"></mat-icon>
</button> </button>
<button mat-button mat-icon-button mat-raised-button class="mat-primary" <button mat-icon-button mat-raised-button class="mat-primary"
shareButton="linkedin" shareButton="linkedin"
title="{{ shareTitle }}" title="{{ shareTitle }}"
url="{{ shareLink }}" url="{{ shareLink }}"
@ -42,7 +42,7 @@
matTooltip="{{ 'action.share-via' | translate:{provider:'Linkedin'} }}"> matTooltip="{{ 'action.share-via' | translate:{provider:'Linkedin'} }}">
<mat-icon svgIcon="mdi:linkedin"></mat-icon> <mat-icon svgIcon="mdi:linkedin"></mat-icon>
</button> </button>
<button mat-button mat-icon-button mat-raised-button class="mat-primary" <button mat-icon-button mat-raised-button class="mat-primary"
shareButton="reddit" shareButton="reddit"
title="{{ shareTitle }}" title="{{ shareTitle }}"
url="{{ shareLink }}" url="{{ shareLink }}"

12
ui-ngx/src/app/shared/components/socialshare-panel.component.ts

@ -14,16 +14,8 @@
/// limitations under the License. /// limitations under the License.
/// ///
import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { User } from '@shared/models/user.model'; import { isLocalUrl } from '@core/utils';
import { Authority } from '@shared/models/authority.enum';
import { select, Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { selectAuthUser, selectUserDetails } from '@core/auth/auth.selectors';
import { map } from 'rxjs/operators';
import { AuthService } from '@core/auth/auth.service';
import { Router } from '@angular/router';
import {isLocalUrl} from '@core/utils';
@Component({ @Component({
selector: 'tb-social-share-panel', selector: 'tb-social-share-panel',

Loading…
Cancel
Save