Skip to content

Commit

Permalink
added ton connect ui
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitindenis1 committed May 24, 2023
1 parent dbf69de commit 30a6e0b
Show file tree
Hide file tree
Showing 21 changed files with 209 additions and 917 deletions.
501 changes: 99 additions & 402 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@tanstack/react-query": "^4.13.0",
"@ton-community/contract-verifier-sdk": "^1.1.1",
"@ton-community/func-js": "^0.3.0",
"@ton-defi.org/ton-connection": "^0.8.1",
"@tonconnect/ui-react": "^1.0.0-beta.6",
"bn.js": "^5.2.1",
"buffer": "^6.0.3",
"file-saver": "^2.0.5",
Expand Down
6 changes: 0 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { NotificationTitle } from "./components/CompileOutput";
import { VerificationInfoBlock } from "./components/VerificationInfoBlock";
import { CenteringBox } from "./components/Common.styled";
import { useAddressHistory } from "./lib/useAddressHistory";
import { useWalletConnect } from "./lib/useWalletConnect";
import { LatestVerifiedContracts } from "./components/LatestVerifiedContracts";
import { useInitializeGetters } from "./lib/getter/useGetters";
import { TestnetBar } from "./components/TestnetBar";
Expand Down Expand Up @@ -63,11 +62,6 @@ function App() {
const headerSpacings = useMediaQuery(theme.breakpoints.down("lg"));
const isSmallScreen = useMediaQuery(theme.breakpoints.down("md"));
const showSkeleton = !error && isLoading && contractAddress;
const { restoreConnection } = useWalletConnect();

useEffect(() => {
restoreConnection();
}, []);

useAddressHistory();
useResetState();
Expand Down
65 changes: 0 additions & 65 deletions src/components/AdaptersList.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/AddSourcesBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import CompilerSettings from "./CompilerSettings";
import { CompileOutput } from "./CompileOutput";
import { Box, styled } from "@mui/system";
import { AppButton } from "./AppButton";
import { useWalletConnect } from "../lib/useWalletConnect";
import { WalletConnect } from "./WalletConnect";
import { SECTIONS, STEPS, usePublishStore } from "../lib/usePublishSteps";
import { CircularProgress, Fade } from "@mui/material";
import { AppNotification, NotificationType } from "./AppNotification";
import { useTonAddress } from "@tonconnect/ui-react";

const ContentBox = styled(Box)({
padding: "15px 24px",
});

export function AddSourcesBlock() {
const { walletAddress } = useWalletConnect();
const walletAddress = useTonAddress();
const { hasFiles } = useFileStore();
const { step, proceedToPublish, toggleSection, currentSection } = usePublishStore();
const { mutate, data, error, isLoading, compileStatus } = useSubmitSources();
Expand Down
86 changes: 0 additions & 86 deletions src/components/ConnectorPopup.tsx

This file was deleted.

21 changes: 17 additions & 4 deletions src/components/MobileMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Drawer, IconButton } from "@mui/material";
import { Drawer, IconButton, styled } from "@mui/material";
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
import { Box } from "@mui/system";
import { WalletConnect } from "./WalletConnect";
Expand All @@ -8,6 +8,7 @@ import github from "../assets/github-dark.svg";
import { AppLogo, GitLogo, LinkWrapper } from "./TopBar.styled";
import icon from "../assets/icon.svg";
import { useNavigatePreserveQuery } from "../lib/useNavigatePreserveQuery";
import { TonConnectButton } from "@tonconnect/ui-react";

interface MobileMenuProps {
closeMenu?: () => void;
Expand All @@ -34,9 +35,9 @@ export function MobileMenu({ closeMenu, showMenu }: MobileMenuProps) {
<Box
pt={2}
sx={{ flex: 1, display: "flex", flexDirection: "column", alignItems: "center" }}>
<Box sx={{ width: "150px" }}>
<WalletConnect />
</Box>
<div style={{ maxWidth: "250px" }} onClick={closeMenu}>
<StyledTonConnectButton />
</div>
<LinkWrapper href={githubLink} target="_blank">
<img src={github} alt="Github icon" width={20} height={20} />
<GitLogo>GitHub</GitLogo>
Expand All @@ -50,3 +51,15 @@ export function MobileMenu({ closeMenu, showMenu }: MobileMenuProps) {
</Drawer>
);
}

const StyledTonConnectButton = styled(TonConnectButton)(({ theme }) => ({
button: {
background: theme.palette.primary.main,
"*": { color: "white" },
svg: {
"*": {
stroke: "white",
},
},
},
}));
42 changes: 0 additions & 42 deletions src/components/QrConnector.tsx

This file was deleted.

17 changes: 15 additions & 2 deletions src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import {
TopBarHeading,
TopBarWrapper,
} from "./TopBar.styled";
import { IconButton, useMediaQuery, useTheme } from "@mui/material";
import { IconButton, styled, useMediaQuery, useTheme } from "@mui/material";
import MenuRoundedIcon from "@mui/icons-material/MenuRounded";
import { MobileMenu } from "./MobileMenu";
import { useNavigatePreserveQuery } from "../lib/useNavigatePreserveQuery";
import { TonConnectButton } from "@tonconnect/ui-react";

export function TopBar() {
const { pathname } = useLocation();
Expand Down Expand Up @@ -54,7 +55,7 @@ export function TopBar() {
</LinkWrapper>
<ContentColumn>
<CenteringBox mr={2}>
<WalletConnect />
<StyledTonConnectButton />
</CenteringBox>
<LinkWrapper href={githubLink} target="_blank">
<img src={github} alt="Github icon" width={20} height={20} />
Expand All @@ -73,3 +74,15 @@ export function TopBar() {
</TopBarWrapper>
);
}

const StyledTonConnectButton = styled(TonConnectButton)(({ theme }) => ({
button: {
background: theme.palette.primary.main,
"*": { color: "white" },
svg: {
"*": {
stroke: "white",
},
},
},
}));
47 changes: 0 additions & 47 deletions src/components/WalletConnect.styled.ts

This file was deleted.

Loading

0 comments on commit 30a6e0b

Please sign in to comment.