Last changes

This commit is contained in:
2025-02-25 21:26:13 -06:00
parent e23f204818
commit 3af5fc1c1f
3 changed files with 190 additions and 118 deletions

View File

@ -58,6 +58,40 @@ const RSVPManager = () => {
} }
}; };
const handleExportCSV = () => {
// Create CSV content
const headers = ["Name", "Status", "Dietary Restrictions", "Notes", "Response Date"];
const rows = rsvpList.map(rsvp => [
rsvp.name,
rsvp.attending ? "Attending" : "Not Attending",
rsvp.dietaryRestrictions || "",
rsvp.notes || "",
new Date(rsvp.timestamp).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
})
]);
// Convert to CSV string
const csvContent = [
headers.join(","),
...rows.map(row => row.map(cell => `"${String(cell).replace(/"/g, '""')}"`).join(","))
].join("\n");
// Create and trigger download
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
const link = document.createElement("a");
const url = URL.createObjectURL(blob);
link.setAttribute("href", url);
link.setAttribute("download", `rsvp_list_${new Date().toISOString().split('T')[0]}.csv`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
useEffect(() => { useEffect(() => {
fetchRSVPList(); fetchRSVPList();
@ -147,6 +181,14 @@ const RSVPManager = () => {
</tbody> </tbody>
</table> </table>
</div> </div>
<button
onClick={handleExportCSV}
className="btn btn-secondary mx-auto"
disabled={rsvpList.length === 0}
>
Export to CSV
</button>
</div> </div>
); );
}; };

View File

@ -1,118 +0,0 @@
---
import Layout from "../layouts/Layout.astro";
---
<Layout title="FAQ">
<div class="flex flex-col gap-8 max-w-3xl mx-auto p-6">
<div class="text-center">
<h1 class="text-4xl mb-8">Frequently Asked Questions</h1>
</div>
<div class="space-y-4">
<!-- Dress Code -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Dress Code
</div>
<div class="collapse-content">
<p class="text-lg">
Semi-formal, any colour you want. Want to get dressed up? Go for it! Want to wear a shirt with no stains on it? Go for it!
There will be dancing, so choose your wardrobe accordingly. Maybe don't wear a white dress...
</p>
</div>
</div>
<!-- Dietary Restrictions -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Dietary Restrictions
</div>
<div class="collapse-content">
<p class="text-lg">
We will do our best to accommodate any dietary restrictions you have! Our caterer can cook gluten/dairy/peanut free etc.
but may not be able to guarantee that there are no traces of allergens in the food. Please contact us if you have any concerns.
</p>
</div>
</div>
<!-- Alcohol -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Alcohol
</div>
<div class="collapse-content">
<p class="text-lg">
We will not be serving alcohol.
</p>
</div>
</div>
<!-- Childcare -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Childcare
</div>
<div class="collapse-content">
<p class="text-lg">
Your young children are adorable and welcome, but we don't have childcare or designated areas for naps etc.
If you have any concerns, please contact us.
</p>
</div>
</div>
<!-- Gifts -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Gifts
</div>
<div class="collapse-content">
<p class="text-lg">
The best gift is you sharing in our joy! Don't feel obligated. If you would like to give a physical gift,
cash is preferred, but we do have a registry available on this website as well.
Ix would be over the moon if someone found him a
<a href="https://www.youtube.com/watch?v=jeT7X3HfXP8" target="_blank" class="link link-primary">hurdy-gurdy</a>.
</p>
</div>
</div>
<!-- Help -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Can I Help With Anything?
</div>
<div class="collapse-content">
<p class="text-lg">
If you're up for staying a bit later, we could definitely use your help cleaning up the venues when the wedding is done!
Tony and Gladys will be coordinating that the day-of, please speak with them. If you want to help with wedding preparations,
please contact Ix or Natasha. Thank you!
</p>
</div>
</div>
<!-- Contact -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
I have all these concerns, what do I do?
</div>
<div class="collapse-content">
<div class="text-lg space-y-2">
<p>Email us at: <a href="mailto:ixabatasha25@proton.me" class="link link-primary">ixabatasha25@proton.me</a></p>
<p>Call/text Natasha: <a href="tel:13062929000" class="link link-primary">1 (306) 292-9000</a></p>
<p>Call/text Ix: <a href="tel:13067179403" class="link link-primary">1 (306) 717-9403</a></p>
</div>
</div>
</div>
</div>
<div class="text-center mt-8">
<a href="/" class="btn btn-primary">Back to Home</a>
</div>
</div>
</Layout>

148
src/pages/faq/index.astro Normal file
View File

@ -0,0 +1,148 @@
---
import Layout from "../../layouts/Layout.astro";
import SignIn from "../../components/SignIn.tsx";
---
<Layout title="FAQ">
<div class="flex flex-col gap-4">
<div class="text-center text-4xl">
Frequently Asked Questions
</div>
<div id="auth-container">
<SignIn client:load onSuccess={() => {}} requiredRole="guest" />
</div>
<div id="content-container" class="hidden max-w-4xl mx-auto p-6">
<div class="space-y-4">
<!-- Dress Code -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Dress Code
</div>
<div class="collapse-content">
<p class="text-lg">
Semi-formal, any colour you want. Want to get dressed up? Go for it! Want to wear a shirt with no stains on it? Go for it!
There will be dancing, so choose your wardrobe accordingly. Maybe don't wear a white dress...
</p>
</div>
</div>
<!-- Dietary Restrictions -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Dietary Restrictions
</div>
<div class="collapse-content">
<p class="text-lg">
We will do our best to accommodate any dietary restrictions you have! Our caterer can cook gluten/dairy/peanut free etc.
but may not be able to guarantee that there are no traces of allergens in the food. Please contact us if you have any concerns.
</p>
</div>
</div>
<!-- Alcohol -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Alcohol
</div>
<div class="collapse-content">
<p class="text-lg">
We will not be serving alcohol.
</p>
</div>
</div>
<!-- Childcare -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Childcare
</div>
<div class="collapse-content">
<p class="text-lg">
Your young children are adorable and welcome, but we don't have childcare or designated areas for naps etc.
If you have any concerns, please contact us.
</p>
</div>
</div>
<!-- Gifts -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Gifts
</div>
<div class="collapse-content">
<p class="text-lg">
The best gift is you sharing in our joy! Don't feel obligated. If you would like to give a physical gift,
cash is preferred, but we do have a registry available on this website as well.
Ix would be over the moon if someone found him a
<a href="https://www.youtube.com/watch?v=jeT7X3HfXP8" target="_blank" class="link link-primary">hurdy-gurdy</a>.
</p>
</div>
</div>
<!-- Help -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
Can I Help With Anything?
</div>
<div class="collapse-content">
<p class="text-lg">
If you're up for staying a bit later, we could definitely use your help cleaning up the venues when the wedding is done!
Tony and Gladys will be coordinating that the day-of, please speak with them. If you want to help with wedding preparations,
please contact Ix or Natasha. Thank you!
</p>
</div>
</div>
<!-- Contact -->
<div class="collapse collapse-plus bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">
I have all these concerns, what do I do?
</div>
<div class="collapse-content">
<div class="text-lg space-y-2">
<p>Email us at: <a href="mailto:ixabatasha25@proton.me" class="link link-primary">ixabatasha25@proton.me</a></p>
<p>Call/text Natasha: <a href="tel:13062929000" class="link link-primary">1 (306) 292-9000</a></p>
<p>Call/text Ix: <a href="tel:13067179403" class="link link-primary">1 (306) 717-9403</a></p>
</div>
</div>
</div>
</div>
<div class="text-center mt-8">
<a href="/" class="btn btn-primary">Back to Home</a>
</div>
</div>
</div>
</Layout>
<script>
import { hasRole } from "../../utils/auth-client";
function updateVisibility() {
const authContainer = document.getElementById("auth-container");
const contentContainer = document.getElementById("content-container");
if (hasRole("guest")) {
authContainer?.classList.add("hidden");
contentContainer?.classList.remove("hidden");
} else {
authContainer?.classList.remove("hidden");
contentContainer?.classList.add("hidden");
}
}
// Check auth state on page load
updateVisibility();
// Add event listener for custom event from SignIn component
document.addEventListener("auth-success", updateVisibility);
</script>