-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat-whitelabel
- Loading branch information
Showing
9 changed files
with
275 additions
and
64 deletions.
There are no files selected for viewing
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,51 @@ | ||
<script setup lang="ts"> | ||
import IHBell from '~icons/heroicons-outline/bell'; | ||
import IHGlobe from '~icons/heroicons-outline/globe-americas'; | ||
import IHHome from '~icons/heroicons-outline/home'; | ||
import IHUser from '~icons/heroicons-outline/user'; | ||
const { web3 } = useWeb3(); | ||
const route = useRoute(); | ||
const menu = [ | ||
{ | ||
label: 'Home', | ||
link: { name: 'my-home' }, | ||
icon: IHHome | ||
}, | ||
{ | ||
label: 'Explore', | ||
link: { name: 'my-explore' }, | ||
icon: IHGlobe | ||
}, | ||
{ | ||
label: 'Notifications', | ||
link: { name: 'my-notifications' }, | ||
icon: IHBell | ||
}, | ||
{ | ||
label: 'Profile', | ||
link: { name: 'user', params: { user: web3.value.account } }, | ||
icon: IHUser | ||
} | ||
]; | ||
</script> | ||
|
||
<template> | ||
<nav class="bg-skin-bg border-t text-xs"> | ||
<div class="flex gap-2 px-3 justify-center"> | ||
<AppLink | ||
v-for="(item, i) in menu" | ||
:key="i" | ||
:to="item.link" | ||
class="inline-flex flex-col text-center gap-1 truncate justify-center w-[25%] max-w-[120px]" | ||
:class=" | ||
route.name === item.link.name ? 'text-skin-link' : 'text-skin-text' | ||
" | ||
> | ||
<component :is="item.icon" class="mx-auto" /> | ||
<span class="truncate" v-text="item.label" /> | ||
</AppLink> | ||
</div> | ||
</nav> | ||
</template> |
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
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,85 @@ | ||
<script setup lang="ts"> | ||
import { getValidator } from '@/helpers/validation'; | ||
const GUIDELINES_DEFINITION = { | ||
type: 'string', | ||
format: 'uri', | ||
title: 'Guidelines', | ||
maxLength: 256, | ||
examples: ['https://example.com/guidelines'], | ||
tooltip: | ||
'Display a link to your guidelines on proposal creation to help users understand what constitutes a good/valid proposal' | ||
}; | ||
const TEMPLATE_DEFINITION = { | ||
type: 'string', | ||
title: 'Template', | ||
maxLength: 1024, | ||
examples: ['## Intro\n## Body\n## Conclusion'], | ||
tooltip: | ||
'Start every proposal with a template to help users understand what information is required' | ||
}; | ||
const onlyMembers = defineModel<boolean>('onlyMembers', { | ||
required: true | ||
}); | ||
const guidelines = defineModel<string>('guidelines', { | ||
required: true | ||
}); | ||
const template = defineModel<string>('template', { | ||
required: true | ||
}); | ||
const emit = defineEmits<{ | ||
(e: 'updateValidity', valid: boolean): void; | ||
}>(); | ||
const errors = computed(() => { | ||
const validator = getValidator({ | ||
type: 'object', | ||
title: 'Proposal', | ||
additionalProperties: false, | ||
required: [], | ||
properties: { | ||
guidelines: GUIDELINES_DEFINITION, | ||
template: TEMPLATE_DEFINITION | ||
} | ||
}); | ||
return validator.validate( | ||
{ | ||
guidelines: guidelines.value, | ||
template: template.value | ||
}, | ||
{ skipEmptyOptionalFields: true } | ||
); | ||
}); | ||
watchEffect(() => { | ||
emit('updateValidity', Object.values(errors.value).length === 0); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<h4 class="eyebrow mb-2 font-medium">Proposal Validation</h4> | ||
<div class="s-box mb-4"> | ||
<UiSwitch | ||
v-model="onlyMembers" | ||
title="Allow only authors to submit a proposal" | ||
/> | ||
</div> | ||
<h4 class="eyebrow mb-2 font-medium">Proposal</h4> | ||
<div class="s-box mb-4"> | ||
<UiInputString | ||
v-model="guidelines" | ||
:definition="GUIDELINES_DEFINITION" | ||
:error="errors.guidelines" | ||
/> | ||
<UiTextarea | ||
v-model="template" | ||
:definition="TEMPLATE_DEFINITION" | ||
:error="errors.template" | ||
class="!min-h-[140px]" | ||
/> | ||
</div> | ||
</template> |
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
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
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
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
Oops, something went wrong.