Skip to content

Commit

Permalink
Stub out individual scheme rendering #16
Browse files Browse the repository at this point in the history
  • Loading branch information
johnatawnclementawn committed Nov 20, 2024
1 parent c47457a commit 94ee958
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 22 deletions.
20 changes: 20 additions & 0 deletions arches_lingo/src/arches_lingo/components/schemes/SchemeBox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
interface Scheme {
resourceinstanceid: string;
descriptors: {
[key: string]: {
name: string;
description: string;
};
};
}
const { scheme } = defineProps<{ scheme: Scheme }>();
</script>

<template>
<div>
<p>{{ scheme.descriptors.en.name }}</p>
<p>{{ scheme.descriptors.en.description }}</p>
</div>
</template>
55 changes: 33 additions & 22 deletions arches_lingo/src/arches_lingo/components/schemes/SchemeBoxes.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
<script setup lang="ts">
import SchemeBox from "@/arches_lingo/components/schemes/SchemeBox.vue";
import { fetchSchemes } from "@/arches_lingo/api.ts";
const schemes = await fetchSchemes();
</script>

<template>
<div style="display: block">
<!-- Creating New Scheme -->
<div>
<input
type="text"
placeholder="Enter Scheme Name"
/>
<button>Create Scheme</button>
</div>

<!-- Existing Schemes -->
<div>
<ul>
<li
v-for="scheme in schemes"
:key="scheme.id"
>
{{ scheme.name }}
</li>
</ul>
</div>
<div>
<ul
style="
display: flex;
flex-wrap: wrap;
list-style-type: none;
padding: 0;
"
>
<!-- Create New Scheme -->
<li class="scheme-card">Placeholder for creating new scheme</li>
<!-- Existing Schemes -->
<li
v-for="scheme in schemes"
:key="scheme.resourceinstanceid"
class="scheme-card"
>
<SchemeBox :scheme="scheme" />
</li>
</ul>
</div>
</template>

<style scoped></style>
<style scoped>
.scheme-card {
margin: 1rem;
padding: 1rem;
border: 1px solid var(--p-menubar-border-color);
min-width: 300px;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: var(--p-primary-400);
}
</style>

0 comments on commit 94ee958

Please sign in to comment.