aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+signup/shared/signup-mascot.component.ts
blob: a96ccffeef8c761246a145c7c27edfddfbd93a80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Component, Input } from '@angular/core'
import { DomSanitizer } from '@angular/platform-browser'

const images = {
  about: require('!!raw-loader?!../../../assets/images/mascot/register/about.svg').default,
  terms: require('!!raw-loader?!../../../assets/images/mascot/register/terms.svg').default,
  success: require('!!raw-loader?!../../../assets/images/mascot/register/success.svg').default,
  channel: require('!!raw-loader?!../../../assets/images/mascot/register/channel.svg').default,
  account: require('!!raw-loader?!../../../assets/images/mascot/register/account.svg').default
}

export type MascotImageName = keyof typeof images

@Component({
  selector: 'my-signup-mascot',
  styleUrls: [ './signup-mascot.component.scss' ],
  template: `<div class="root" [innerHTML]="html"></div>`
})
export class SignupMascotComponent {
  @Input() imageName: MascotImageName

  constructor (private sanitize: DomSanitizer) {

  }

  get html () {
    return this.sanitize.bypassSecurityTrustHtml(images[this.imageName])
  }
}