feat: ♻️ use slots in NSFW warning

This commit is contained in:
Sebin Nyshkim 2020-12-21 18:33:17 +01:00
parent e0f87d054c
commit f1cb1bbfbd
2 changed files with 18 additions and 8 deletions

View file

@ -1,6 +1,19 @@
<template> <template>
<div id="app"> <div id="app">
<nsfw-warning v-show="isWarn"></nsfw-warning> <nsfw-warning v-show="isWarn">
<template v-slot:heading>
<br />
Whoa, Nelly!
</template>
<template v-slot:message>
By enabling NSFW mode you confirm that you are of legal age to view
adult content.
</template>
<template v-slot:yes>Yes, show me the goods 👀</template>
<template v-slot:no>NO, STAHP 😱</template>
</nsfw-warning>
<ref-header <ref-header
mainHeading="Sebin Nyshkim" mainHeading="Sebin Nyshkim"

View file

@ -3,18 +3,15 @@
<div class="nsfw-warning__background"></div> <div class="nsfw-warning__background"></div>
<div class="nsfw-warning__message"> <div class="nsfw-warning__message">
<div> <div>
<h2> Whoa, Nelly! </h2> <h2><slot name="heading"></slot></h2>
<p> <p><slot name="message"></slot></p>
By enabling NSFW mode you confirm that you are of legal age to view
adult content.
</p>
<div class="btn-container"> <div class="btn-container">
<a href="#" class="btn positive" @click.prevent="confirmNsfw(true)"> <a href="#" class="btn positive" @click.prevent="confirmNsfw(true)">
Yes, show me the goods 👀 <slot name="yes"></slot>
</a> </a>
<a href="#" class="btn negative" @click.prevent="confirmNsfw(false)"> <a href="#" class="btn negative" @click.prevent="confirmNsfw(false)">
NO, STAHP 😱 <slot name="no"></slot>
</a> </a>
</div> </div>
</div> </div>