-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathApp.tsx
More file actions
116 lines (101 loc) · 2.96 KB
/
App.tsx
File metadata and controls
116 lines (101 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import React, { useState } from "react";
import { createGlobalStyle, ThemeProvider } from "styled-components";
import "./styles/fonts.css";
import EncodedSection from "./sections/EncodedSection";
import TrustedBySection from "./sections/TrustedBySection";
import InfoSection from "./sections/InfoSection";
import Footer from "./components/Footer";
import Header from "./components/Header";
import { common } from "./constants/common";
import Layout from "./components/Layout";
import Hero from "./components/Hero";
import SettingsSection from "./sections/SettingsSection";
import DescriptionSection from "./sections/DescriptionSection";
import OtherServices from "./sections/OtherServices";
import Contacts from "./sections/Contacts";
import { otherServices } from "./constants/otherServices";
import { light, dark } from './styles/themes';
import useLocalStorage from "./hooks/useLocalStorage";
const GlobalStyles = createGlobalStyle`
html,
body {
height: 100%;
margin: 0;
padding: 0;
font-family: 'Avenir', sans-serif;
background: ${({ theme }) => theme.bgDarkColor};
}
#__next {
display: flex;
flex-direction: column;
min-height: 100%;
}
main {
flex-grow: 1;
transition: all 0.03s linear;
background: ${({ theme }) => theme.bgDarkColor};
color: ${({ theme }) => theme.textColor};
}
ul {
list-style: none;
margin: 0;
padding: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin: 0;
}
a {
text-decoration: none;
}
`;
function App() {
const [encdodedData, setEncodedData] = useState<string>("");
const [theme, setTheme] = useLocalStorage<string>(
'abiTheme',
'light'
);
const themeToggler = () => {
theme === 'light' ? setTheme('dark') : setTheme('light');
}
return (
<ThemeProvider theme={theme === 'light' ? light : dark}>
<Header common={common} />
<Layout>
<Hero
hero={{
title: "Online ABI Encoder",
summary:
"A free online service for encoding your Solidity contract functions and constructor arguments.",
}}
/>
<SettingsSection setEncodedData={setEncodedData} themeToggler={themeToggler} theme={theme} />
<EncodedSection value={encdodedData} />
<DescriptionSection common={common} />
<TrustedBySection />
<InfoSection />
<OtherServices
common={common}
title="Grow in the blockchain with us!"
buttonText="All services"
items={otherServices}
ourProductsLink={common?.productsHref}
/>
<Contacts
contacts={common?.contacts}
telegramLink={common?.telegramChatLink}
emailLink={common?.socialEmailLink}
mode="light"
/>
</Layout>
<Footer common={common} />
<GlobalStyles />
</ThemeProvider>
);
}
export default App;