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'])
|
||||
|
||||
const { resolveTagChannel, slackUrl } = useBoardChannels()
|
||||
|
||||
const hasSeeking = computed(() => !!(props.post.seeking && props.post.seeking.trim()))
|
||||
const hasOffering = computed(() => !!(props.post.offering && props.post.offering.trim()))
|
||||
|
||||
|
|
@ -81,9 +79,14 @@ const typeClass = computed(() => {
|
|||
})
|
||||
|
||||
const slackLink = computed(() => {
|
||||
const channel = resolveTagChannel(props.post.tags || [])
|
||||
if (!channel) return null
|
||||
return slackUrl(channel.slackChannelId)
|
||||
const postTags = props.post.tags || []
|
||||
if (!postTags.length) return null
|
||||
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>
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,14 @@ const form = reactive({
|
|||
|
||||
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) {
|
||||
const idx = form.tags.indexOf(slug)
|
||||
if (idx === -1) form.tags.push(slug)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
>{{ tag.label || tag.name || tag.slug }}</button>
|
||||
</div>
|
||||
<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>
|
||||
</template>
|
||||
|
|
@ -77,19 +77,23 @@ function toggle(slug) {
|
|||
}
|
||||
|
||||
.suggest-link {
|
||||
font-size: 10px;
|
||||
font-family: "Commit Mono", monospace;
|
||||
color: var(--text-faint);
|
||||
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;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
|
||||
.suggest-link span:hover {
|
||||
.suggest-btn:hover {
|
||||
color: var(--text-dim);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue