Skip to content

Commit

Permalink
Merge pull request #44 from NicolasConstant/develop
Browse files Browse the repository at this point in the history
Merge for 0.2
  • Loading branch information
NicolasConstant authored Feb 24, 2019
2 parents b1c87fa + b58809c commit c674d8f
Show file tree
Hide file tree
Showing 23 changed files with 654 additions and 290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h3 class="panel__title">new message</h3>
<select class="form-control form-control-sm form-control--privacy" id="privacy" name="privacy" [(ngModel)]="selectedPrivacy">
<option *ngFor="let p of privacyList" [ngValue]="p">{{p}}</option>
</select>
<button type="submit" class="btn btn-sm btn-custom-primary">TOOT!</button>
<button type="submit" class="btn btn-sm btn-custom-primary">POST!</button>
</form>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ export class ManageAccountComponent implements OnInit {
ngOnInit() {
const instance = this.account.info.instance;
this.availableStreams.length = 0;
this.availableStreams.push(new StreamElement(StreamTypeEnum.global, 'Federated Timeline', this.account.info.id, null, null, `federate@${instance}`));
this.availableStreams.push(new StreamElement(StreamTypeEnum.local, 'Local Timeline', this.account.info.id, null, null, `local@${instance}`));
this.availableStreams.push(new StreamElement(StreamTypeEnum.personnal, 'Home', this.account.info.id, null, null, `home@${instance}`));
this.availableStreams.push(new StreamElement(StreamTypeEnum.global, 'Federated Timeline', this.account.info.id, null, null, instance));
this.availableStreams.push(new StreamElement(StreamTypeEnum.local, 'Local Timeline', this.account.info.id, null, null, instance));
this.availableStreams.push(new StreamElement(StreamTypeEnum.personnal, 'Home', this.account.info.id, null, null, instance));
}

addStream(stream: StreamElement): boolean {
if (stream) {
this.store.dispatch([new AddStream(stream)]).toPromise()
.then(() => {
this.notificationService.notify(`${stream.displayableFullName} added`, false);
this.notificationService.notify(`stream added`, false);
});
}
return false;
Expand Down
63 changes: 34 additions & 29 deletions src/app/components/floating-column/search/search.component.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
<div class="panel">
<h3 class="panel__title">search</h3>

<form class="form-section" (ngSubmit)="onSubmit()">
<input type="text" class="form-control form-control-sm form-with-button" [(ngModel)]="searchHandle" name="searchHandle"
placeholder="Search" autocomplete="off" />
<button class="form-button" type="submit" title="search">GO</button>
</form>
<div class="search-result-form">
<h3 class="panel__title">search</h3>

<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>

<div *ngIf="accounts.length > 0" class="search-results">
<h3 class="search-results__title">Accounts</h3>
<a href *ngFor="let account of accounts" class="account" title="open account"
(click)="browseAccount(account.acct)">
<img src="{{account.avatar}}" class="account__avatar" />
<div class="account__name">{{ account.username }}</div>
<div class="account__fullhandle">@{{ account.acct }}</div>
</a>
<form class="form-section" (ngSubmit)="onSubmit()">
<input type="text" class="form-control form-control-sm form-with-button" [(ngModel)]="searchHandle"
name="searchHandle" placeholder="Search" autocomplete="off" />
<button class="form-button" type="submit" title="search">GO</button>
</form>
</div>

<div *ngIf="hashtags.length > 0" class="search-results">
<h3 class="search-results__title">Hashtags</h3>
<a (click)="browseHashtag(hashtag)" href *ngFor="let hashtag of hashtags" class="search-results__hashtag" title="browse hashtag">
#{{ hashtag }}
</a>
</div>
<div class="search-result-display flexcroll">
<app-waiting-animation *ngIf="isLoading" class="waiting-icon"></app-waiting-animation>

<div *ngIf="accounts.length > 0" class="search-results">
<h3 class="search-results__title">Accounts</h3>
<a href *ngFor="let account of accounts" class="account" title="open account"
(click)="browseAccount(account.acct)">
<img src="{{account.avatar}}" class="account__avatar" />
<div class="account__name">{{ account.username }}</div>
<div class="account__fullhandle">@{{ account.acct }}</div>
</a>
</div>

<div *ngIf="hashtags.length > 0" class="search-results">
<h3 class="search-results__title">Hashtags</h3>
<a (click)="browseHashtag(hashtag)" href *ngFor="let hashtag of hashtags" class="search-results__hashtag"
title="browse hashtag">
#{{ hashtag }}
</a>
</div>

<div *ngIf="statuses.length > 0" class="search-results">
<h3 class="search-results__title">Statuses</h3>
<div *ngIf="statuses.length > 0" class="search-results">
<h3 class="search-results__title">Statuses</h3>

<div class="search-results__status" *ngFor="let statusWrapper of statuses">
<app-status [statusWrapper]="statusWrapper"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-status>
<div class="search-results__status" *ngFor="let statusWrapper of statuses">
<app-status [statusWrapper]="statusWrapper" (browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)">
</app-status>
</div>
</div>
</div>
</div>
41 changes: 24 additions & 17 deletions src/app/components/floating-column/search/search.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
@import "mixins";
@import "panel";
@import "commons";

.panel {
padding-left: 0px;
padding-right: 0px;
}

.form-section {
overflow: auto;
Expand All @@ -29,10 +32,24 @@
}
}

$search-form-height: 70px;
.search-result-form {
height: $search-form-height;
padding-left: 10px;
padding-right: 10px;
border-bottom: 1px solid #222736;
}

.search-result-display {
overflow: auto;
height: calc(100% - #{$search-form-height});
}

.search-results {
// outline: 1px solid greenyellow;
margin-top: 10px; // &:first-of-type{
// margin-top: 10px;
padding-left: 10px; // margin-top: 10px;
padding-right: 10px; // margin-top: 10px;
// }
&__title {
text-transform: uppercase;
Expand All @@ -44,19 +61,16 @@
padding: 5px;
color: white;
text-decoration: none;

transition: all .3s;
transition: all .3s;
&:hover {
background-color: $button-background-color-hover;
}

border-top: 1px solid $separator-color;
&:last-of-type {
border-bottom: 1px solid $separator-color;
}
}

&__status {
&__status {
font-size: 15px;
border-top: 1px solid $separator-color;
&:last-of-type {
Expand All @@ -68,12 +82,8 @@
.account {
display: block;
color: white;

border-radius: 2px;
transition: all .3s;


// &:hover &__name {
transition: all .3s; // &:hover &__name {
// text-decoration: underline;
// }
border-top: 1px solid $separator-color;
Expand All @@ -92,18 +102,15 @@
&__fullhandle {
margin: 0 0 5px 0;
color: $status-secondary-color;
transition: all .3s;
// &:hover {
transition: all .3s; // &:hover {
// color: white;
// }
}

&:hover,
&:hover,
&:hover &__fullhandle {
color: white;
text-decoration: none;
background-color: $button-background-color-hover;
}

@include clearfix;
}
2 changes: 1 addition & 1 deletion src/app/components/stream/hashtag/hashtag.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $inner-column-size: 320px;

.hashtag-stream {
display: block;
height: calc(100% - #{$hashtag-header-height} - 30px);
height: calc(100% - #{$hashtag-header-height});
width: $inner-column-size;
// outline: 1px greenyellow solid;
}
2 changes: 1 addition & 1 deletion src/app/components/stream/hashtag/hashtag.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class HashtagComponent implements OnInit {
event.stopPropagation();

const hashtag = this.hashtagElement.tag;
const newStream = new StreamElement(StreamTypeEnum.tag, `${hashtag}`, this.lastUsedAccount.id, hashtag, null, this.hashtagElement.displayableFullName);
const newStream = new StreamElement(StreamTypeEnum.tag, `${hashtag}`, this.lastUsedAccount.id, hashtag, null, this.lastUsedAccount.instance);
this.store.dispatch([new AddStream(newStream)]);

return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
<div class="stream-overlay">
<div class="stream-overlay__header">
<a href class="overlay-close" (click)="close()">CLOSE</a>
<button class="overlay__button overlay-close" title="close" (click)="close()">
<fa-icon [icon]="faTimes"></fa-icon>
</button>

<button class="overlay__button overlay-previous" [ngClass]="{'overlay__button--focus': previousElements.length > 0 }" title="previous" (click)="previous()">
<fa-icon [icon]="faAngleLeft"></fa-icon>
</button>
<button class="overlay__button overlay-refresh" [ngClass]="{'overlay__button--focus': refreshFocused }" title="refresh" (click)="refresh()">
<fa-icon [icon]="faRedoAlt"></fa-icon>
</button>
<button class="overlay__button overlay-next" [ngClass]="{'overlay__button--focus': nextElements.length > 0 }" title="next" (click)="next()">
<fa-icon [icon]="faAngleRight"></fa-icon>
</button>

<!-- <a href class="overlay-close" (click)="close()">CLOSE</a>
<a href class="overlay-previous" (click)="previous()">PREV</a>
<a href class="overlay-refresh" *ngIf="canRefresh" (click)="refresh()">REFRESH</a>
<a href class="overlay-next" *ngIf="canGoForward" (click)="next()">NEXT</a>
<a href class="overlay-refresh" *ngIf="canRefresh" (click)="refresh()">REFRESH</a>
<a href class="overlay-next" *ngIf="canGoForward" (click)="next()">NEXT</a> -->
</div>

<app-user-profile #appUserProfile *ngIf="accountName" [currentAccount]="accountName"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"

<app-user-profile #appUserProfile *ngIf="accountName" [currentAccount]="accountName" class="stream-overlay__content"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-user-profile>
<app-hashtag #appHashtag *ngIf="hashtagElement" [hashtagElement]="hashtagElement"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
<app-hashtag #appHashtag *ngIf="hashtagElement" [hashtagElement]="hashtagElement" class="stream-overlay__content"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-hashtag>
<app-thread #appThread *ngIf="browseThread" [currentThread]="thread"
(browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)"
<app-thread #appThread *ngIf="browseThread" [currentThread]="thread" class="stream-overlay__content"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-thread>
</div>
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
@import "variables";
@import "mixins";
@import "commons";
$header-content: 40px;
.stream-overlay {
// width: $stream-column-width;
height: calc(100%);
background-color: $column-color;
background-color: $column-color;
&__header {
width: calc(100%);
height: 30px;
background-color: $column-header-background-color;
padding: 6px 10px 0 10px;
height: $header-content;
background-color: $column-header-background-color; // padding: 6px 10px 0 10px;
border-bottom: 1px solid #222736;
& a {
color: whitesmoke;
font-size: 0.8em;
font-weight: normal;
font-weight: normal;
}
}
&__content {
display: block;
width: calc(100%);
height: calc(100% - #{$header-content});
}
&__title {
width: calc(100%);
height: 30px;
Expand All @@ -27,23 +34,45 @@

.overlay {
margin: 0;
&__button {
@include clearButton;
width: 25px;
height: 25px;
color: #354060;
transition: all .2s;
margin: 8px 0 0 8px;
&:hover {
color: whitesmoke;
}
&--focus {
color: whitesmoke;
}
}
&-previous {
display: block;
float: left;
font-size: 18px;
& fa-icon {
position: relative;
left: -1px;
}
}
&-refresh {
display: block;
float: left;
margin-left: 65px;
font-size: 14px;
}
&-next {
display: block;
float: right;
padding-right: 20px;
float: left;
font-size: 18px;
}
&-close {
display: block;
float: right;
font-size: 14px;
color: white;
margin-right: 8px;
}
}

Expand Down
Loading

0 comments on commit c674d8f

Please sign in to comment.