Skip to content

Commit

Permalink
Merge pull request #58 from konan-5/release/0.1
Browse files Browse the repository at this point in the history
Implement autofocus in global search
  • Loading branch information
AndyQus authored Apr 4, 2024
2 parents 4da8190 + 0b85e6e commit 4f94fae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/app/components/SearchBar/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function SearchBar() {
</div>
)}
<motion.div
className="border-b-[1px] border-gray-70 flex justify-center items-center"
className="border-b-[1px] relative mx-auto max-w-[1440px] border-gray-70 flex justify-center items-center"
variants={{
hidden: {
y: -20,
Expand All @@ -76,23 +76,24 @@ function SearchBar() {
animate="show"
>
<Input
className="max-w-[820px] mx-auto w-full p-12"
className="max-w-[820px] mx-auto w-full py-12 px-20"
placeholder="Search TX, blocks, IDs..."
value={keyword}
disableUnderline
autoFocus
startAdornment={
<img className="w-16 h-16 mr-10" src="assets/icons/magnify.svg" alt="search" />
}
onChange={(e) => {
setKeyword(e.target.value);
}}
/>
<IconButton className="absolute right-24" onClick={handleClose}>
<IconButton className="absolute right-12 sm:right-24" onClick={handleClose}>
<img className="w-24 h-24" src="assets/icons/xmark.svg" alt="xmark" />
</IconButton>
</motion.div>
{sortedByType && (
<div className="max-h-[320px] overflow-auto max-w-[700px] mx-auto">
<div className="max-h-[320px] overflow-auto max-w-[800px] mx-auto">
{sortedByType?.[0]?.length > 0 && (
<ResultItem
icon={
Expand Down
6 changes: 3 additions & 3 deletions src/app/main/apps/network/NetworkHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import SearchBar from 'src/app/components/SearchBar/SearchBar';

function NetworkHeader() {
return (
<div className="p-20 flex mx-4 gap-6 justify-center items-center">
<div className="p-20 relative flex max-w-[1440px] mx-auto gap-6 justify-center items-center">
<Link to="/network">
<img src="assets/images/logo/logo-text-on-dark.svg" alt="logo" />
</Link>
<div className="absolute right-24">
<div className="absolute right-12 sm:right-24">
<div className="hidden sm:inline">
<SearchBar />
</div>
<LanguagePicker />
</div>
<div className="absolute left-24 sm:hidden">
<div className="absolute left-12 sm:left-24 sm:hidden">
<SearchBar />
</div>
</div>
Expand Down

0 comments on commit 4f94fae

Please sign in to comment.