mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 22:10:57 +08:00
* feat(web): add FAQ page with search, sidebar, and i18n integration; update navigation and routes; include user feedback analysis docs (faq.md) * docs: add filled frontend PR template for FAQ feature (PR_FRONTEND_FAQ.md) * docs(web): add Contributing & Tasks FAQ category near top with guidance on using GitHub Projects and PR contribution standards * feat(web,api): dynamically embed GitHub Projects roadmap in FAQ via /api/roadmap and RoadmapWidget; add env vars for GitHub token/org/project * chore(docker): pass GitHub roadmap env vars into backend container * docs(web): update FAQ with fork-based PR workflow, yellow links to roadmap/task dashboard, and contribution incentives; remove dynamic roadmap embed\n\nchore(api,docker): remove /api/roadmap endpoint and related env wiring * chore: revert unintended changes (.env.example, api/server.go, docker-compose.yml); remove local-only files (PR_FRONTEND_FAQ.md, web/faq.md) from PR * feat: 添加对重置密码页面的路由支持
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { Search, X } from 'lucide-react'
|
|
|
|
interface FAQSearchBarProps {
|
|
searchTerm: string
|
|
onSearchChange: (value: string) => void
|
|
placeholder?: string
|
|
}
|
|
|
|
export function FAQSearchBar({
|
|
searchTerm,
|
|
onSearchChange,
|
|
placeholder = 'Search FAQ...',
|
|
}: FAQSearchBarProps) {
|
|
return (
|
|
<div className="relative">
|
|
<Search
|
|
className="absolute left-4 top-1/2 transform -translate-y-1/2 w-5 h-5"
|
|
style={{ color: '#848E9C' }}
|
|
/>
|
|
<input
|
|
type="text"
|
|
value={searchTerm}
|
|
onChange={(e) => onSearchChange(e.target.value)}
|
|
placeholder={placeholder}
|
|
className="w-full pl-12 pr-12 py-3 rounded-lg text-base transition-all focus:outline-none focus:ring-2"
|
|
style={{
|
|
background: '#1E2329',
|
|
border: '1px solid #2B3139',
|
|
color: '#EAECEF',
|
|
}}
|
|
onFocus={(e) => {
|
|
e.target.style.borderColor = '#F0B90B'
|
|
e.target.style.boxShadow = '0 0 0 3px rgba(240, 185, 11, 0.1)'
|
|
}}
|
|
onBlur={(e) => {
|
|
e.target.style.borderColor = '#2B3139'
|
|
e.target.style.boxShadow = 'none'
|
|
}}
|
|
/>
|
|
{searchTerm && (
|
|
<button
|
|
onClick={() => onSearchChange('')}
|
|
className="absolute right-4 top-1/2 transform -translate-y-1/2 hover:opacity-70 transition-opacity"
|
|
style={{ color: '#848E9C' }}
|
|
>
|
|
<X className="w-5 h-5" />
|
|
</button>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|