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

Added modal to inform the lack of optimization for mobile #91

Merged
merged 5 commits into from
Nov 21, 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
14 changes: 8 additions & 6 deletions apps/abclaunch/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Divider, HStack, Text, VStack, Image } from '@chakra-ui/react';
import { useNavigate } from 'react-router-dom';
import ChooseOption from '../components/ChooseOption';
import NotOptimizedModal from 'commons-ui/src/components/MobileOptimizationWarningModal';

export default function Launchpad() {
const navigate = useNavigate();
return (
<VStack bg="brand.100" pb="100px">
<NotOptimizedModal />
<VStack spacing={0}>
<Text color="brand.900" fontSize="72px" fontFamily="VictorSerifTrial">Welcome to ABC Launch</Text>
<Text color="brand.900" fontSize="24px" pt="32px">Build a regenerative economy with an</Text>
Expand Down Expand Up @@ -35,20 +37,20 @@ export default function Launchpad() {
</HStack>
</HStack>
<HStack spacing={16} pt="46px">
<ChooseOption
<ChooseOption
title="New DAO"
description={[
"I want to create a new",
"DAO and launch an ABC."
"I want to create a new",
"DAO and launch an ABC."
]}
onButtonClick={() => navigate('/new-dao')}
buttonText="Launch on a new DAO"
/>
<ChooseOption
<ChooseOption
title="Existing DAO"
description={[
"I have a DAO and want to",
"attach an ABC to it."
"I have a DAO and want to",
"attach an ABC to it."
]}
onButtonClick={() => navigate('/existing-dao')}
buttonText="Launch on an existing DAO"
Expand Down
2 changes: 2 additions & 0 deletions apps/abcswap/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Button, Divider, HStack, Image, Stack, Text, VStack } from '@chakra-ui/
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { DaoNameInput, useIsRegisteredDaoWithApp } from 'dao-utils';
import NotOptimizedModal from 'commons-ui/src/components/MobileOptimizationWarningModal';

export default function Home() {

Expand All @@ -20,6 +21,7 @@ export default function Home() {

return (
<VStack bg="brand.100" pb="100px0" textAlign="center">
<NotOptimizedModal />
<VStack spacing={0}>
<Text color="brand.900" fontSize="72px" fontFamily="VictorSerifTrial">Welcome to ABC Swap</Text>
<Text color="brand.900" fontSize="24px" pt="32px">Find and swap ABC tokens.</Text>
Expand Down
2 changes: 1 addition & 1 deletion pkg/commons-ui/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type LayoutProps = {

export default function Layout({ children, variant }: LayoutProps) {
return (
<Box width="100%" height="100vh" bgColor="brand.100">
<Box width="100%" height="100vh" overflowX="hidden" overflowY="scroll" bgColor="brand.100">
<Header variant={variant} />
{children}
<Footer />
Expand Down
47 changes: 47 additions & 0 deletions pkg/commons-ui/src/components/MobileOptimizationWarningModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {
Modal,
ModalOverlay,
ModalContent,
ModalHeader,
ModalBody,
ModalCloseButton,
Text,
Button,
useDisclosure,
useBreakpointValue,
VStack
} from "@chakra-ui/react"
import { useEffect } from "react"


export default function MobileOptimizationWarningModal() {

const { isOpen, onOpen, onClose } = useDisclosure()
const isMobile = useBreakpointValue({ base: true, md: false })

useEffect(() => {
if (isMobile) {
onOpen();
}
}, [isMobile, onOpen])

if (!isMobile) return (<></>)

return (
<>
<Modal isOpen={isOpen} onClose={onClose} isCentered>
<ModalOverlay />
<ModalContent border="1px solid black" borderRadius="16px">
<ModalHeader>Attention!</ModalHeader>
<ModalCloseButton />
<ModalBody textAlign="center" m="2.5%">
<VStack>
<Text>This MVP is not yet optimized for mobile. It is best experienced on a desktop.</Text>
<Button onClick={onClose}>Ok</Button>
</VStack>
</ModalBody>
</ModalContent>
</Modal>
</>
)
}