Skip to content

Commit

Permalink
fix connected wallet bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RamRamez committed Sep 23, 2024
1 parent 76b77ae commit 186b93f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface IEstimatedMatchingToast {
token?: IProjectAcceptedToken;
tokenPrice?: number;
isStellar?: boolean;
show?: boolean;
}

const EstimatedMatchingToast: FC<IEstimatedMatchingToast> = ({
Expand All @@ -35,6 +36,7 @@ const EstimatedMatchingToast: FC<IEstimatedMatchingToast> = ({
amount,
tokenPrice,
isStellar,
show,
}) => {
const { formatMessage, locale } = useIntl();
const { estimatedMatching, qfRounds } = projectData || {};
Expand Down Expand Up @@ -71,7 +73,7 @@ const EstimatedMatchingToast: FC<IEstimatedMatchingToast> = ({
)} ${allocatedFundUSDPreferred ? '' : ` ${allocatedTokenSymbol}`}`;

return (
<Wrapper>
<Wrapper show={show}>
<FlexCenter gap='5px'>
<Caption $medium>
{formatMessage({ id: 'label.estimated_matching' })}
Expand All @@ -93,7 +95,7 @@ const EstimatedMatchingToast: FC<IEstimatedMatchingToast> = ({
);
};

const Wrapper = styled.div`
const Wrapper = styled.div<{ show?: boolean }>`
display: flex;
padding: 4px 16px 8px 16px;
justify-content: space-between;
Expand All @@ -102,6 +104,7 @@ const Wrapper = styled.div`
background: ${neutralColors.gray[200]};
color: ${semanticColors.jade[700]};
margin-bottom: -5px;
opacity: ${({ show }) => (show ? 1 : 0)};
`;

export default EstimatedMatchingToast;
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ const CryptoDonation: FC<{
token={selectedOneTimeToken}
amount={amount}
tokenPrice={tokenPrice}
show={showEstimatedMatching}
/>
<ForEstimatedMatchingAnimation
showEstimatedMatching={showEstimatedMatching}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export const QRDonationCard: FC<QRDonationCardProps> = ({
token={stellarToken}
amount={amount}
tokenPrice={tokenPrice}
show={showEstimatedMatching}
isStellar
/>
{!showQRCode ? (
Expand Down
20 changes: 15 additions & 5 deletions src/components/views/donate/QFEligibleNetworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import { useDonateData } from '@/context/donate.context';
import { ChainType } from '@/types/config';
import config from '@/configuration';
import { IconWithTooltip } from '@/components/IconWithToolTip';
import { useGeneralWallet } from '@/providers/generalWalletProvider';

const QFEligibleNetworks = () => {
const [showModal, setShowModal] = useState(false);
const { isConnected } = useGeneralWallet();
const { formatMessage } = useIntl();
const { activeStartedRound } = useDonateData();
const router = useRouter();
Expand All @@ -42,9 +44,13 @@ const QFEligibleNetworks = () => {
<IconsWrapper>
{eligibleNetworksWithChainType?.map(network => (
<IconWithTooltip
icon={config.NETWORKS_CONFIG[
network.networkId
]?.chainLogo(24)}
icon={
<TooltipIconWrapper>
{config.NETWORKS_CONFIG[
network.networkId
]?.chainLogo(24)}
</TooltipIconWrapper>
}
direction='top'
align='top'
key={network.networkId}
Expand All @@ -55,7 +61,7 @@ const QFEligibleNetworks = () => {
</IconWithTooltip>
))}
</IconsWrapper>
{!isQRDonation && (
{!isQRDonation && isConnected && (
<ButtonsWrapper>
<OutlineButton
onClick={() => setShowModal(true)}
Expand All @@ -82,8 +88,12 @@ const QFEligibleNetworks = () => {
);
};

const TooltipIconWrapper = styled.div`
margin-top: 4px;
`;

const IconsWrapper = styled.div`
margin-top: 16px;
margin-top: 14px;
display: flex;
gap: 4px;
img {
Expand Down

0 comments on commit 186b93f

Please sign in to comment.