first commit
This commit is contained in:
36
src/lib/components/AdventureCard.svelte
Normal file
36
src/lib/components/AdventureCard.svelte
Normal file
@@ -0,0 +1,36 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let name:String;
|
||||
export let location:String;
|
||||
export let created:string;
|
||||
export let id:Number;
|
||||
|
||||
function remove() {
|
||||
dispatch('remove', name);
|
||||
}
|
||||
function edit() {
|
||||
dispatch('edit', id)
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<!-- <p>ID: {id}</p> -->
|
||||
<p>Name: {name}</p>
|
||||
<p>Location: {location}</p>
|
||||
<p>Created: {created}</p>
|
||||
<button on:click={remove}>Remove</button>
|
||||
<button on:click={edit}>Edit</button>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
div {
|
||||
margin: 2rem;
|
||||
padding: .5rem;
|
||||
background-color: rgb(235, 230, 223);
|
||||
border: 1px solid grey;
|
||||
border-radius: .5rem;
|
||||
box-shadow: 10px 5px 5px rgba(0, 0, 0, 0.182);
|
||||
}
|
||||
</style>
|
||||
1
src/lib/index.ts
Normal file
1
src/lib/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
// place files you want to import through the `$lib` alias in this folder.
|
||||
6
src/lib/utils/types.ts
Normal file
6
src/lib/utils/types.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface Adventure {
|
||||
id: number
|
||||
name: string;
|
||||
location: string;
|
||||
created:string
|
||||
}
|
||||
Reference in New Issue
Block a user