diff --git a/public/navbar-icons/Aura.png b/public/navbar-icons/Aura.png new file mode 100644 index 0000000..b836d79 Binary files /dev/null and b/public/navbar-icons/Aura.png differ diff --git a/public/navbar-icons/Breath.png b/public/navbar-icons/Breath.png new file mode 100644 index 0000000..0b41afb Binary files /dev/null and b/public/navbar-icons/Breath.png differ diff --git a/public/navbar-icons/Compatibility.png b/public/navbar-icons/Compatibility.png new file mode 100644 index 0000000..1a0639b Binary files /dev/null and b/public/navbar-icons/Compatibility.png differ diff --git a/public/navbar-icons/moon.png b/public/navbar-icons/moon.png new file mode 100644 index 0000000..04847fa Binary files /dev/null and b/public/navbar-icons/moon.png differ diff --git a/src/components/AttentionPage/index.tsx b/src/components/AttentionPage/index.tsx index d9d8091..1ffda06 100644 --- a/src/components/AttentionPage/index.tsx +++ b/src/components/AttentionPage/index.tsx @@ -5,7 +5,7 @@ import routes from '@/routes' import styles from './styles.module.css' // import CheckboxWithText from '../CheckboxWithText' import SpecialWelcomeOffer from '../SpecialWelcomeOffer' -import MainButton from '../MainButton' +// import MainButton from '../MainButton' interface AttentionPageProps { isOpenModal: boolean @@ -31,7 +31,7 @@ function AttentionPage({ isOpenModal, onCloseSpecialOffer }: AttentionPageProps)

{t('aura.warming_up.body')}

{/* */} - {t('aura.warming_up.button')} + {t('aura.warming_up.button')}
) diff --git a/src/components/AttentionPage/styles.module.css b/src/components/AttentionPage/styles.module.css index 355b4c9..e815fc1 100644 --- a/src/components/AttentionPage/styles.module.css +++ b/src/components/AttentionPage/styles.module.css @@ -23,5 +23,6 @@ } .button { - white-space: pre; -} \ No newline at end of file + white-space: pre; + cursor: pointer; +} diff --git a/src/components/Compatibility/DatePicker.css b/src/components/Compatibility/DatePicker.module.css similarity index 94% rename from src/components/Compatibility/DatePicker.css rename to src/components/Compatibility/DatePicker.module.css index 6376b7d..d898069 100644 --- a/src/components/Compatibility/DatePicker.css +++ b/src/components/Compatibility/DatePicker.module.css @@ -115,4 +115,8 @@ position: absolute; /* Position it absolutely for centering */ left: 50%; /* Center horizontally */ transform: translateX(-50%); /* Center horizontally */ + -ms-transform: translateX(-50%); + -webkit-transform: translateX(-50%); + -moz-transform: translateX(-50%); + -o-transform: translateX(-50%); } diff --git a/src/components/Compatibility/DatePicker.tsx b/src/components/Compatibility/DatePicker.tsx index 17639bb..1e96fe3 100644 --- a/src/components/Compatibility/DatePicker.tsx +++ b/src/components/Compatibility/DatePicker.tsx @@ -1,15 +1,22 @@ import React, { useEffect, useState } from "react"; -import "./DatePicker.css"; +import styles from "./DatePicker.module.css"; import DatePickerItem from "./DatePickerItem"; import { IDate, getDateAsString } from "@/services/date"; +import { useTranslation } from "react-i18next"; interface DatePickerProps { onDateChange: (selectedDate: string | IDate) => void; } -const DatePicker: React.FC = ({ onDateChange }) => { +const DatePicker: React.FC = ({ + onDateChange, +}) => { + const { i18n } = useTranslation(); + const locale = i18n.language; const currentDate = new Date(); - const [selectedDate, setSelectedDate] = useState(getDateAsString(currentDate)); + const [selectedDate, setSelectedDate] = useState( + getDateAsString(currentDate) + ); const days = Array.from({ length: 31 }, (_, index) => (index + 1).toString()); const months = Array.from({ length: 12 }, (_, index) => @@ -45,10 +52,10 @@ const DatePicker: React.FC = ({ onDateChange }) => { return ( <> -
+
@@ -56,19 +63,19 @@ const DatePicker: React.FC = ({ onDateChange }) => { data={months} selectedValue={new Date( 0, - new Date(getDateAsString(selectedDate)).getMonth() - ).toLocaleDateString(undefined, { month: "long" })} + new Date(getDateAsString(selectedDate).replace(/-/g, "/")).getMonth() + ).toLocaleDateString(locale, { month: "long" })} onSelect={handleMonthSelect} unit="month" />
-
+
{/* {selectedDate.toLocaleDateString("en-US", { year: "numeric", month: "long", diff --git a/src/components/Compatibility/DatePickerItem.tsx b/src/components/Compatibility/DatePickerItem.tsx index d11dab9..c5f4136 100644 --- a/src/components/Compatibility/DatePickerItem.tsx +++ b/src/components/Compatibility/DatePickerItem.tsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef, useState } from "react"; +import styles from "./DatePicker.module.css"; const ITEM_HEIGHT = 40; // Height of each date item @@ -23,8 +24,11 @@ const DatePickerItem: React.FC = ({ data, selectedValue, onSelect, - unit, + unit }) => { + console.log(selectedValue); + console.log(data); + const isMobile = useIsMobile(); const scrollRef = useRef(null); @@ -116,10 +120,10 @@ const DatePickerItem: React.FC = ({ // }, []); return ( -
-
+
+
= ({ ref={scrollRef} style={{ transform: `translateY(${translateY}px)`, + // msTransform: `translateY(${translateY}px)`, + WebkitTransform: `translateY(${translateY}px)`, }} > {data.map((item, index) => (
diff --git a/src/components/Compatibility/index.tsx b/src/components/Compatibility/index.tsx index 2855c3c..2980b75 100644 --- a/src/components/Compatibility/index.tsx +++ b/src/components/Compatibility/index.tsx @@ -69,9 +69,9 @@ function CompatibilityPage(): JSX.Element { return (
- + {/* <Title variant="h1" className={styles.title}> {t("compatibility")} - + */}
{t("iAm")} diff --git a/src/components/HomePage/index.tsx b/src/components/HomePage/index.tsx index 5de7066..c276ad0 100644 --- a/src/components/HomePage/index.tsx +++ b/src/components/HomePage/index.tsx @@ -62,26 +62,26 @@ function HomePage(): JSX.Element { { title: 'Breathing', path: routes.client.breath(), - image: '', + image: 'Breath.png', onClick: handleBreath }, { title: 'Aura', path: routes.client.home(), - image: '', + image: 'Aura.png', active: true, onClick: () => null }, { title: 'Compatibility', path: routes.client.compatibility(), - image: '', + image: 'Compatibility.png', onClick: handleCompatibility }, { title: 'My Moon', path: routes.client.home(), - image: '', + image: 'moon.png', onClick: () => null } ] @@ -136,7 +136,7 @@ function HomePage(): JSX.Element { const downloadImg = () => { if (!asset) return; - download(asset.url.replace("http://", "https://"), "image.png"); + download(asset.url.replace("http://", "https://"), asset.asset_data.metadata.filename || "image.png"); }; return ( diff --git a/src/components/HomePage/styles.module.css b/src/components/HomePage/styles.module.css index d1453d2..18f457f 100644 --- a/src/components/HomePage/styles.module.css +++ b/src/components/HomePage/styles.module.css @@ -10,7 +10,7 @@ background-size: calc(100% + 186px); background-position: center; background-repeat: no-repeat; - padding: 16px 12px 0; + padding: 16px 12px 94px; overflow-y: scroll; } diff --git a/src/components/NavbarHome/index.tsx b/src/components/NavbarHome/index.tsx index 2858018..81070d9 100644 --- a/src/components/NavbarHome/index.tsx +++ b/src/components/NavbarHome/index.tsx @@ -1,33 +1,46 @@ -import { Link } from 'react-router-dom' -import styles from './styles.module.css' +import { Link } from "react-router-dom"; +import styles from "./styles.module.css"; export interface INavbarHomeItems { - title: string - path: string - image: string - active?: boolean - onClick?: () => void + title: string; + path: string; + image: string; + active?: boolean; + onClick?: () => void; } interface INavbarHomeProps { - items: INavbarHomeItems[] + items: INavbarHomeItems[]; } -function NavbarHome({items}: INavbarHomeProps): JSX.Element { - - +function NavbarHome({ items }: INavbarHomeProps): JSX.Element { return ( - <div className={`${styles['container']}`}> + <div className={`${styles["container"]}`}> {items.map((item, index) => ( - <div className={`${styles['navbar-item']} ${item.active ? styles['navbar-item--active'] : ''}`} key={index}> - <Link to={item.path} onClick={item.onClick}> - {/* <img src={item.image} alt={item.title} /> */} - <p>{item.title}</p> - </Link> - </div> + <div + className={`${styles["navbar-item"]} ${ + item.active ? styles["navbar-item--active"] : "" + }`} + key={index} + > + <Link + className={styles["navbar-item__link"]} + to={item.path} + onClick={item.onClick} + > + <div className={styles["navbar-item__image-container"]}> + <img + className={styles["navbar-item__image"]} + src={`./navbar-icons/${item.image}`} + alt={item.title} + /> + </div> + <p>{item.title}</p> + </Link> + </div> ))} </div> - ) + ); } -export default NavbarHome +export default NavbarHome; diff --git a/src/components/NavbarHome/styles.module.css b/src/components/NavbarHome/styles.module.css index b296e5e..c6463a6 100644 --- a/src/components/NavbarHome/styles.module.css +++ b/src/components/NavbarHome/styles.module.css @@ -1,23 +1,41 @@ .container { - width: 100vw; - max-width: 560px; - background-color: #232322; - padding: 12px 0; - display: flex; - flex-direction: row; - justify-content: space-evenly; - position: fixed; - bottom: 0; + width: 100vw; + max-width: 560px; + background-color: #232322; + padding: 12px 0; + display: flex; + flex-direction: row; + justify-content: space-evenly; + position: fixed; + bottom: 0; } .navbar-item { - font-size: 12px; - display: flex; - flex-direction: column; - justify-content: center; - color: #dedede; + font-size: 12px; + display: flex; + flex-direction: column; + justify-content: flex-end; + color: #dedede; +} + +.navbar-item__link { + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + height: 100%; } .navbar-item--active { - color: #f24058; -} \ No newline at end of file + color: #f24058; +} + +.navbar-item__image-container { + flex: 1; + display: flex; + align-items: center; +} + +.navbar-item__image { + width: 30px; +}