Skip to content

Commit

Permalink
fix: make close button a svg (#214)
Browse files Browse the repository at this point in the history
* make button a svg

* update test

* appease prettier

* use opacity hover styling

* update .gitignore

* remove unnecessary fill

* remove DS_Store
  • Loading branch information
cho-jos authored Jan 3, 2025
1 parent 73640e3 commit f628001
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ npm-debug.log
/node_modules/

*storybook.log
config/dev.secret.exs
config/dev.secret.exs
6 changes: 5 additions & 1 deletion js/components/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export const Modal = ({
<div className='grid grid-cols-[1fr_max-content] grid-rows-[max-content_1fr] [grid-template-areas:"title_close"_"contents_contents"] overflow-scroll'>
<div className="[grid-area:title]">{title}</div>
<button className="[grid-area:close]" onClick={onClose}>
[x]
<img
src="/images/close.svg"
alt="Close"
className="w-4 hover:opacity-50"
/>
</button>
<div className="[grid-area:contents]">{children}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("OperatorSignInModal", () => {
<OperatorSignInModal show={true} onComplete={jest.fn()} close={close} />,
);

await userEvent.click(view.getByRole("button", { name: "[x]" }));
await userEvent.click(view.getByRole("button", { name: "Close" }));
expect(close).toHaveBeenCalled();
view.rerender(
<OperatorSignInModal show={false} onComplete={jest.fn()} close={close} />,
Expand Down
5 changes: 5 additions & 0 deletions priv/static/images/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f628001

Please sign in to comment.