Skip to content

Commit

Permalink
fix(client): fix avatar border and split component
Browse files Browse the repository at this point in the history
feature/avatar-separation
  • Loading branch information
Gabriel Santos committed Sep 16, 2019
1 parent 4ce8a82 commit 0085614
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
14 changes: 14 additions & 0 deletions src/components/avatar/Avatar.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import './Avatar.scss';
import template from './AvatarView.html';
import angular from 'core/angular';

export const AvatarComponent = angular
.module('blipComponents.avatar', [])
.component('avatar', {
controllerAs: '$ctrl',
bindings: {
user: '<?'
},
template,
})
.name;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.avatar-array {
& > tooltip {
.avatar {
tooltip {
width: 55px;
height: 55px;
cursor: default;
Expand All @@ -21,25 +21,10 @@
img {
width: 55px;
height: 55px;
border-radius: 50%;
}
}
// & > span {
// cursor: default;
// padding: 2px;
// height: 55px;
// width: 55px;
// // border: 1px solid red;
// background: white;
// border-radius: 50%;
// position: absolute;
// left: 0;
// transition: left 1s linear;

// img {
// width: 55px;
// height: 55px;
// }
// }
letter-avatar {
margin: 0;
height: 50px;
Expand Down
6 changes: 6 additions & 0 deletions src/components/avatar/AvatarView.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<span class="avatar">
<span tooltips tooltip-template="{{$ctrl.$ctrl.user.tooltipName}}" tooltip-side="bottom" tooltip-class="small">
<img ng-if="$ctrl.user.photoUri" ng-src="{{$ctrl.user.photoUri}}" alt="{{$ctrl.user.fullName}}">
<letter-avatar ng-if="!$ctrl.user.photoUri" class="account-editing-avatar ml4" text="$ctrl.user.fullName"></letter-avatar>
</span>
</span>
3 changes: 1 addition & 2 deletions src/components/avatarArray/AvatarArray.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './AvatarArray.scss';
import template from './AvatarArrayView.html';
import angular from 'core/angular';

Expand All @@ -10,7 +9,7 @@ class AvatarArray {
this.$scope.$watch('$ctrl.members', (newValue, oldValue) => {
setTimeout(() => {
let array = Array.from(
document.querySelectorAll('.avatar-array > tooltip'),
document.querySelectorAll('.avatar-array tooltip'),
) as Element[];
if (this.limit) {
array = array.slice(0, this.limit);
Expand Down
5 changes: 1 addition & 4 deletions src/components/avatarArray/AvatarArrayView.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<div class="avatar-array">
<span tooltips tooltip-template="{{member.tooltipName}}" tooltip-side="bottom" tooltip-class="small" ng-repeat="member in $ctrl.members">
<img ng-if="member.photoUri" ng-src="{{member.photoUri}}" alt="{{member.fullName}}">
<letter-avatar ng-if="!member.photoUri" class="account-editing-avatar ml4" text="member.fullName"></letter-avatar>
</span>
<avatar user="member" ng-repeat="member in $ctrl.members"></avatar>
</div>
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import angular from 'core/angular';
import { accordion } from './accordion';
import { AnalysisInfoComponent } from './analysisInfo/analysisInfo.component';
import { AvatarComponent } from './avatar/avatar.component';
import { AvatarArrayComponent } from './avatarArray/avatarArray.component';
import { ActionsBarComponent } from './actionsBar/actionsBar.component';
import { AddRemoveComponent } from './addRemove/addRemove.component';
Expand Down Expand Up @@ -74,6 +75,7 @@ export const ComponentsModule = angular
.module('ComponentsModule', [
accordion,
AnalysisInfoComponent,
AvatarComponent,
AvatarArrayComponent,
ActionsBarComponent,
AddRemoveComponent,
Expand Down

0 comments on commit 0085614

Please sign in to comment.