-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stub out individual scheme rendering #16
- Loading branch information
1 parent
c47457a
commit 94ee958
Showing
2 changed files
with
53 additions
and
22 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
arches_lingo/src/arches_lingo/components/schemes/SchemeBox.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
55
arches_lingo/src/arches_lingo/components/schemes/SchemeBoxes.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |