From ca1670d780b045eb3cc117d0a94fe82859bbe35f Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Tue, 2 Jul 2024 04:39:23 -0700 Subject: [PATCH 1/3] Moved buttons to right side and add minor stylings for choosing audio sources --- src/components/Meditation/Meditation.scss | 19 +++- src/pages/Meditation.js | 108 +++++++++++----------- 2 files changed, 74 insertions(+), 53 deletions(-) diff --git a/src/components/Meditation/Meditation.scss b/src/components/Meditation/Meditation.scss index 0980f1a..07ba3e1 100644 --- a/src/components/Meditation/Meditation.scss +++ b/src/components/Meditation/Meditation.scss @@ -12,7 +12,7 @@ h4 { font-size: 18px; font-weight: 300; - + &.text-selected { font-weight: bold; color: purple; @@ -33,6 +33,23 @@ } } + & .audio-source-buttons { + width: 80%; + height: 80%; + align-items: flex-end; + transition: + background-color 0.3s ease, + border-radius 0.3s ease; + background-color: #fdeafa; + border-radius: 20px; + padding-bottom: 10px; + + &:hover { + background-color: #e2e6ff; // Background color on hover + border-radius: 20px; // Border radius on hover + } + } + & .icons { justify-content: space-around; } diff --git a/src/pages/Meditation.js b/src/pages/Meditation.js index 2d46e39..ac01a1a 100644 --- a/src/pages/Meditation.js +++ b/src/pages/Meditation.js @@ -1,5 +1,5 @@ -import { Grid, GridItem, useDisclosure, Button, IconButton, Icon, Divider } from "@chakra-ui/react"; +import { Grid, GridItem, useDisclosure, Button, IconButton, Icon, Divider, Flex } from "@chakra-ui/react"; import { TiPlus } from "react-icons/ti"; import { CloudinaryContext, CloudinaryContextProvider } from "../context/CloudinaryContext"; import { useState, useRef, useContext, useEffect } from "react"; @@ -13,7 +13,7 @@ import axios from "axios"; import { useAuthContext } from "../hooks/useAuthContext"; import { AudioContext } from "../context/AudioContext"; import MeditationModal from "../components/Meditation/MeditationModal"; -import {StyledButton} from '../styles/components/StyledComponents' +import { StyledButton } from '../styles/components/StyledComponents' const Meditation = () => { const { user } = useAuthContext(); @@ -25,7 +25,7 @@ const Meditation = () => { onClose: onModalClose, } = useDisclosure(); const finalRef = useRef(null); - const {isOpen, onOpen, onClose} = useDisclosure(); + const { isOpen, onOpen, onClose } = useDisclosure(); const { displayedImage, @@ -64,9 +64,10 @@ const Meditation = () => { type: "CHOOSE_AUDIO", payload: res.data.meditationAudio, }); - spotifyDispatch({ + spotifyDispatch({ type: "SET_SPOTIFY_PLAYING_TRACK", - payload: res.data.music}) + payload: res.data.music + }) /// Update state of choosing audio for choosing spotify audioDispatch({ type: "CHOOSE_PLAY_AUDIO" }); @@ -111,66 +112,69 @@ const Meditation = () => {

Meditation

- {/* */} - + {/* */} +

Let's start your meditation! ☮️

- - -

setTab(false)}>Choose your own voices

+ + +

setTab(false)}>Choose your own voices

- -

setTab(true)}>Choose from Spotify

+ +

setTab(true)}>Choose from Spotify

- - {(!tab) && ( - - - } - onClick={onModalOpen} - variant='ghost' - fontSize='30px' - /> - : } - onClick={() => setIsFilter(!isFilter)} - variant='ghost' - fontSize='30px' - /> - - - - - - )} - - {(tab) && ( - - )} - - - - { - handleSave() - onOpen() - }}/> - - -
-
+ {(!tab) && ( + + + + + } + onClick={onModalOpen} + variant='ghost' + fontSize='30px' + /> + : } + onClick={() => setIsFilter(!isFilter)} + variant='ghost' + fontSize='30px' + /> + + + + + + + + )} + + {(tab) && ( + + )} + + + + { + handleSave() + onOpen() + }} /> + + + + { isOpen={isModalOpen} /> - + ); }; From 81b83033471ef9962e8ef4c664c151916d5f381e Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Tue, 2 Jul 2024 04:53:56 -0700 Subject: [PATCH 2/3] added some adjustments for button styling --- src/components/Meditation/Meditation.scss | 6 ++++-- src/styles/components/StyledComponents.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/Meditation/Meditation.scss b/src/components/Meditation/Meditation.scss index 07ba3e1..c2d5b9e 100644 --- a/src/components/Meditation/Meditation.scss +++ b/src/components/Meditation/Meditation.scss @@ -41,12 +41,12 @@ background-color 0.3s ease, border-radius 0.3s ease; background-color: #fdeafa; - border-radius: 20px; + border-radius: 25px; padding-bottom: 10px; &:hover { background-color: #e2e6ff; // Background color on hover - border-radius: 20px; // Border radius on hover + border-radius: 25px; // Border radius on hover } } @@ -69,6 +69,7 @@ .meditation-audios { padding: 20px; + } .meditation-box { @@ -78,4 +79,5 @@ background-color: white; padding: 20px; box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.1); + border-radius: 25px; } diff --git a/src/styles/components/StyledComponents.js b/src/styles/components/StyledComponents.js index 2578773..efd1643 100644 --- a/src/styles/components/StyledComponents.js +++ b/src/styles/components/StyledComponents.js @@ -19,6 +19,8 @@ const StyledButton = ({text, onClick=() => {}, icon=null, width=null}) => { _active={{ bg: '#d0aadf' }} leftIcon={icon} w={width} + borderRadius="20px" + px={8} > {text} @@ -31,7 +33,7 @@ const StyledBox = ({ onClick=() => {}, children=null, selected=false, className= w='100%' h='100%' p={2} - borderRadius={5} + borderRadius={25} className={`${className} ${selected ? "styled-box-selected" : ""}`} onClick={onClick}> {children} From 28a89648df4db7dd0cb616b88b1c50efaf043f60 Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Tue, 2 Jul 2024 06:22:36 -0700 Subject: [PATCH 3/3] adjusted padding --- src/pages/Meditation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Meditation.js b/src/pages/Meditation.js index ac01a1a..89a61bb 100644 --- a/src/pages/Meditation.js +++ b/src/pages/Meditation.js @@ -137,7 +137,7 @@ const Meditation = () => { - + }