diff --git a/src/components/BlurringSubstrate/styles.module.css b/src/components/BlurringSubstrate/styles.module.css index 9455b1a..fba2a60 100644 --- a/src/components/BlurringSubstrate/styles.module.css +++ b/src/components/BlurringSubstrate/styles.module.css @@ -1,6 +1,8 @@ .blurring-substrate { + -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); width: fit-content; + height: fit-content; padding: 8px; box-shadow: inset 0px 0px 25px rgba(0,0,0,0.5); border-radius: 18px; diff --git a/src/components/CompatResultPage/styles.module.css b/src/components/CompatResultPage/styles.module.css index 9958151..6ace156 100644 --- a/src/components/CompatResultPage/styles.module.css +++ b/src/components/CompatResultPage/styles.module.css @@ -5,6 +5,7 @@ max-height: -webkit-fill-available; background-color: #000; color: #fff; + overflow-y: scroll; } .title-container { diff --git a/src/components/HomePage/index.tsx b/src/components/HomePage/index.tsx index 3062b92..ad93d59 100644 --- a/src/components/HomePage/index.tsx +++ b/src/components/HomePage/index.tsx @@ -8,6 +8,10 @@ import { useCallback, useEffect, useState } from "react"; import BlurringSubstrate from "../BlurringSubstrate"; import EnergyValues from "../EnergyValues"; import { UserAura } from "@/api/resources/Auras"; +import { useSelector } from "react-redux"; +import { getCategoryIdByZodiacSign, getZodiacSignByDate } from "@/services/zodiac-sign"; +import { selectors } from "@/store"; +import { getRandomArbitrary } from "@/services/random-value"; const buttonTextFormatter = (text: string): JSX.Element => { const sentences = text.split("."); @@ -32,17 +36,17 @@ function HomePage(): JSX.Element { navigate(routes.client.breath()); }; -// const { i18n } = useTranslation(); -// const locale = i18n.language; -// const birthdate = useSelector(selectors.selectBirthdate); -// const zodiacSign = getZodiacSignByDate(birthdate); + const { i18n } = useTranslation(); + const locale = i18n.language; + const birthdate = useSelector(selectors.selectBirthdate); + const zodiacSign = getZodiacSignByDate(birthdate); const [asset, setAsset] = useState(); const api = useApi(); const assetsData = useCallback(async () => { - // const { asset_categories } = await api.getAssetCategories({ locale }); - // const categoryId = getCategoryIdByZodiacSign(zodiacSign, asset_categories); - const { assets } = await api.getAssets({ category: String("10" || "1") }); + const { asset_categories } = await api.getAssetCategories({ locale }); + const categoryId = getCategoryIdByZodiacSign(zodiacSign, asset_categories); + const { assets } = await api.getAssets({ category: String(categoryId || "1") }); return assets; }, [api]); @@ -53,7 +57,7 @@ function HomePage(): JSX.Element { useEffect(() => { if (assets) { - setAsset(assets[13]); + setAsset(assets[getRandomArbitrary(0, assets?.length || 0)]); } }, [assets]); diff --git a/src/components/PriceItem/index.tsx b/src/components/PriceItem/index.tsx index 9279bb9..9d64cd1 100644 --- a/src/components/PriceItem/index.tsx +++ b/src/components/PriceItem/index.tsx @@ -1,45 +1,52 @@ -import { Currency, Locale, Price } from '../PaymentTable' -import { IPrice } from '../PriceList' -import styles from './styles.module.css' +import { Currency, Locale, Price } from "../PaymentTable"; +import { IPrice } from "../PriceList"; +import styles from "./styles.module.css"; -const currency = Currency.USD -const locale = Locale.EN +const currency = Currency.USD; +const locale = Locale.EN; const roundToWhole = (value: string | number): number => { - value = Number(value) - if (value % Math.floor(value) !== 0) { - return value - } - return Math.floor(value) -} + value = Number(value); + if (value % Math.floor(value) !== 0) { + return value; + } + return Math.floor(value); +}; const removeAfterDot = (value: string): string => { - const _value = Number(value.split('$')[1]) - if (_value % Math.floor(_value) !== 0 && _value !== 0) { - return value - } - return value.split('.')[0] -} + const _value = Number(value.split("$")[1]); + if (_value % Math.floor(_value) !== 0 && _value !== 0) { + return value; + } + return value.split(".")[0]; +}; interface PriceItemProps { - active: boolean - click: () => void + active: boolean; + click: () => void; } -function PriceItem({ id, value, active, click }: IPrice & PriceItemProps): JSX.Element { - const _price = new Price(roundToWhole(value), currency, locale) +function PriceItem({ + id, + value, + active, + click, +}: IPrice & PriceItemProps): JSX.Element { + const _price = new Price(roundToWhole(value), currency, locale); + console.log(id, active); + const compatClassName = () => { - const isPopular = id === 3 - const isActive = active - return `${styles.container} ${isPopular ? styles.popular : ''} ${isActive ? styles.active : ''}` - } + const isPopular = id === 3; + // const isActive = active; + return `${styles.container} ${isPopular ? styles.popular : ""}`; + }; return (
{removeAfterDot(_price.format())}
- ) + ); } -export default PriceItem +export default PriceItem;