laconic-wallet-web/src/index.tsx

145 lines
3.4 KiB
TypeScript
Raw Normal View History

2024-08-09 04:59:27 +00:00
import React from "react";
import ReactDOM from "react-dom/client";
import {
PaperProvider,
MD3DarkTheme as DefaultTheme,
} from "react-native-paper";
import { NavigationContainer, DarkTheme } from "@react-navigation/native";
import { Platform } from "react-native";
import { Buffer } from "buffer";
2024-08-09 04:59:27 +00:00
import "./index.css";
import App from "./App";
import { AccountsProvider } from "./context/AccountsContext";
import { NetworksProvider } from "./context/NetworksContext";
import reportWebVitals from "./reportWebVitals";
import { WalletConnectProvider } from "./context/WalletConnectContext";
import { createTheme, ThemeProvider } from "@mui/material";
globalThis.Buffer = Buffer;
const linking = {
2024-08-09 04:59:27 +00:00
prefixes: ["https://wallet.laconic.com"],
};
const theme = {
...DefaultTheme,
2024-08-09 04:59:27 +00:00
dark: true,
};
2024-08-09 04:59:27 +00:00
const navigationTheme: typeof DarkTheme = {
...DarkTheme,
colors: {
...DarkTheme.colors,
primary: "#0000F4",
background: "#0F0F0F",
card: "#18181A",
},
};
2024-08-09 17:19:21 +00:00
2024-08-09 04:59:27 +00:00
const muiTheme = createTheme({
2024-08-09 17:19:21 +00:00
components: {
2024-08-09 17:39:08 +00:00
MuiAccordion: {
defaultProps: {
sx: {
border: "1px solid #48474F",
borderBottomRightRadius: 3,
borderBottomLeftRadius: 3,
},
},
},
2024-08-09 17:19:21 +00:00
MuiButton: {
defaultProps: {
color: "primary",
sx: {
fontFamily: `DM Mono, monospace`,
fontWeight: 400,
},
},
},
MuiLink: {
defaultProps: {
color: "text.primary",
fontSize: "14px",
},
},
MuiTypography: {
defaultProps: {
2024-08-09 19:12:37 +00:00
color: "text.primary",
2024-08-09 17:19:21 +00:00
fontWeight: 400,
},
},
2024-08-09 17:54:48 +00:00
MuiPaper: {
defaultProps: {
sx: {
backgroundImage: "none",
},
},
},
2024-08-09 17:19:21 +00:00
},
2024-08-09 04:59:27 +00:00
palette: {
mode: "dark",
primary: {
main: "#0000F4",
},
2024-08-09 17:19:21 +00:00
secondary: {
main: "#A2A2FF",
},
error: {
main: "#B20710",
},
2024-08-09 17:39:08 +00:00
background: {
default: "#0F0F0F",
paper: "#18181A",
},
2024-08-09 19:12:37 +00:00
text: {
primary: "#FBFBFB",
},
info: {
main: "#FBFBFB",
},
2024-08-09 04:59:27 +00:00
},
});
const root = ReactDOM.createRoot(
2024-08-09 04:59:27 +00:00
document.getElementById("root") as HTMLElement,
);
root.render(
2024-08-09 04:59:27 +00:00
<div id="app">
<PaperProvider theme={theme}>
<NetworksProvider>
<AccountsProvider>
<WalletConnectProvider>
<NavigationContainer
linking={linking}
documentTitle={{
2024-08-09 21:16:48 +00:00
formatter: () => `Laconic | Wallet`,
2024-08-09 04:59:27 +00:00
}}
theme={navigationTheme}
>
<React.Fragment>
{Platform.OS === "web" ? (
<style type="text/css">{`
@font-face {
font-family: 'MaterialCommunityIcons';
2024-08-09 04:59:27 +00:00
src: url(${require("react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf")}) format('truetype');
}
`}</style>
2024-08-09 04:59:27 +00:00
) : null}
<ThemeProvider theme={muiTheme}>
<App />
</ThemeProvider>
</React.Fragment>
</NavigationContainer>
</WalletConnectProvider>
</AccountsProvider>
</NetworksProvider>
</PaperProvider>
</div>,
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();