Skip to content

Commit

Permalink
rework: on books view, make save button pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolKumarGupta committed Nov 5, 2022
1 parent 4ce824c commit 4f0380f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ export default function Book(){

return (
<>
<div> <button onClick={()=>dispatch(add(textRef.current?.innerText))} >Save</button></div>
<div ref={textRef} contentEditable="true" className="lg:fixed lg:w-full lg:h-full"></div>
<div className="text-right">
<button onClick={()=>dispatch(add(textRef.current?.innerText))} className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 m-1 rounded " >Save</button>
</div>
<div ref={textRef} contentEditable="true" className="absolute lg:fixed w-full lg:w-[calc(100%-280px)] h-full p-2 w-auto border-none focus-visible:outline-none"></div>
</>
);
}

0 comments on commit 4f0380f

Please sign in to comment.