Compare commits
No commits in common. "add9cb471e4e5a161b012924cfe35056d8234921" and "90d629876be0767dc3f1e2f1baf3cbf15144b409" have entirely different histories.
add9cb471e
...
90d629876b
|
|
@ -0,0 +1,2 @@
|
||||||
|
VITE_API_BASE_URL=https://my-public-node-1.projscale.dev/api/v1
|
||||||
|
VITE_SENTRY_DSN=https://4ef061d22eee4876ad8bb313134ebf009ed96c9da98742289ff733a301fcd184@k1.hawk.so/0
|
||||||
|
|
@ -2,4 +2,4 @@
|
||||||
node_modules
|
node_modules
|
||||||
.DS_Store
|
.DS_Store
|
||||||
dist
|
dist
|
||||||
.env*
|
.env
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly VITE_SENTRY_DSN: string
|
readonly VITE_API_BASE_URL: string;
|
||||||
readonly VITE_API_BASE_URL: string
|
|
||||||
readonly MODE: 'development' | 'production'
|
|
||||||
readonly PROD: boolean
|
|
||||||
readonly DEV: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { useTonConnectUI } from "@tonconnect/ui-react";
|
||||||
|
|
||||||
import { Button } from "~/shared/ui/button";
|
import { Button } from "~/shared/ui/button";
|
||||||
import { useAuth } from "~/shared/services/auth";
|
import { useAuth } from "~/shared/services/auth";
|
||||||
import { Address } from "@ton/core";
|
|
||||||
|
|
||||||
type WelcomeStepProps = {
|
type WelcomeStepProps = {
|
||||||
nextStep(): void;
|
nextStep(): void;
|
||||||
|
|
@ -13,7 +12,7 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => {
|
||||||
const [tonConnectUI] = useTonConnectUI();
|
const [tonConnectUI] = useTonConnectUI();
|
||||||
const [isLoaded, setLoaded] = useState(false);
|
const [isLoaded, setLoaded] = useState(false);
|
||||||
const [isConnected, setIsConnected] = useState(tonConnectUI.connected);
|
const [isConnected, setIsConnected] = useState(tonConnectUI.connected);
|
||||||
const [address, setAddress] = useState('');
|
|
||||||
console.log("💩💩💩 enter WelcomeStep");
|
console.log("💩💩💩 enter WelcomeStep");
|
||||||
|
|
||||||
const auth = useAuth();
|
const auth = useAuth();
|
||||||
|
|
@ -34,16 +33,6 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => {
|
||||||
};
|
};
|
||||||
}, [tonConnectUI]);
|
}, [tonConnectUI]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if(tonConnectUI.account){
|
|
||||||
setAddress(Address.parse(tonConnectUI.account?.address).toString({
|
|
||||||
bounceable: false,
|
|
||||||
urlSafe: true,
|
|
||||||
testOnly: false,
|
|
||||||
}),)
|
|
||||||
}
|
|
||||||
}, [tonConnectUI.account]);
|
|
||||||
|
|
||||||
const handleNextClick = async () => {
|
const handleNextClick = async () => {
|
||||||
if (tonConnectUI.connected) {
|
if (tonConnectUI.connected) {
|
||||||
await auth.mutateAsync();
|
await auth.mutateAsync();
|
||||||
|
|
@ -133,8 +122,8 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => {
|
||||||
<>
|
<>
|
||||||
<div className={"mt-2"}>
|
<div className={"mt-2"}>
|
||||||
<p className={"text-sm"}>
|
<p className={"text-sm"}>
|
||||||
Вы зарегистрированы под кошельком: <br/>
|
Вы зарегистрированы под кошельком:
|
||||||
<span className={"font-bold"}>{address}</span>
|
<span className={"font-bold pl-1"}>{tonConnectUI.account?.address.slice(2, 9)}...{tonConnectUI.account?.address.slice(-4)}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ export const ErrorModal = ({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p className="mt-12">
|
<p className="mt-12">
|
||||||
<span className="font-bold">Ошибка запроса транзакции</span>
|
<span className="px-1 font-bold">Ошибка запроса транзакции</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="">
|
<p className="">
|
||||||
Не удалось отправить запрос на выполнение транзакции.
|
Не удалось отправить запрос на выполнение транзакции.
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,6 @@ export const ViewContentPage = () => {
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
{tonConnectUI.connected && (
|
|
||||||
<>
|
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
WebApp.openTelegramLink(`https://t.me/MY_UploaderRobot`);
|
WebApp.openTelegramLink(`https://t.me/MY_UploaderRobot`);
|
||||||
|
|
@ -143,15 +141,6 @@ export const ViewContentPage = () => {
|
||||||
className={"h-[48px] bg-darkred"}
|
className={"h-[48px] bg-darkred"}
|
||||||
label={`Загрузить свой контент`}
|
label={`Загрузить свой контент`}
|
||||||
/>
|
/>
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
tonConnectUI.disconnect();
|
|
||||||
}}
|
|
||||||
className={"h-[48px] bg-darkred mt-4"}
|
|
||||||
label={`Отключить кошелек`}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import {
|
||||||
useNavigationType,
|
useNavigationType,
|
||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: import.meta.env.VITE_SENTRY_DSN,
|
dsn: import.meta.env.VITE_SENTRY_DSN,
|
||||||
integrations: [
|
integrations: [
|
||||||
|
|
@ -21,23 +22,22 @@ Sentry.init({
|
||||||
}),
|
}),
|
||||||
Sentry.replayIntegration(),
|
Sentry.replayIntegration(),
|
||||||
],
|
],
|
||||||
enabled: import.meta.env.PROD, // Only enable in production
|
|
||||||
environment: import.meta.env.MODE, // Set the environment
|
|
||||||
// Set tracesSampleRate to 1.0 to capture 100%
|
// Set tracesSampleRate to 1.0 to capture 100%
|
||||||
// of transactions for tracing.
|
// of transactions for tracing.
|
||||||
// Learn more at
|
// Learn more at
|
||||||
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
|
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
|
||||||
tracesSampleRate: 0,
|
tracesSampleRate: 1.0,
|
||||||
|
|
||||||
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
|
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
|
||||||
tracePropagationTargets: [
|
tracePropagationTargets: [
|
||||||
// /^\//,
|
/^\//,
|
||||||
// new RegExp(`^${import.meta.env.VITE_API_BASE_URL}`),
|
new RegExp(`^${import.meta.env.VITE_API_BASE_URL}`),
|
||||||
],
|
],
|
||||||
// Capture Replay for 10% of all sessions,
|
// Capture Replay for 10% of all sessions,
|
||||||
// plus for 100% of sessions with an error
|
// plus for 100% of sessions with an error
|
||||||
// Learn more at
|
// Learn more at
|
||||||
// https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
|
// https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
|
||||||
replaysSessionSampleRate: 0,
|
replaysSessionSampleRate: 0.1,
|
||||||
replaysOnErrorSampleRate: 0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue