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);
}
/** @type {string} */ const res = `${day} ${month}`;
/** @type {string} */ const res = `${day} de ${month}`;
return res;
};

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

@ -1,5 +1,4 @@
<script>
import { templates } from '$lib/templates/templates';
import {
heading,
title,
@ -13,25 +12,34 @@
import { convertDate } from '$lib/convertDate';
/** @type number */ export let templateIndex;
const template = templates[templateIndex];
/** @type {string} */ let textDate;
/** @type {string} */ let textHeading;
/** @type {string} */ let textWeekday;
/** @type {string} */ let textDate = '';
/** @type {boolean} */ let checked = true;
$: if ($date !== '') {
textDate = convertDate($date);
}
$: if ($heading !== '') {
textHeading = $heading;
}
$: if ($weekday !== '') {
textWeekday = $weekday;
}
</script>
<div class="text-container">
<input type="checkbox" bind:checked />
{#if checked}
<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>
{/if}
</div>
<style>
.text-container {
margin: 1rem auto;
}
.text {
margin: 1rem auto;
}
p {
margin-bottom: 1rem;
}
</style>

Loading…
Cancel
Save