Skip to content

Commit

Permalink
refs #23 Submit search form with enter key
Browse files Browse the repository at this point in the history
  • Loading branch information
h3poteto committed Sep 15, 2023
1 parent 431be63 commit 27957fc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/search/Results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouter } from 'next/router'
import { useCallback, useState } from 'react'
import { BsSearch, BsPeople, BsHash, BsChatQuote } from 'react-icons/bs'
import { FormattedMessage, useIntl } from 'react-intl'
import { Input, InputGroup, List, Avatar } from 'rsuite'
import { Input, InputGroup, List, Avatar, Form } from 'rsuite'
import { Server } from 'src/entities/server'
import Status from 'src/components/timelines/status/Status'
import emojify from 'src/utils/emojify'
Expand Down Expand Up @@ -97,12 +97,14 @@ export default function Results(props: Props) {
return (
<>
<div style={{ margin: '12px 0' }}>
<InputGroup inside>
<Input placeholder={formatMessage({ id: 'search.placeholder' })} value={word} onChange={value => setWord(value)} />
<InputGroup.Button onClick={() => search(word)}>
<Icon as={BsSearch} />
</InputGroup.Button>
</InputGroup>
<Form onCheck={() => search(word)}>
<InputGroup inside>
<Input placeholder={formatMessage({ id: 'search.placeholder' })} value={word} onChange={value => setWord(value)} />
<InputGroup.Button onClick={() => search(word)}>
<Icon as={BsSearch} />
</InputGroup.Button>
</InputGroup>
</Form>
</div>
{/* accounts */}
{accounts.length > 0 && (
Expand Down

0 comments on commit 27957fc

Please sign in to comment.