diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-04-18 11:30:10 +0200 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-04-18 11:30:10 +0200 |
commit | 18652c6ff5e10208298bea67ffce6b4ed327c97d (patch) | |
tree | 9c0cca8139007641c9fd9a1cbfcff179953a1054 /pages/search.tsx | |
parent | 59459df904674bc3eaa95f4203113793c7c7fc9a (diff) |
search page without inline css
Diffstat (limited to 'pages/search.tsx')
-rw-r--r-- | pages/search.tsx | 56 |
1 files changed, 11 insertions, 45 deletions
diff --git a/pages/search.tsx b/pages/search.tsx index 2b8668a..90f1f67 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -24,32 +24,21 @@ function search(callback: (results: Array<userInfo>) => void) { } function SearchResults(props: { userList: Array<userInfo>; }) { - return <div> + return <div className="results"> {props.userList?.map(user => <SearchResult user={user} key={user.id} />)} </div>; } function SearchResult(props: { user: userInfo; }) { return <Vierkant - style={{ - padding: 12, - }} - fullwidth + className="result pad-m fullwidth" href={'/user?id=' + props.user.id} > - <div style={{ position: 'relative' }}> + <div className="inner posrel"> <AccountAvatar size={48} id={props.user.id} /> - <div - style={{ - position: 'absolute', - top: 0, - right: 0, - bottom: 0, - left: 48 + 12, - }} - > - <b>{props.user.username}</b> - <p>{props.user.status}</p> + <div className="userInfo posabs v0 r0"> + <b className="username">{props.user.username}</b> + <p className="status">{props.user.status}</p> </div> </div> </Vierkant>; @@ -58,40 +47,22 @@ function SearchResult(props: { user: userInfo; }) { function SearchBar(props: { searchFunction: (event?: FormEvent<HTMLFormElement>) => void; }) { - return <Vierkant - fullwidth - style={{ - padding: 8, - marginBottom: 24, - }} - > + return <Vierkant className="pad-m fullwidth searchBar"> <form onSubmit={props.searchFunction}> <Input id='searchBar' label='Zoeken voor gebruikers...' autocomplete='off' - dark autofocus - style={{ - backgroundColor: 'var(--background)', - color: 'var(--text)', - padding: 14, - fontSize: 16, - width: 'calc(100% - 48px - 14px * 2)', - }} + className="pad-m" /> <Button - style={{ - padding: 12, - float: 'right', - display: 'inline-block', - borderRadius: 4, - }} + className="pad-m dispinbl valigntop" onclick={props.searchFunction} > <SearchOutlinedIcon /> </Button> - <input type='submit' style={{ display: 'none' }} /> + <input type='submit' className="dispnone" /> </form> </Vierkant>; } @@ -112,12 +83,7 @@ export default function HomePage() { <SearchBar searchFunction={getSearchResults} /> <SearchResults userList={results} /> {searched && results.length == 0 && <h1 - style={{ - opacity: .6, - color: 'var(--text)', - textAlign: 'center', - margin: '24px 32px', - }} + className="noresults center subtile" > Geen zoekresultaten gevonden </h1>} |