Better display of accounts and channel pages on small screens
This commit is contained in:
parent
61b20252a0
commit
937b7a6af8
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="right-buttons">
|
<div class="right-buttons">
|
||||||
<a *ngIf="isAccountManageable" routerLink="/my-account" class="btn btn-outline-tertiary mr-2" i18n>Manage</a>
|
<a *ngIf="isAccountManageable && !isInSmallView" routerLink="/my-account" class="btn btn-outline-tertiary mr-2" i18n>Manage</a>
|
||||||
<my-subscribe-button *ngIf="videoChannels" [account]="account" [videoChannels]="videoChannels"></my-subscribe-button>
|
<my-subscribe-button *ngIf="videoChannels" [account]="account" [videoChannels]="videoChannels"></my-subscribe-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
|
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
|
||||||
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
|
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
|
||||||
import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
|
import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
|
||||||
|
import { ScreenService } from '@app/shared/misc/screen.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './accounts.component.html',
|
templateUrl: './accounts.component.html',
|
||||||
|
@ -36,6 +37,7 @@ export class AccountsComponent implements OnInit, OnDestroy {
|
||||||
private restExtractor: RestExtractor,
|
private restExtractor: RestExtractor,
|
||||||
private redirectService: RedirectService,
|
private redirectService: RedirectService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
|
private screenService: ScreenService,
|
||||||
private i18n: I18n
|
private i18n: I18n
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
@ -91,6 +93,10 @@ export class AccountsComponent implements OnInit, OnDestroy {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isInSmallView () {
|
||||||
|
return this.screenService.isInSmallView()
|
||||||
|
}
|
||||||
|
|
||||||
onUserChanged () {
|
onUserChanged () {
|
||||||
this.getUserIfNeeded(this.account)
|
this.getUserIfNeeded(this.account)
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="right-buttons">
|
<div class="right-buttons">
|
||||||
<a *ngIf="isChannelManageable" [routerLink]="[ '/my-account/video-channels/update', videoChannel.nameWithHost ]" class="btn btn-outline-tertiary mr-2" i18n>Manage</a>
|
<a *ngIf="isChannelManageable && !isInSmallView" [routerLink]="[ '/my-account/video-channels/update', videoChannel.nameWithHost ]" class="btn btn-outline-tertiary mr-2" i18n>Manage</a>
|
||||||
<my-subscribe-button #subscribeButton [videoChannels]="[videoChannel]"></my-subscribe-button>
|
<my-subscribe-button #subscribeButton [videoChannels]="[videoChannel]"></my-subscribe-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
<div class="actor-followers" i18n>{videoChannel.followersCount, plural, =1 {1 subscriber} other {{{ videoChannel.followersCount }} subscribers}}</div>
|
<div class="actor-followers" i18n>{videoChannel.followersCount, plural, =1 {1 subscriber} other {{{ videoChannel.followersCount }} subscribers}}</div>
|
||||||
|
|
||||||
<a [routerLink]="[ '/accounts', videoChannel.ownerBy ]" i18n-title title="Go the owner account page" class="actor-owner">
|
<a [routerLink]="[ '/accounts', videoChannel.ownerBy ]" i18n-title title="Go the owner account page" class="actor-owner">
|
||||||
<span i18n>Created by {{ videoChannel.ownerBy }}</span>
|
<span class="d-inline-flex"><span i18n class="d-none d-sm-block mr-1">Created by</span>{{ videoChannel.ownerBy }}</span>
|
||||||
<img [src]="videoChannel.ownerAvatarUrl" alt="Owner account avatar" />
|
<img [src]="videoChannel.ownerAvatarUrl" alt="Owner account avatar" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { Hotkey, HotkeysService } from 'angular2-hotkeys'
|
||||||
import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
|
import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
|
import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
|
||||||
|
import { ScreenService } from '@app/shared/misc/screen.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: './video-channels.component.html',
|
templateUrl: './video-channels.component.html',
|
||||||
|
@ -32,7 +33,8 @@ export class VideoChannelsComponent implements OnInit, OnDestroy {
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private videoChannelService: VideoChannelService,
|
private videoChannelService: VideoChannelService,
|
||||||
private restExtractor: RestExtractor,
|
private restExtractor: RestExtractor,
|
||||||
private hotkeysService: HotkeysService
|
private hotkeysService: HotkeysService,
|
||||||
|
private screenService: ScreenService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
@ -79,6 +81,10 @@ export class VideoChannelsComponent implements OnInit, OnDestroy {
|
||||||
if (this.isUserLoggedIn()) this.hotkeysService.remove(this.hotkeys)
|
if (this.isUserLoggedIn()) this.hotkeysService.remove(this.hotkeys)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isInSmallView () {
|
||||||
|
return this.screenService.isInSmallView()
|
||||||
|
}
|
||||||
|
|
||||||
isUserLoggedIn () {
|
isUserLoggedIn () {
|
||||||
return this.authService.isLoggedIn()
|
return this.authService.isLoggedIn()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue