mars-v2-frontend/src/components/common/SearchBar.tsx
Linkie Link 3c280518e8
Morph summary (#763)
* fix: fixed mobile issues with SVGs

* feat: first morphing AccountDetails

* tidy: composition refresh

* tidy: fine adjusting

* fix: svg fixes

* feat: updated summary structure

* feat: overall layout adjustments

* fix: fixed svg adjustments

* feat: finished AccountSummary update

* fix: fixed build

* tidy: refactor

* fix: fix enourmous APYs

* fix: don’t abbreviate APYs

* tidy: console.log

* fix: fix borrow Rate sorting

* fix: fixed scrollbars

* fix: hide scrollbars

* fix: resolved feedback

* fix: amount not size

* feat: only show credit account number outside of modals

* fix: added missing Strategies to PortfolioAccount

* fix: save some space
2024-02-06 10:05:42 +01:00

42 lines
1.2 KiB
TypeScript

import classNames from 'classnames'
import React, { ChangeEvent, LegacyRef } from 'react'
import { Search } from 'components/common/Icons'
interface Props {
value: string
placeholder: string
autoFocus?: boolean
onChange: (value: string) => void
}
const SearchBar = (props: Props, ref: LegacyRef<HTMLDivElement>) => {
function onChange(event: ChangeEvent<HTMLInputElement>) {
props.onChange(event.target.value)
}
return (
<div
className={classNames(
'flex w-full items-center justify-between rounded-sm bg-white/10 p-2.5',
'relative isolate max-w-full overflow-hidden rounded-sm',
'before:content-[" "] before:absolute before:inset-0 before:-z-1 before:rounded-sm before:p-[1px] before:border-glas',
)}
ref={ref}
>
<div className='w-3.5 h-3.5 mr-2.5 text-white'>
<Search />
</div>
<input
value={props.value}
className='w-full h-full text-xs bg-transparent outline-none placeholder-white/50'
placeholder={props.placeholder}
onChange={(event) => onChange(event)}
autoFocus={props.autoFocus}
/>
</div>
)
}
export default React.forwardRef(SearchBar)