fix(board): address review feedback on components
This commit is contained in:
parent
33d27c5d9e
commit
4d9eb3c198
3 changed files with 26 additions and 11 deletions
|
|
@ -61,8 +61,6 @@ const props = defineProps({
|
||||||
|
|
||||||
defineEmits(['edit', 'delete'])
|
defineEmits(['edit', 'delete'])
|
||||||
|
|
||||||
const { resolveTagChannel, slackUrl } = useBoardChannels()
|
|
||||||
|
|
||||||
const hasSeeking = computed(() => !!(props.post.seeking && props.post.seeking.trim()))
|
const hasSeeking = computed(() => !!(props.post.seeking && props.post.seeking.trim()))
|
||||||
const hasOffering = computed(() => !!(props.post.offering && props.post.offering.trim()))
|
const hasOffering = computed(() => !!(props.post.offering && props.post.offering.trim()))
|
||||||
|
|
||||||
|
|
@ -81,9 +79,14 @@ const typeClass = computed(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const slackLink = computed(() => {
|
const slackLink = computed(() => {
|
||||||
const channel = resolveTagChannel(props.post.tags || [])
|
const postTags = props.post.tags || []
|
||||||
if (!channel) return null
|
if (!postTags.length) return null
|
||||||
return slackUrl(channel.slackChannelId)
|
const channel = props.channels.find(c => {
|
||||||
|
const slugs = c.tagSlugs || []
|
||||||
|
return slugs.some(s => postTags.includes(s))
|
||||||
|
})
|
||||||
|
if (!channel || !channel.slackChannelId) return null
|
||||||
|
return `https://gammaspace.slack.com/archives/${channel.slackChannelId}`
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,14 @@ const form = reactive({
|
||||||
|
|
||||||
const error = ref('')
|
const error = ref('')
|
||||||
|
|
||||||
|
watch(() => props.post, (p) => {
|
||||||
|
form.title = p?.title || ''
|
||||||
|
form.seeking = p?.seeking || ''
|
||||||
|
form.offering = p?.offering || ''
|
||||||
|
form.note = p?.note || ''
|
||||||
|
form.tags = Array.isArray(p?.tags) ? [...p.tags] : []
|
||||||
|
}, { immediate: false })
|
||||||
|
|
||||||
function toggleTag(slug) {
|
function toggleTag(slug) {
|
||||||
const idx = form.tags.indexOf(slug)
|
const idx = form.tags.indexOf(slug)
|
||||||
if (idx === -1) form.tags.push(slug)
|
if (idx === -1) form.tags.push(slug)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
>{{ tag.label || tag.name || tag.slug }}</button>
|
>{{ tag.label || tag.name || tag.slug }}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="suggest-link">
|
<div class="suggest-link">
|
||||||
<span @click="$emit('suggest')">Don't see what you're looking for?</span>
|
<button type="button" class="suggest-btn" @click="$emit('suggest')">Don't see what you're looking for?</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -77,19 +77,23 @@ function toggle(slug) {
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggest-link {
|
.suggest-link {
|
||||||
font-size: 10px;
|
|
||||||
font-family: "Commit Mono", monospace;
|
|
||||||
color: var(--text-faint);
|
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggest-link span {
|
.suggest-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
font: inherit;
|
||||||
|
font-size: 10px;
|
||||||
|
font-family: "Commit Mono", monospace;
|
||||||
|
color: var(--text-faint);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-underline-offset: 2px;
|
text-underline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggest-link span:hover {
|
.suggest-btn:hover {
|
||||||
color: var(--text-dim);
|
color: var(--text-dim);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue