Skip to content

Commit

Permalink
Tweak topic selector style
Browse files Browse the repository at this point in the history
  • Loading branch information
jahooma committed Apr 12, 2023
1 parent dc21404 commit fa8baa3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions web/components/topic-selector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { uniq } from 'lodash'
import { cleanTopic, TOPICS_TO_SUBTOPICS } from 'common/topics'
import { Row } from './layout/row'
import { Select } from './widgets/select'

export function TopicSelector(props: {
Expand All @@ -11,15 +10,17 @@ export function TopicSelector(props: {
const subtopics = uniq(Object.values(TOPICS_TO_SUBTOPICS).flat())

return (
<Row className="items-center gap-2">
<Select value={topic} onChange={(e) => onSetTopic(e.target.value)}>
<option value="">🖤 For you</option>
{subtopics.map((subtopic) => (
<option key={subtopic} value={cleanTopic(subtopic)}>
{subtopic}
</option>
))}
</Select>
</Row>
<Select
className="!border-ink-200"
value={topic}
onChange={(e) => onSetTopic(e.target.value)}
>
<option value="">🖤 For you</option>
{subtopics.map((subtopic) => (
<option key={subtopic} value={cleanTopic(subtopic)}>
{subtopic}
</option>
))}
</Select>
)
}
2 changes: 1 addition & 1 deletion web/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const YourFeedSection = memo(function YourFeedSection(props: {
const [topic, setTopic] = usePersistentInMemoryState('', 'your-feed-topic')

return (
<Col className={clsx(className, 'gap-2')}>
<Col className={className}>
<TopicSelector onSetTopic={setTopic} topic={topic} />
<ContractsFeed topic={topic} />
</Col>
Expand Down

0 comments on commit fa8baa3

Please sign in to comment.