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