cosillas y text ya funciona

pull/11/head
Borja Robert 2 years ago
parent 362c697f79
commit 0669775cef

@ -17,7 +17,7 @@ export const convertDate = (date) => {
day = day.charAt(1); day = day.charAt(1);
} }
/** @type {string} */ const res = `${day} ${month}`; /** @type {string} */ const res = `${day} de ${month}`;
return res; return res;
}; };

@ -76,7 +76,7 @@
{/if} {/if}
</div> </div>
<div class="text"> <div class="text">
<Text {templateIndex} /> <Text />
</div> </div>
</div> </div>

@ -1,5 +1,4 @@
<script> <script>
import { templates } from '$lib/templates/templates';
import { import {
heading, heading,
title, title,
@ -13,25 +12,34 @@
import { convertDate } from '$lib/convertDate'; import { convertDate } from '$lib/convertDate';
/** @type number */ export let templateIndex; /** @type {string} */ let textDate = '';
/** @type {boolean} */ let checked = true;
const template = templates[templateIndex];
/** @type {string} */ let textDate;
/** @type {string} */ let textHeading;
/** @type {string} */ let textWeekday;
$: if ($date !== '') { $: if ($date !== '') {
textDate = convertDate($date); textDate = convertDate($date);
} }
$: if ($heading !== '') {
textHeading = $heading;
}
$: if ($weekday !== '') {
textWeekday = $weekday;
}
</script> </script>
<div class="text-container">
<input type="checkbox" bind:checked />
{#if checked}
<div class="text" contenteditable="true"> <div class="text" contenteditable="true">
<p>El {textWeekday}, {textDate}, te invitamos a participar en el {textHeading}</p> <p>Estimada/o amiga/o:</p>
<p>El {$weekday.toLowerCase()}, {textDate}, celebramos el acto '{$title}'.</p>
<p>Lo haremos en {$address.split('\n')[-1]}</p>
</div> </div>
{/if}
</div>
<style>
.text-container {
margin: 1rem auto;
}
.text {
margin: 1rem auto;
}
p {
margin-bottom: 1rem;
}
</style>

Loading…
Cancel
Save