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

[ECO-2710] Force display the "Go to emojicoin market" button on the launch emojicoin page regardless of wallet connection or being geoblocked #528

Merged
merged 2 commits into from
Jan 29, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@ export interface ConnectWalletProps extends PropsWithChildren<{ className?: stri
onClick?: () => void;
arrow?: boolean;
forceAllowConnect?: boolean;
/** Display the button's children regardless of whether or not the user is connected. */
forceDisplayChildren?: boolean;
}

const CONNECT_WALLET = "Connect Wallet";
@@ -27,6 +29,7 @@ export const ButtonWithConnectWalletFallback = ({
onClick,
arrow = false,
forceAllowConnect,
forceDisplayChildren,
}: ConnectWalletProps) => {
const { connected } = useWallet();
const { openWalletModal } = useWalletModal();
@@ -76,7 +79,10 @@ export const ButtonWithConnectWalletFallback = ({
// This component is used to display the `Connect Wallet` button and text with a scramble effect.
// We use it in both mobile and desktop components.
const inner =
!connected || !children || geoblocked ? (
// If the user is not connected, there's no children, or the user is geoblocked, display
// the "Connect Wallet" button. However, if `forceDisplayChildren === true`, display them
// regardless of the other parameters.
(!connected || !children || geoblocked) && !forceDisplayChildren ? (
<Button
className={
className + (mobile ? " px-[9px] border-dashed border-b border-b-dark-gray" : "")
Original file line number Diff line number Diff line change
@@ -25,7 +25,9 @@ export const LaunchButtonOrGoToMarketLink = ({

return (
<>
<ButtonWithConnectWalletFallback>
{/* Force displaying the "Go to emojicoin market" link if the market is already registered,
regardless of whether or not the user is connected. */}
<ButtonWithConnectWalletFallback forceDisplayChildren={registered}>
{registered ? (
<Link
className="font-pixelar text-lg uppercase text-ec-blue"