Skip to content

Commit

Permalink
Display frogcrypto btn always (#2169)
Browse files Browse the repository at this point in the history
#### refrence

<img width="444" alt="Screenshot 2024-11-13 at 7 58 31"
src="https://github.com/user-attachments/assets/d66ba36b-6cbd-4fa2-b469-d913630b501a">

#### with pods:
<img width="466" alt="Screenshot 2024-11-13 at 7 59 07"
src="https://github.com/user-attachments/assets/9a56942c-b950-496a-b270-2df530547484">

#### no pods:
<img width="446" alt="Screenshot 2024-11-13 at 7 59 37"
src="https://github.com/user-attachments/assets/6f4b08ed-600e-4023-b7a8-3325d181704f">
  • Loading branch information
ororsatti authored Nov 13, 2024
1 parent 92d74c7 commit 06dd129
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from "styled-components";
export const ZAPP_BUTTON_HEIGHT = 80;
export const ZAPP_BUTTON_HEIGHT = 60;
export const ZappButton = styled.div`
display: flex;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ import {
} from "react";
import { useSearchParams } from "react-router-dom";
import styled from "styled-components";
import { useDispatch, usePCDCollection } from "../../../src/appHooks";
import { useDispatch, usePCDCollection, useSelf } from "../../../src/appHooks";
import { BANNER_HEIGHT, MAX_WIDTH_SCREEN } from "../../../src/sharedConstants";
import { nextFrame } from "../../../src/util";
import { PodsCollectionList } from "../../shared/Modals/PodsCollectionBottomModal";
import { Typography } from "../../shared/Typography";
import { hideScrollCSS, replaceDotWithSlash } from "../../shared/utils";
import { ScrollIndicator } from "./ScrollIndicator";
import { ZappButtonsContainer } from "../../../components/screens/ZappScreens/ZappButtonsContainer";
import { ZappButton } from "../../../components/screens/ZappScreens/ZappButton";
import { appConfig } from "../../../src/appConfig";
import { ZappFullScreen } from "../../../components/screens/ZappScreens/ZappFullScreen";

const EMPTY_CARD_CONTAINER_HEIGHT = 220;
const EmptyCardContainer = styled.div<{ longVersion: boolean }>`
display: flex;
height: ${({ longVersion }): string =>
longVersion ? "min(80vh, 549px)" : EMPTY_CARD_CONTAINER_HEIGHT + "px"};
longVersion ? "min(70vh, 499px)" : EMPTY_CARD_CONTAINER_HEIGHT + "px"};
justify-content: center;
align-items: center;
border-radius: 16px;
Expand Down Expand Up @@ -97,8 +101,10 @@ export const NoUpcomingEventsState = ({
const [expandedGroupsIds, setExpandedGroupsIds] = useState<
Record<string, boolean>
>({});
const [params] = useSearchParams();
const [params, setParams] = useSearchParams();
const listContainerRef = useRef<HTMLDivElement>(null);
const [zappUrl, setZappUrl] = useState("");
const self = useSelf();

// New function to check scrollability
const checkScrollability = (): void => {
Expand Down Expand Up @@ -149,6 +155,18 @@ export const NoUpcomingEventsState = ({
checkScrollability();
}, [noPods, params, setExpandedGroupsIds]);

if (zappUrl) {
return (
<ZappFullScreen
url={zappUrl}
onReturn={() => {
setZappUrl("");
params.delete("folder");
setParams(params);
}}
/>
);
}
return (
<OuterContainer>
<EmptyCardContainer longVersion={noPods}>
Expand Down Expand Up @@ -189,6 +207,30 @@ export const NoUpcomingEventsState = ({
</div>
</InnerContainer>
</EmptyCardContainer>
{Object.keys(appConfig.embeddedZapps).length > 0 && (
<ZappButtonsContainer>
{Object.entries(appConfig.embeddedZapps).map(([zappName, url]) => (
<ZappButton
key={zappName}
onClick={() => {
setZappUrl(url);
setParams({ folder: zappName });
}}
>
<iframe
style={{
width: "100%",
height: "100%"
}}
src={new URL(
`button/${self?.semaphore_v4_commitment ?? ""}`,
url
).toString()}
/>
</ZappButton>
))}
</ZappButtonsContainer>
)}
{isLandscape ||
(!noPods && (
<ListContainer
Expand Down

0 comments on commit 06dd129

Please sign in to comment.