deletepopup darkMode

This commit is contained in:
Chaebean Yang 2025-06-10 04:54:42 +09:00
parent aa7c66ea70
commit 200bc6e267
2 changed files with 2 additions and 57 deletions

View File

@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
export let destination = ''; export let destination = '';
export let startDate = ''; export let startDate = '';
export let endDate = ''; export let endDate = '';
@ -34,7 +35,7 @@
<style> <style>
.memory-card { .memory-card {
background: var(--gray-900); background: var(--black);
border-radius: 12px; border-radius: 12px;
overflow: hidden; overflow: hidden;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

View File

@ -1,55 +1,4 @@
<script lang="ts"> <script lang="ts">
<<<<<<< HEAD
import '../../app.css';
import MemoryCard from '$lib/components/MemoryCard.svelte';
import Button from '$lib/components/Button.svelte';
import NewMemoryPopup from '$lib/components/NewMemoryPopup.svelte';
import Nav from '$lib/components/Nav.svelte';
import { onMount } from 'svelte';
import { ref, get } from 'firebase/database';
import { db } from '../../firebase';
interface Memory {
tripId: string;
memoryId: string;
destination: string;
startDate: string;
endDate: string;
image: string;
}
let showNewMemoryPopup = false;
let contentContainer: HTMLElement;
let pastMemories: Memory[] = [];
onMount(async () => {
const snapshot = await get(ref(db, 'trips'));
const data = snapshot.val();
pastMemories = Object.entries(data).flatMap(([tripId, trip]: any) => {
const memories = Object.entries(trip.memories ?? {});
if (memories.length === 0) return [];
//latest memoryID
const sorted = memories.sort((a, b) => new Date(b[1].createdAt) - new Date(a[1].createdAt));
const [memoryId, memory] = sorted[0];
return [{
tripId,
memoryId,
destination: trip.destination?.name ?? 'Unknown',
startDate: memory.startDate,
endDate: memory.endDate,
image: memory.images?.[0] ?? ''
}];
});
});
function handleNewMemory() {
showNewMemoryPopup = true;
}
=======
import '../../app.css'; import '../../app.css';
import MemoryCard from '$lib/components/MemoryCard.svelte'; import MemoryCard from '$lib/components/MemoryCard.svelte';
import Button from '$lib/components/Button.svelte'; import Button from '$lib/components/Button.svelte';
@ -109,7 +58,6 @@
function handleNewMemory() { function handleNewMemory() {
showNewMemoryPopup = true; showNewMemoryPopup = true;
} }
>>>>>>> 0570bcffe9996e925158c79503096d59ce341846
</script> </script>
<main> <main>
@ -123,11 +71,7 @@
<div class="memories-container"> <div class="memories-container">
{#if pastMemories.length === 0} {#if pastMemories.length === 0}
<div class="empty-state"> <div class="empty-state">
<<<<<<< HEAD
<p>There is no memory</p>
=======
<p>There is no memory yet</p> <p>There is no memory yet</p>
>>>>>>> 0570bcffe9996e925158c79503096d59ce341846
</div> </div>
{:else} {:else}
<div class="memories-grid"> <div class="memories-grid">