Skip to content

Commit

Permalink
[WIP] VerifyForm
Browse files Browse the repository at this point in the history
  • Loading branch information
Proladon committed Oct 30, 2023
1 parent 2e1798a commit 0d61c9e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
17 changes: 16 additions & 1 deletion src/components/AreaBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,23 @@
</div>
</template>

<script setup lang="ts">
export interface AreaBlockProps {
bg?: string
border?: string
}
const props = withDefaults(defineProps<AreaBlockProps>(), {
bg: 'transparent',
border: 'var(--primary-bg)',
})
</script>

<style scoped lang="postcss">
.area-block {
@apply border-2 border-primary-bg p-[10px] rounded-sub;
@apply border-[1.5px] p-[20px] rounded-md;
background-color: v-bind(props.bg);
border-color: v-bind(props.border);
}
</style>
3 changes: 3 additions & 0 deletions src/styles/naive-ui-theme-overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"Button": {},
"Input": {
"border": "1px solid #6B7280"
},
"Form": {
"labelFontWeight": "600"
}
}
6 changes: 5 additions & 1 deletion src/views/RegisterProfile/RegisterProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<n-icon size="50"><AirlineRapidBoard /></n-icon>
<p class="topic-title">Shelter Verify</p>
</div>
<n-divider />
</SZBlockContainer>
<n-divider />

<SZBlockContainer class="w-fit m-auto">
<VerifyForm />
</SZBlockContainer>
</main>
Expand All @@ -18,6 +21,7 @@ import { SZBlockContainer } from '@shelter-zone/shelter-ui'
import { AirlineRapidBoard } from '@vicons/carbon'
import { NIcon, NDivider } from 'naive-ui'
import VerifyForm from './components/VerifyForm.vue'
import AreaBlock from '@/components/AreaBlock.vue'
</script>

<style scoped lang="postcss">
Expand Down
21 changes: 13 additions & 8 deletions src/views/RegisterProfile/components/VerifyForm.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
<template>
<n-form ref="formRef" class="verify-form">
<n-form-item label="避難者 ID" path="name">
<n-input placeholder="避難者 ID" />
</n-form-item>
<n-form-item label="來源" path="name">
<n-select :options="values(fromSourcesConfig)" placeholder="避難者 ID" />
</n-form-item>
<div class="grid grid-cols-2 gap-30px">
<n-form-item label="避難者 ID" path="name">
<n-input />
</n-form-item>
<n-form-item label="來源" path="name">
<n-select :options="values(fromSourcesConfig)" />
</n-form-item>
</div>

<n-button secondary block type="primary">進行驗證</n-button>
</n-form>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue'
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
import { NForm, NFormItem, NInput, NSelect, NButton } from 'naive-ui'
import { useOauthStore } from '@/stores/oauth'
import { fromSourcesConfig } from '@/configs/verifyForm'
import { Tag } from '@vicons/carbon'
import { values } from 'lodash-es'
const formRef = ref<null>()
Expand All @@ -27,6 +32,6 @@ const formData = reactive({

<style scoped lang="postcss">
.verify-form {
@apply max-w-[500px] m-auto;
@apply max-w-[800px] w-full m-auto;
}
</style>

0 comments on commit 0d61c9e

Please sign in to comment.