Fix home padding
Signed-off-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
3eb1f23977
commit
a1ad7035db
|
@ -1,10 +1,2 @@
|
||||||
@use '_variables' as *;
|
@use '_variables' as *;
|
||||||
@use '_mixins' as *;
|
@use '_mixins' as *;
|
||||||
|
|
||||||
.margin-content {
|
|
||||||
padding-top: 2rem;
|
|
||||||
|
|
||||||
::ng-deep .revert-home-padding-top {
|
|
||||||
margin-top: -2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
import { ComponentRef, Injectable } from '@angular/core'
|
import { ComponentRef, Injectable } from '@angular/core'
|
||||||
import { MarkdownService } from '@app/core'
|
import { MarkdownService } from '@app/core'
|
||||||
import { logger } from '@root-helpers/logger'
|
|
||||||
import {
|
import {
|
||||||
ButtonMarkupData,
|
ButtonMarkupData,
|
||||||
ChannelMiniatureMarkupData,
|
ChannelMiniatureMarkupData,
|
||||||
ContainerMarkupData,
|
ContainerMarkupData,
|
||||||
EmbedMarkupData,
|
EmbedMarkupData,
|
||||||
InstanceAvatarMarkupData,
|
InstanceAvatarMarkupData,
|
||||||
InstanceBannerMarkupData,
|
|
||||||
PlaylistMiniatureMarkupData,
|
PlaylistMiniatureMarkupData,
|
||||||
VideoMiniatureMarkupData,
|
VideoMiniatureMarkupData,
|
||||||
VideosListMarkupData
|
VideosListMarkupData
|
||||||
} from '@peertube/peertube-models'
|
} from '@peertube/peertube-models'
|
||||||
|
import { logger } from '@root-helpers/logger'
|
||||||
import { DynamicElementService } from './dynamic-element.service'
|
import { DynamicElementService } from './dynamic-element.service'
|
||||||
import {
|
import {
|
||||||
ButtonMarkupComponent,
|
ButtonMarkupComponent,
|
||||||
|
@ -162,15 +161,8 @@ export class CustomMarkupService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private instanceBannerBuilder (el: HTMLElement) {
|
private instanceBannerBuilder (el: HTMLElement) {
|
||||||
const data = el.dataset as InstanceBannerMarkupData
|
|
||||||
const { component, loadedPromise } = this.dynamicElementService.createElement(InstanceBannerMarkupComponent)
|
const { component, loadedPromise } = this.dynamicElementService.createElement(InstanceBannerMarkupComponent)
|
||||||
|
|
||||||
const model = {
|
|
||||||
revertHomePaddingTop: this.buildBoolean(data.revertHomePaddingTop) ?? true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dynamicElementService.setModel(component, model)
|
|
||||||
|
|
||||||
return { component, loadedPromise }
|
return { component, loadedPromise }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<div class="banner revert-margin-content" [ngClass]="{ 'revert-home-padding-top': revertHomePaddingTop }" *ngIf="instanceBannerUrl">
|
<div class="banner" *ngIf="instanceBannerUrl">
|
||||||
<img [src]="instanceBannerUrl" alt="Instance banner">
|
<img [src]="instanceBannerUrl" alt="Instance banner">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { NgClass, NgIf } from '@angular/common'
|
import { NgIf } from '@angular/common'
|
||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'
|
||||||
import { ServerService } from '@app/core'
|
import { ServerService } from '@app/core'
|
||||||
import { maxBy } from '@peertube/peertube-core-utils'
|
import { maxBy } from '@peertube/peertube-core-utils'
|
||||||
|
@ -13,11 +13,9 @@ import { CustomMarkupComponent } from './shared'
|
||||||
templateUrl: 'instance-banner-markup.component.html',
|
templateUrl: 'instance-banner-markup.component.html',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ NgIf, NgClass ]
|
imports: [ NgIf ]
|
||||||
})
|
})
|
||||||
export class InstanceBannerMarkupComponent implements OnInit, CustomMarkupComponent {
|
export class InstanceBannerMarkupComponent implements OnInit, CustomMarkupComponent {
|
||||||
@Input() revertHomePaddingTop: boolean
|
|
||||||
|
|
||||||
instanceBannerUrl: string
|
instanceBannerUrl: string
|
||||||
loaded: undefined
|
loaded: undefined
|
||||||
|
|
||||||
|
|
|
@ -238,10 +238,6 @@ a {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.revert-margin-content {
|
|
||||||
margin: 0 calc(#{pvar(--x-margin-content)} * -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.skip-to-content-sub-menu {
|
.skip-to-content-sub-menu {
|
||||||
display: block;
|
display: block;
|
||||||
z-index: z(modal);
|
z-index: z(modal);
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.revert-margin-content.banner {
|
|
||||||
width: calc(100% + 2 * #{pvar(--x-margin-content)});
|
|
||||||
}
|
|
||||||
|
|
||||||
.pt-icon {
|
.pt-icon {
|
||||||
@include icon(24px);
|
@include icon(24px);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,10 +59,6 @@ export type ContainerMarkupData = {
|
||||||
justifyContent?: 'space-between' | 'normal' // default to 'space-between'
|
justifyContent?: 'space-between' | 'normal' // default to 'space-between'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InstanceBannerMarkupData = {
|
|
||||||
revertHomePaddingTop?: StringBoolean // default to 'true'
|
|
||||||
}
|
|
||||||
|
|
||||||
export type InstanceAvatarMarkupData = {
|
export type InstanceAvatarMarkupData = {
|
||||||
size: string // size in pixels
|
size: string // size in pixels
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue