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

Display frogcrypto btn always #2169

Merged
merged 2 commits into from
Nov 13, 2024
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
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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we change this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the frogcryto btn got smaller so had to reduce size to remove extra bottom mergin under the btn

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
Loading