Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/mobile layouts #7

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions src/components/molecules/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,22 @@ interface Props {
const Modal = forwardRef<HTMLDialogElement, Props>(
({ id, title, description, children, actions, onClose }, ref) => {
return (
<>
<dialog id={id} className="modal" ref={ref} onClose={onClose}>
<div className="modal-box">
<form method="dialog">
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">
</button>
</form>
{title && <h3 className="font-bold text-lg">{title}</h3>}
{description && <div className="py-4">{description}</div>}
<div className="py-4">{children}</div>
<div className="modal-action">{actions}</div>
</div>
<form method="dialog" className="modal-backdrop">
<button>close</button>
<dialog id={id} className="modal" ref={ref} onClose={onClose}>
<div className="modal-box">
<form method="dialog">
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">
</button>
</form>
</dialog>
</>
{title && <h3 className="font-bold text-lg">{title}</h3>}
{description && <div className="py-4">{description}</div>}
<div className="py-4">{children}</div>
<div className="modal-action">{actions}</div>
</div>
<form method="dialog" className="modal-backdrop">
<button>close</button>
</form>
</dialog>
);
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/theme.controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ThemeController: React.FC = () => {
<label className="swap swap-rotate">
<input value="pastel" type="checkbox" className="theme-controller" />
<Sun className="swap-on w-6 h-6" />
<Moon className="swap-off w-6 h-6" />
<Moon className="swap-off w-6 h-6" />
</label>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/wallet.connect.button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { shortenEthereumAddress } from 'src/helpers/short.address';
import { Button } from '../atoms';

const WalletConnectButton = () => {
const { account, connect } = useWalletContext();
const { account, connectToWallet } = useWalletContext();
return (
<Button onClick={connect} variant={ButtonVariant.Secondary}>
<Button onClick={connectToWallet} variant={ButtonVariant.Secondary}>
<CreditCard />
<span>{account ? shortenEthereumAddress(account) : 'Connect'}</span>
</Button>
Expand Down
6 changes: 5 additions & 1 deletion src/components/templates/fundraisers.template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const FundraisersTemplate: React.FC = () => {
});

const closeModal = () => {
setSelectedFundraiser(null);
const modalElement = modalRef.current;
if (modalElement && modalElement.close) {
modalElement.close();
setSelectedFundraiser(null);
}
};

const openModal = () => {
Expand Down