Clone
This commit is contained in:
parent
055c3c575d
commit
dbc6ecdcc8
@ -12,7 +12,7 @@ import FullScreenModal from "../FullScreenModal";
|
|||||||
import CompatibilityLoading from "../CompatibilityLoading";
|
import CompatibilityLoading from "../CompatibilityLoading";
|
||||||
|
|
||||||
function CompatResultPage(): JSX.Element {
|
function CompatResultPage(): JSX.Element {
|
||||||
const token = useSelector(selectors.selectToken)
|
const token = useSelector(selectors.selectToken);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const api = useApi();
|
const api = useApi();
|
||||||
@ -60,8 +60,10 @@ function CompatResultPage(): JSX.Element {
|
|||||||
const aICompat = await api.getAiCompat(data);
|
const aICompat = await api.getAiCompat(data);
|
||||||
if (aICompat.compat.body_pending) {
|
if (aICompat.compat.body_pending) {
|
||||||
const loadAIRequest = async () => {
|
const loadAIRequest = async () => {
|
||||||
|
const id = aICompat.compat.body_check_path.split("/")[5].split(".")[0];
|
||||||
|
const url = `/api/v2/ai/requests/${id}.json`;
|
||||||
const aIRequest = await api.getAiRequest({
|
const aIRequest = await api.getAiRequest({
|
||||||
body_check_path: aICompat.compat.body_check_path,
|
body_check_path: url,
|
||||||
token,
|
token,
|
||||||
});
|
});
|
||||||
if (aIRequest.ai_request.state !== "ready") {
|
if (aIRequest.ai_request.state !== "ready") {
|
||||||
|
|||||||
@ -64,6 +64,8 @@ function HomePage(): JSX.Element {
|
|||||||
|
|
||||||
const compatibilities = useSelector(selectors.selectCompatibilities);
|
const compatibilities = useSelector(selectors.selectCompatibilities);
|
||||||
|
|
||||||
|
const user = useSelector(selectors.selectUser);
|
||||||
|
|
||||||
const [isShowOnboardingHome, setIsShowOnboardingHome] = useState(
|
const [isShowOnboardingHome, setIsShowOnboardingHome] = useState(
|
||||||
!onboardingConfigHome?.isShown
|
!onboardingConfigHome?.isShown
|
||||||
);
|
);
|
||||||
@ -336,7 +338,7 @@ function HomePage(): JSX.Element {
|
|||||||
<Slider>
|
<Slider>
|
||||||
{predictionMoonsPeriods.map((item, index) => (
|
{predictionMoonsPeriods.map((item, index) => (
|
||||||
<NameHoroscopeSlider
|
<NameHoroscopeSlider
|
||||||
data={{ ...item, name: "Victor Ershov" }}
|
data={{ ...item, name: user.username || "I Am" }}
|
||||||
key={index}
|
key={index}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleNameHoroscope(item);
|
handleNameHoroscope(item);
|
||||||
|
|||||||
@ -5,35 +5,34 @@ import styles from "./styles.module.css";
|
|||||||
const currency = Currency.USD;
|
const currency = Currency.USD;
|
||||||
const locale = Locale.EN;
|
const locale = Locale.EN;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface PriceItemProps {
|
interface PriceItemProps {
|
||||||
id: string,
|
id: string;
|
||||||
value: number,
|
value: number;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
click: (id: string) => void;
|
click: (id: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
function PriceItem({
|
function PriceItem({ id, value, active, click }: PriceItemProps): JSX.Element {
|
||||||
id,
|
const _price = new Price(
|
||||||
value,
|
roundToWhole(value === 1 ? 0.99 : value),
|
||||||
active,
|
currency,
|
||||||
click,
|
locale
|
||||||
}: PriceItemProps): JSX.Element {
|
);
|
||||||
const _price = new Price(roundToWhole(value), currency, locale);
|
|
||||||
|
|
||||||
const compatClassName = () => {
|
const compatClassName = () => {
|
||||||
const isPopular = id === 'stripe.7';
|
const isPopular = id === "stripe.7";
|
||||||
const isActive = active;
|
const isActive = active;
|
||||||
return `${styles.container} ${isPopular ? styles.popular : ""} ${isActive ? styles.active : ""}`;
|
return `${styles.container} ${isPopular ? styles.popular : ""} ${
|
||||||
|
isActive ? styles.active : ""
|
||||||
|
}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const itemClick = () => {
|
const itemClick = () => {
|
||||||
click(id);
|
click(id);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div onClick={itemClick} className={compatClassName()}>
|
<div onClick={itemClick} className={compatClassName()}>
|
||||||
{removeAfterDot(_price.format())}
|
{removeAfterDot(_price.format())}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -100,6 +100,13 @@ function SubscriptionPage(): JSX.Element {
|
|||||||
if (updatedUser?.user) {
|
if (updatedUser?.user) {
|
||||||
dispatch(actions.user.update(updatedUser.user));
|
dispatch(actions.user.update(updatedUser.user));
|
||||||
}
|
}
|
||||||
|
if (name) {
|
||||||
|
dispatch(
|
||||||
|
actions.user.update({
|
||||||
|
username: name,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
dispatch(actions.status.update("registred"));
|
dispatch(actions.status.update("registred"));
|
||||||
dispatch(
|
dispatch(
|
||||||
actions.payment.update({
|
actions.payment.update({
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { getClientLocale, getClientTimezone } from '../locales'
|
|||||||
|
|
||||||
const initialState: User.User = {
|
const initialState: User.User = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
username: null,
|
username: "I Am",
|
||||||
email: '',
|
email: '',
|
||||||
locale: getClientLocale(),
|
locale: getClientLocale(),
|
||||||
state: '',
|
state: '',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user