Skip to content

Commit

Permalink
bmm form
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikvedvik committed Feb 23, 2024
1 parent 2644367 commit 5ee3c07
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions components/BmmSingleMetadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ import { BccButton, BccInput } from "@bcc-code/design-library-vue";
const form = defineModel<BMMSingleForm>({ required: true });
const albumId = computedProperty(form, "albumId");
const trackId = computedProperty(form, "trackId");
const language = computedProperty(form, "language");
const originalTitle = computedProperty(form, "originalTitle");
defineEmits<{
submit: [];
set: [];
}>();
</script>
<template>
<form class="flex flex-col gap-4 p-4" @submit.prevent="$emit('submit')">
<form class="flex flex-col gap-4 p-4" @submit.prevent="$emit('set')">
<h3 class="text-lg font-bold">BMM Upload</h3>
<BccInput v-model="albumId" :label="$t('album')" />
<BccInput v-model="trackId" :label="$t('track')" />
<BccInput
v-model="originalTitle"
:label="$t('originalTitle')"
Expand Down
4 changes: 3 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"dragAndDropFileHere": "Drag and drop file here or click to browse",
"originalTitle": "Original title",
"language": "Language",
"selectAnOption": "Select an option..."
"selectAnOption": "Select an option...",
"album": "Album",
"track": "Track"
}
2 changes: 1 addition & 1 deletion pages/upload/bmm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div
class="mx-auto flex h-screen max-w-screen-md flex-col gap-4 rounded-lg bg-stone-300 p-4 text-black"
>
<BmmSingleMetadata v-model="form" @submit="metadataIsSet = true" />
<BmmSingleMetadata v-model="form" @set="metadataIsSet = true" />
<div
class="flex flex-col gap-4 p-4 transition"
:class="[
Expand Down
2 changes: 2 additions & 0 deletions utils/bmm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export type BMMSingleForm = {
originalTitle: string;
albumId?: string;
trackId?: string;
language?: (typeof bmmLanguages)[number];
};

0 comments on commit 5ee3c07

Please sign in to comment.