Skip to content

Commit 7a6456d

Browse files
committed
enhance(namecard): UI implementation for the edit page
1 parent c80fefb commit 7a6456d

File tree

10 files changed

+20
-16
lines changed

10 files changed

+20
-16
lines changed

apps/web/app/components/namecard/ImageUploader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ onMounted(() => {
116116
@change="onFileInputChange"
117117
/>
118118
</button>
119-
<span
119+
<p
120120
class="annotation"
121121
:style="{
122122
fontSize: fontSize('body/300'),
@@ -125,7 +125,7 @@ onMounted(() => {
125125
}"
126126
>
127127
{{ t('namecard.form.annotation_avatar') }}
128-
</span>
128+
</p>
129129
<!-- TODO エラー制御
130130
<Typography v-if="errorMessage" variant="body/200" color="sangosyo/200">{{
131131
errorMessage

apps/web/app/composables/useLocale.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function useLocale(path: Path) {
3535
.with('namecard_process_3', () => `/${locale.value}/namecard_process_3`)
3636
.with('namecard_process_4', () => `/${locale.value}/namecard_process_4`)
3737
.with('namecard_process_alert', () => `/${locale.value}/namecard_process_alert`)
38+
.with('namecard_annotation_order_number', () => `/${locale.value}/namecard_annotation_order_number`)
3839
.exhaustive(),
3940
)
4041

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
\* The order number can be found in the [receipt data](https://help-attendee.peatix.com/ja-JP/support/solutions/articles/44001821741) included in the email sent by Peatix when you purchase a ticket.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
※注文番号は、チケット購入時にPeatixから送信されるメール内に含まれる[領収データ](https://help-attendee.peatix.com/ja-JP/support/solutions/articles/44001821741)から確認できます。

apps/web/app/lang/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
"label_order_number": "Order Number",
150150
"annotation_name": "Up to 12 full-width characters (24 half-width characters)",
151151
"annotation_avatar": "* Upload a square image (aspect ratio 1:1) for your avatar.",
152-
"annotation_order_number": "* The order number can be found in the receipt data included in the email sent by Peatix when you purchase a ticket.",
153152
"placeholder_order_number": "Please enter the order number",
154153
"submit": "Submit",
155154
"registrationCompleted": "The name card information has been successfully registered!",

apps/web/app/lang/ja.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
"label_order_number": "注文番号",
168168
"annotation_name": "※全角12文字(半角24文字)まで",
169169
"annotation_avatar": "※アバターは正方形(比率1:1)の画像をアップロードしてください。",
170-
"annotation_order_number": "※注文番号は、チケット購入時にPeatixから送信されるメール内に含まれる領収データから確認できます。",
171170
"placeholder_order_number": "注文番号を入力してください",
172171
"submit": "確定する",
173172
"registrationCompleted": "ネームカードの情報登録が完了しました!",

apps/web/app/pages/namecard/[id]/edit/index.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ function onSubmit(e: Event) {
7979
navigateTo(`/namecard/${authUserId.value}/edit/complete/`)
8080
}
8181
}
82+
83+
// TODO バリデート、エラー制御を追加する
8284
</script>
8385
<template>
8486
<NuxtLayout name="namecard-base">
8587
<div class="namecard-edit-root">
8688
<div class="preview-wrapper">
8789
<VFNamecard23 :user="namecard" class="namecard" />
88-
<CreationStatus :status-key="statusKey" class="creation-status" />
90+
<CreationStatus :status-key="statusKey" size="small" class="creation-status" />
8991
</div>
9092
<div class="form-wrapper">
9193
<form @submit.prevent="onSubmit">
@@ -97,17 +99,16 @@ function onSubmit(e: Event) {
9799
:label="t('namecard.form.label_name')"
98100
:placeholder="`${t('form.form_placeholder_example')}${t('form.form_name_placeholder')}`"
99101
required
100-
:annotation="t('namecard.form.annotation_name')"
101102
:error="nameError"
102103
@input="updateName"
103104
@blur="validateName"
104-
/>
105+
><p class="annotation">{{ t('namecard.form.annotation_name') }}</p></VFInputField
106+
>
105107
<ImageUploader
106108
class="image-uploader"
107109
file-accept="image/*"
108110
@check-files.prevent="checkFiles"
109111
/>
110-
<!-- TODO 領収書データ を外部リンク化する Nuxt Content使う -->
111112
<VFInputField
112113
id="orderNumber"
113114
v-model="receiptId"
@@ -116,13 +117,13 @@ function onSubmit(e: Event) {
116117
:label="t('namecard.form.label_order_number')"
117118
:placeholder="t('namecard.form.placeholder_order_number')"
118119
required
119-
:annotation="t('namecard.form.annotation_order_number')"
120120
:error="orderNumberError"
121121
@input="updateReceiptId"
122122
@blur="validateOrderNumbere"
123-
/>
123+
><div class="annotation"><MarkDownText path="namecard_annotation_order_number" /></div
124+
></VFInputField>
124125
<div class="form-buttons">
125-
<!-- TODO ボタン キャンセルボタン disable の制御 スタイルを追加する disable の制御も -->
126+
<!-- TODO ボタン キャンセルボタン スタイルを追加する -->
126127
<VFSubmitButton id="submit-button" :disabled="!isSubmitting">
127128
{{ $t('namecard.form.submit') }}
128129
</VFSubmitButton>
@@ -142,6 +143,9 @@ function onSubmit(e: Event) {
142143
margin: 0 auto;
143144
gap: 0 calc(var(--unit) * 8);
144145
}
146+
.namecard {
147+
margin-bottom: calc(var(--unit) * 2);
148+
}
145149
.form-wrapper {
146150
text-align: left;
147151
}
@@ -159,7 +163,8 @@ function onSubmit(e: Event) {
159163
font-weight: 700;
160164
color: var(--color-vue-green200);
161165
}
162-
:deep(.annotation) {
166+
.annotation,
167+
.annotation:deep(p) {
163168
font-weight: 500;
164169
color: var(--color-vue-blue);
165170
}

packages/model/lib/path.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ export type Path =
2626
| 'namecard_process_3'
2727
| 'namecard_process_4'
2828
| 'namecard_process_alert'
29+
| 'namecard_annotation_order_number'

packages/ui/components/forms/InputField.stories.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const Error: Story = {
4242
label: 'お名前',
4343
placeholder: '山田太郎',
4444
errorMessage: 'エラーメッセージが表示されます',
45-
annotation:'※全角12文字(半角24文字)まで'
4645
},
4746
}
4847

packages/ui/components/forms/InputField.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ interface Props extends /* @vue-ignore */ _InputFieldProps {
1515
label: string
1616
/* Error Message */
1717
errorMessage?: string
18-
annotation?: string
1918
}
2019
type Emits = {
2120
blur: [value: string]
@@ -30,7 +29,6 @@ withDefaults(defineProps<Props>(), {
3029
disabled: false,
3130
label: '',
3231
errorMessage: '',
33-
annotation: '',
3432
})
3533
3634
const emit = defineEmits<Emits>()
@@ -71,7 +69,7 @@ const { fontWeight, fontSize } = useTypography()
7169
:disabled="disabled"
7270
@blur="handleBlur"
7371
/>
74-
<span v-if="annotation" class="annotation">{{ annotation }}</span>
72+
<slot />
7573
<Typography v-if="errorMessage" variant="body/200" color="sangosyo/200">{{
7674
errorMessage
7775
}}</Typography>

0 commit comments

Comments
 (0)