Skip to content

Commit

Permalink
Merge pull request #117 from Eagle2gle/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
m4nd4r1n authored Mar 26, 2023
2 parents ea4d049 + fa0dd2a commit 0b15af7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/cahoot/DeadlineCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const DeadlineCarousel = () => {
<Image src={images[0]} alt="" className="rounded-full" fill sizes="96px" />
)}
</div>
<div className="w-32 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm">
<div className="w-32 overflow-hidden overflow-ellipsis whitespace-nowrap text-center text-sm">
{title}
</div>
<span className="text-xs font-semibold text-black/60">
Expand Down
16 changes: 15 additions & 1 deletion src/components/common/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import { useRef } from 'react';

import Icon from './Icons';

const Search = () => {
const submitRef = useRef<HTMLButtonElement>(null);

const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (!submitRef.current) return;
if (e.target.value === '') {
submitRef.current.click();
}
};

return (
<div className="flex items-center rounded border border-black/50 px-2">
<Icon.Search />
<button ref={submitRef} type="submit">
<Icon.Search />
</button>
<input
onChange={onChange}
name="search"
type="text"
className="input input-sm focus:outline-none"
Expand Down

0 comments on commit 0b15af7

Please sign in to comment.