display full category
This commit is contained in:
parent
b6dc281904
commit
ea1cc717c3
|
@ -1,4 +1,5 @@
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
|
import { CATEGORIES } from '../../common/categories'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
|
|
||||||
import { Row } from './layout/row'
|
import { Row } from './layout/row'
|
||||||
|
@ -6,6 +7,9 @@ import { SiteLink } from './site-link'
|
||||||
|
|
||||||
function Hashtag(props: { tag: string; noLink?: boolean }) {
|
function Hashtag(props: { tag: string; noLink?: boolean }) {
|
||||||
const { tag, noLink } = props
|
const { tag, noLink } = props
|
||||||
|
const category = CATEGORIES[tag.replace('#', '').toLowerCase()]
|
||||||
|
console.log(tag, category)
|
||||||
|
|
||||||
const body = (
|
const body = (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
@ -13,7 +17,7 @@ function Hashtag(props: { tag: string; noLink?: boolean }) {
|
||||||
!noLink && 'cursor-pointer'
|
!noLink && 'cursor-pointer'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<span className="text-sm text-gray-600">{tag}</span>
|
<span className="text-sm text-gray-600">{category ?? tag}</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -213,9 +213,7 @@ export function NewContract(props: { question: string; tag?: string }) {
|
||||||
<select
|
<select
|
||||||
className="select select-bordered w-full max-w-xs"
|
className="select select-bordered w-full max-w-xs"
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setCategory(
|
setCategory(TO_CATEGORY[e.currentTarget.value] ?? '')
|
||||||
e.currentTarget.value || TO_CATEGORY[e.currentTarget.value]
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<option selected={category === ''}></option>
|
<option selected={category === ''}></option>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user