From ad2814897874f6e0de2e30523618db4d9cf1f77b Mon Sep 17 00:00:00 2001 From: tinan272 Date: Sun, 25 Feb 2024 14:53:13 -0500 Subject: [PATCH] popup window inside map --- .../app/components/GoogleMap.jsx | 9 +- coffee_and_coding/app/components/PopUp.jsx | 32 ++-- coffee_and_coding/app/page.jsx | 172 ++++++++++-------- 3 files changed, 122 insertions(+), 91 deletions(-) diff --git a/coffee_and_coding/app/components/GoogleMap.jsx b/coffee_and_coding/app/components/GoogleMap.jsx index 3582e25c..bfebc55b 100644 --- a/coffee_and_coding/app/components/GoogleMap.jsx +++ b/coffee_and_coding/app/components/GoogleMap.jsx @@ -1,5 +1,5 @@ -import React from 'react'; -import PropTypes from 'prop-types'; +import React from "react"; +import PropTypes from "prop-types"; export const GoogleMap = ({ searchValue }) => { return ( @@ -13,11 +13,10 @@ export const GoogleMap = ({ searchValue }) => { referrerPolicy="no-referrer-when-downgrade" src={`https://www.google.com/maps/embed/v1/search?key=${process.env.NEXT_PUBLIC_API_Key}&q=${searchValue}`} allowFullScreen - > - + > ); -} +}; GoogleMap.propTypes = { searchValue: PropTypes.string.isRequired, diff --git a/coffee_and_coding/app/components/PopUp.jsx b/coffee_and_coding/app/components/PopUp.jsx index 7c9baff4..6eb35a9d 100644 --- a/coffee_and_coding/app/components/PopUp.jsx +++ b/coffee_and_coding/app/components/PopUp.jsx @@ -1,18 +1,24 @@ "use client"; -import React, { useState } from 'react'; -import Box from '@mui/material/Box'; -import Switch from '@mui/material/Switch'; -import Paper from '@mui/material/Paper'; -import Slide from '@mui/material/Slide'; -import FormControlLabel from '@mui/material/FormControlLabel'; -import {sizing} from '@mui/system'; +import React, { useState } from "react"; +import Box from "@mui/material/Box"; +import Paper from "@mui/material/Paper"; +import { Typography } from "@mui/material"; +//https://mui.com/material-ui/transitions/ export const PopUp = () => { return ( -
- - + + + + Place Name + + + Ratings... + -
- ) -} \ No newline at end of file + + ); +}; diff --git a/coffee_and_coding/app/page.jsx b/coffee_and_coding/app/page.jsx index 4e981de3..186a684b 100644 --- a/coffee_and_coding/app/page.jsx +++ b/coffee_and_coding/app/page.jsx @@ -1,79 +1,105 @@ "use client"; -import React, { useState } from 'react'; -import Image from 'next/image'; -import Grid from '@mui/material/Grid'; -import Box from '@mui/material/Box'; -import { Search } from './components/Search.jsx'; -import { GoogleMap } from './components/GoogleMap.jsx'; -import { PopUp } from './components/PopUp.jsx'; +import React, { useState } from "react"; +import Image from "next/image"; +import Grid from "@mui/material/Grid"; +import Box from "@mui/material/Box"; +import { Search } from "./components/Search.jsx"; +import { GoogleMap } from "./components/GoogleMap.jsx"; +import { PopUp } from "./components/PopUp.jsx"; +import FormControlLabel from "@mui/material/FormControlLabel"; +import Switch from "@mui/material/Switch"; +import Slide from "@mui/material/Slide"; +import Fade from "@mui/material/Fade"; export default function Home() { - const [searchValue, setSearchValue] = useState("Atlanta, GA"); + const [searchValue, setSearchValue] = useState("Atlanta, GA"); - const handleEnterPress = (inputValue) => { - console.log(inputValue); - setSearchValue(inputValue); - }; - - return ( -
-
-

- Coffee and Coding - app/page.tsx -

-
- - By{" "} - Vercel Logo - -
-
+ const handleEnterPress = (inputValue) => { + setSearchValue(inputValue); + }; -
- Next.js Logo -
- - - - - - - - - - - - - - - - - -
- ); + const [checked, setChecked] = useState(false); + + const handleChange = () => { + setChecked((prev) => !prev); + }; + + return ( +
+
+

+ Coffee and Coding + app/page.jsx +

+
+ + By{" "} + Vercel Logo + +
+
+ +
+ Next.js Logo +
+ + + + + + + + + + } + label="Show from target" + /> + + + + + + + + + +
+ +
+
+
+
+
+
+
+ ); }