diff --git a/src/pages/root/steps/royalty-step/index.tsx b/src/pages/root/steps/royalty-step/index.tsx index 2eb90ca..db0bf59 100644 --- a/src/pages/root/steps/royalty-step/index.tsx +++ b/src/pages/root/steps/royalty-step/index.tsx @@ -1,4 +1,4 @@ -import { useMemo, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { useHapticFeedback } from "@vkruglikov/react-telegram-web-app"; import { Input } from "~/shared/ui/input"; @@ -11,6 +11,7 @@ import { Spread } from "~/shared/ui/icons/spread.tsx"; import { ConfirmModal } from "~/pages/root/steps/royalty-step/components/confirm-modal"; import { useRootStore } from "~/shared/stores/root"; import { BackButton } from "~/shared/ui/back-button"; +import { useTonConnectUI } from "@tonconnect/ui-react"; type RoyaltyStepProps = { prevStep(): void; @@ -71,6 +72,16 @@ export const RoyaltyStep = ({ nextStep, prevStep }: RoyaltyStepProps) => { ); }, [royalty]); + const [tonConnectUI] = useTonConnectUI(); + + // Устанавливаем адрес из tonConnectUI.account при загрузке страницы + useEffect(() => { + console.log('tonconnectUI', tonConnectUI) + if (tonConnectUI.account) { + setRoyalty([{ address: tonConnectUI.account.address, value: 100 }]); + } + }, [tonConnectUI.account, setRoyalty]); + return (
{isPercentHintOpen && ( diff --git a/src/pages/view-content/index.tsx b/src/pages/view-content/index.tsx index 4f8eeeb..3808993 100644 --- a/src/pages/view-content/index.tsx +++ b/src/pages/view-content/index.tsx @@ -75,7 +75,7 @@ export const ViewContentPage = () => { return (
- {content?.data?.display_options?.metadata?.image && ( + {content?.data?.content_type.startsWith("audio") && content?.data?.display_options?.metadata?.image && (
{"content_image"} { playsinline={true} controls={true} width="100%" - config={{ file: { attributes: { playsInline: true, autoplay: true } }, }} + config={{ file: { attributes: { + playsInline: true, autoplay: true, + poster: content?.data?.display_options?.metadata?.image || undefined, + } }, }} url={content?.data?.display_options?.content_url} /> )} @@ -120,7 +123,7 @@ export const ViewContentPage = () => { onClick={() => { WebApp.openTelegramLink(`https://t.me/MY_UploaderRobot`); }} - className={"mb-4 mt-[30px] h-[48px]"} + className={"mb-4 mt-[-20px] h-[48px] bg-darkred"} label={`Загрузить свой контент`} />