From 0920798e9ee42aebf246b420890e6bf61812ee52 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 21 Sep 2023 15:48:50 -0700 Subject: [PATCH] started highlight first wednesday --- app/CalendarPage.jsx | 55 +++++++++++++++++++++++++++++++++++++++---- app/MainPage.jsx | 47 +++++++++++++++++++++++------------- app/WheelSpinPage.jsx | 8 ++++++- app/page.jsx | 2 +- 4 files changed, 89 insertions(+), 23 deletions(-) diff --git a/app/CalendarPage.jsx b/app/CalendarPage.jsx index b467e7e..cb92619 100644 --- a/app/CalendarPage.jsx +++ b/app/CalendarPage.jsx @@ -1,8 +1,8 @@ -import React from 'react' +import React, {useState} from 'react' import styled from '@emotion/styled' -import { Box, Container, Grid, Paper, Typography } from '@mui/material'; +import { Box, Container, Grid, Paper, Typography, Badge } from '@mui/material'; import { grey } from '@mui/material/colors'; -import { DateCalendar } from '@mui/x-date-pickers'; +import { DateCalendar, PickersDay } from '@mui/x-date-pickers'; const SuiteAndBTCGraphic = ( @@ -75,8 +75,45 @@ const CustomDiv = styled.div` `; +const isFirstWednesday = (dateStr) => { + // console.log(JSON.stringify(dateStr)) + let date = new Date(dateStr); + return date.getDay() === 3 && date.getDate() <= 7; +} + +const ServerDay = (props) => { + const { highlightedDays = [], day, outsideCurrentMonth, ...other } = props; + + const isSelected = !props.outsideCurrentMonth && isFirstWednesday(props.day.date()); + + return ( + + + + ); +} + + +/* + +The goal of the calendar is to be able to click on dates and have a popup that shows our meetup details. +1. Perhaps the modal is actually seperate and is just passed the dates from a click event? +*** 2. We also want to have the only badge be on the first wednesday of each month + - onMonthChange has been added. Need to get this info to the day components to render badge +3. Also need to change colors + +*/ const CalendarPage = () => { + + const [highlightedDays, setHighlightedDays] = useState([11,20,9]) + return ( @@ -87,7 +124,17 @@ const CalendarPage = () => { - + console.log(JSON.stringify(month))} + slotProps={{ + day: { + highlightedDays + } + }} + /> diff --git a/app/MainPage.jsx b/app/MainPage.jsx index 19e0bc7..6c478f5 100644 --- a/app/MainPage.jsx +++ b/app/MainPage.jsx @@ -1,12 +1,13 @@ import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; -import { Grid } from '@mui/material'; +import { Container, Grid, Typography } from '@mui/material'; import React from 'react' const CustomDiv = styled.div` background-color: ${(props) => props.theme.palette.primary.main}; - height: 140vh; - width: 100% + height: 1500px; + width: 100%; + display: flex; `; const CustomH1 = styled.h1` @@ -30,6 +31,8 @@ const CircleContainer = styled.div` justify-content: center; align-items: center; font-size: 24px; /* Replace with your desired font size */ + border-style: solid; + border-color: purple; `; const HorizontalLine = styled.div` @@ -40,21 +43,31 @@ const HorizontalLine = styled.div` function MainPage() { return ( - - - - Empowerment for those who need it most - - Bitcoin is a grassroots technology for communities to build lasting wealth + + + + + + + Empowerment for those who need it most + + + + + + Bitcoin is a grassroots technology for communities to build lasting wealth + + + + + + + + + + - - - - - - - / - + ); } diff --git a/app/WheelSpinPage.jsx b/app/WheelSpinPage.jsx index e82fe3a..e797246 100644 --- a/app/WheelSpinPage.jsx +++ b/app/WheelSpinPage.jsx @@ -20,10 +20,16 @@ const WheelSpinPage = () => { const [openSpinResult, setOpenSpinResult] = useState(false); const [winningIndex, setWinningIndex] = useState(0); + const [emailValue, setEmailValue] = useState(""); const wheelRef = useRef(); + const handleTextChange = (event) => { + setEmailValue(event.target.value); + } + const submitHandler = () => { + setEmailValue(""); wheelRef.current.spin(1000); } @@ -80,7 +86,7 @@ const WheelSpinPage = () => {

Join our mailing list to spin the wheel for a chance to win BTC!

- + diff --git a/app/page.jsx b/app/page.jsx index 841848b..02b00b7 100644 --- a/app/page.jsx +++ b/app/page.jsx @@ -42,7 +42,7 @@ const Home = () => { - + {/* */}