diff --git a/system-contract-dapp-playground/src/app/hedera/erc-20/page.tsx b/system-contract-dapp-playground/src/app/hedera/erc-20/page.tsx new file mode 100644 index 000000000..0d4186e67 --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/erc-20/page.tsx @@ -0,0 +1,27 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const ERC20 = () => { + return ( +
ERC20
+ ); +}; + +export default ERC20; diff --git a/system-contract-dapp-playground/src/app/hedera/erc-721/page.tsx b/system-contract-dapp-playground/src/app/hedera/erc-721/page.tsx new file mode 100644 index 000000000..212f7db48 --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/erc-721/page.tsx @@ -0,0 +1,27 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const ERC721 = () => { + return ( +
ERC721
+ ); +}; + +export default ERC721; diff --git a/system-contract-dapp-playground/src/app/hedera/exchange-rate-hip-475/page.tsx b/system-contract-dapp-playground/src/app/hedera/exchange-rate-hip-475/page.tsx new file mode 100644 index 000000000..7d487ce2a --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/exchange-rate-hip-475/page.tsx @@ -0,0 +1,27 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const HIP475 = () => { + return ( +
HIP475
+ ); +}; + +export default HIP475; diff --git a/system-contract-dapp-playground/src/app/hedera/hrc-719/page.tsx b/system-contract-dapp-playground/src/app/hedera/hrc-719/page.tsx new file mode 100644 index 000000000..bd8025b96 --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/hrc-719/page.tsx @@ -0,0 +1,27 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const HRC719 = () => { + return ( +
HRC719
+ ); +}; + +export default HRC719; diff --git a/system-contract-dapp-playground/src/app/hedera/hts-hip-206/page.tsx b/system-contract-dapp-playground/src/app/hedera/hts-hip-206/page.tsx new file mode 100644 index 000000000..36b176b71 --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/hts-hip-206/page.tsx @@ -0,0 +1,27 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const HTS206 = () => { + return ( +
HTS206
+ ); +}; + +export default HTS206; diff --git a/system-contract-dapp-playground/src/app/hedera/layout.tsx b/system-contract-dapp-playground/src/app/hedera/layout.tsx new file mode 100644 index 000000000..032e415d4 --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/layout.tsx @@ -0,0 +1,46 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import Navbar from '@/components/navbar'; +import Footer from '@/components/footer'; +import LeftSideBar from '@/components/leftSideBar'; + +export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( +
+ +
+ {/* */} +
+ +
+ {/*
*/} +
{children}
+ + {/* */} +
+
+
+
+ +
+
+ ); +} diff --git a/system-contract-dapp-playground/src/app/(protected)/overview/page.tsx b/system-contract-dapp-playground/src/app/hedera/overview/page.tsx similarity index 83% rename from system-contract-dapp-playground/src/app/(protected)/overview/page.tsx rename to system-contract-dapp-playground/src/app/hedera/overview/page.tsx index 83af50940..72a6ea860 100644 --- a/system-contract-dapp-playground/src/app/(protected)/overview/page.tsx +++ b/system-contract-dapp-playground/src/app/hedera/overview/page.tsx @@ -18,12 +18,10 @@ * */ +import OverviewSection from '@/sections/overview'; + const Overview = () => { - return ( -
- Overview -
- ); + return ; }; export default Overview; diff --git a/system-contract-dapp-playground/src/app/hedera/prng-hip-351/page.tsx b/system-contract-dapp-playground/src/app/hedera/prng-hip-351/page.tsx new file mode 100644 index 000000000..57a19c699 --- /dev/null +++ b/system-contract-dapp-playground/src/app/hedera/prng-hip-351/page.tsx @@ -0,0 +1,27 @@ +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +const HIP351 = () => { + return ( +
HIP351
+ ); +}; + +export default HIP351; diff --git a/system-contract-dapp-playground/src/app/layout.tsx b/system-contract-dapp-playground/src/app/layout.tsx index 4a66857e5..47b8fcf6f 100644 --- a/system-contract-dapp-playground/src/app/layout.tsx +++ b/system-contract-dapp-playground/src/app/layout.tsx @@ -20,8 +20,6 @@ import '@/styles/globals.css'; import StyreneAWebFont from '@/fonts'; -import Navbar from '@/components/navbar'; -import Footer from '@/components/footer'; import dappMetadata from '@/utils/metadata'; import ChakraUIProviders from '@/libs/chakra/provider'; import BgGradient from '@/components/background-gradients'; @@ -30,18 +28,12 @@ import BgGradient from '@/components/background-gradients'; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - + -
-
-
- - {children} -
-
- -
-
+
+ {children} + +
diff --git a/system-contract-dapp-playground/src/app/page.tsx b/system-contract-dapp-playground/src/app/page.tsx index 95daf2272..b6a0f9c0f 100644 --- a/system-contract-dapp-playground/src/app/page.tsx +++ b/system-contract-dapp-playground/src/app/page.tsx @@ -17,8 +17,16 @@ * limitations under the License. * */ +import Footer from '@/components/footer'; +import Navbar from '@/components/navbar'; import LandingPage from '@/sections/landing'; export default function Home() { - return ; + return ( +
+ + ; +
+
+ ); } diff --git a/system-contract-dapp-playground/src/components/background-gradients/index.tsx b/system-contract-dapp-playground/src/components/background-gradients/index.tsx index 9418432de..78894e42b 100644 --- a/system-contract-dapp-playground/src/components/background-gradients/index.tsx +++ b/system-contract-dapp-playground/src/components/background-gradients/index.tsx @@ -21,10 +21,10 @@ const BgGradient = () => { return (
-
-
-
-
+
+
+
+
); }; diff --git a/system-contract-dapp-playground/src/components/footer/index.tsx b/system-contract-dapp-playground/src/components/footer/index.tsx index efef1502d..58b2e9679 100644 --- a/system-contract-dapp-playground/src/components/footer/index.tsx +++ b/system-contract-dapp-playground/src/components/footer/index.tsx @@ -31,14 +31,16 @@ const Footer = () => { initial={{ opacity: 0 }} whileInView={{ opacity: 1 }} transition={{ - delay: 0.6, - duration: 0.6, + delay: 0.3, + duration: 0.3, }} - className="text-white px-6 w-full z-40 sm:px-16 md:px-24" + viewport={{ once: true }} + className="text-white px-6 w-full z-40 flex flex-col items-center" > +
{/* Logo & copyright*/}
diff --git a/system-contract-dapp-playground/src/components/leftSideBar/index.tsx b/system-contract-dapp-playground/src/components/leftSideBar/index.tsx new file mode 100644 index 000000000..d16a6f02f --- /dev/null +++ b/system-contract-dapp-playground/src/components/leftSideBar/index.tsx @@ -0,0 +1,57 @@ +'use client'; + +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import Link from 'next/link'; +import { motion } from 'framer-motion'; +import { usePathname } from 'next/navigation'; +import { LEFT_SIDE_BAR_ITEMS } from '@/utils/constants'; + +const LeftSideBar = () => { + const pathname = usePathname(); + + return ( + + {LEFT_SIDE_BAR_ITEMS.map((item) => ( + + {item.name} + + ))} + + ); +}; + +export default LeftSideBar; diff --git a/system-contract-dapp-playground/src/components/navbar/index.tsx b/system-contract-dapp-playground/src/components/navbar/index.tsx index fead05791..1e050ca33 100644 --- a/system-contract-dapp-playground/src/components/navbar/index.tsx +++ b/system-contract-dapp-playground/src/components/navbar/index.tsx @@ -73,14 +73,18 @@ const Navbar = () => { return ( {/* Protected Navbar */} {isConnected ? ( -
+
{/* Logo */} {
) : ( - <> + {/* Unprotected Navbar */} {/* Logo */} @@ -152,9 +162,11 @@ const Navbar = () => { {/* Text logo */}

Hedera

- +
)} + {isConnected &&
} + {didWalletPop && ( { return; } - // navigate user to /overview - router.push('/overview'); + // navigate user to /hedera/overview + router.push('/hedera/overview'); } })(); }, [accounts, router, toaster, walletProvider]); @@ -186,9 +186,9 @@ const LandingPage = () => { {/* signature */} Accelerate the future on Hedera diff --git a/system-contract-dapp-playground/src/sections/overview/index.tsx b/system-contract-dapp-playground/src/sections/overview/index.tsx new file mode 100644 index 000000000..10f4ba9e7 --- /dev/null +++ b/system-contract-dapp-playground/src/sections/overview/index.tsx @@ -0,0 +1,128 @@ +'use client'; +/*- + * + * Hedera Smart Contracts + * + * Copyright (C) 2023 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import Link from 'next/link'; +import { motion } from 'framer-motion'; +import { LEFT_SIDE_BAR_ITEMS } from '@/utils/constants'; + +const OverviewSection = () => { + return ( + + {/* top part */} +
+ {/* Overview */} +

Overview

+ + {/* Hedera Network */} +
+ {/* Title */} +
Hedera Network
+ + {/* content */} +
+ Hedera is a fully open source public distributed ledger that utilizes the fast, fair, + and secure hashgraph consensus. Its network services include Solidity-based smart + contracts, as well as native tokenization and consensus services used to build + decentralized applications. Learn more about{' '} + + Hedera network + + ! +
+
+ + {/* Hedera Smart Contract Library */} +
+ {/* title */} +
Hedera Smart Contract Library
+ {/* content */} +
+ Seamlessly scale your projects using Solidity smart contracts on Hedera, taking + advantage of its unparalleled efficiency. Curious to explore the inner workings of smart + contracts hosted on Dapp Playground? The source code for{' '} + + Hedera smart contract library + {' '} + is readily available on Github, awaiting your delve into its intricacies. +
+
+
+ + {/* break line */} +
+ + {/* bottom part */} +
+ {/* DApp Playground */} +
+ {/* title */} +

DApp Playground

+ {/* content */} +
+ An intuitively designed interface aimed at highlighting the capabilities of Hedera + Network's system contracts. This revolutionary platform empowers developers to + effortlessly deploy and engage with illustrative system contracts, simplifying the task + of constructing and resolving issues within decentralized applications. +
+
+ + {/* buttons */} +
+
+ Here are the contracts exposed on this platform: +
+ +
+ {LEFT_SIDE_BAR_ITEMS.slice(1).map((item) => ( + + {' '} + {item.name} + + ))} +
+
+
+
+ ); +}; + +export default OverviewSection; diff --git a/system-contract-dapp-playground/src/styles/globals.css b/system-contract-dapp-playground/src/styles/globals.css index 718b8a24a..0bbb0f1c2 100644 --- a/system-contract-dapp-playground/src/styles/globals.css +++ b/system-contract-dapp-playground/src/styles/globals.css @@ -29,11 +29,12 @@ } .gradient-04 { + position: absolute; + width: 25rem; + height: 9rem; + left: 37%; + bottom: 0; border-radius: 64.7425rem; background: #7aebfb; filter: blur(230px); - width: 44.7425rem; - height: 34.60719rem; - transform: rotate(-160.325deg); - flex-shrink: 0; } diff --git a/system-contract-dapp-playground/src/utils/constants.ts b/system-contract-dapp-playground/src/utils/constants.ts index 0547a9e56..3f2c3e521 100644 --- a/system-contract-dapp-playground/src/utils/constants.ts +++ b/system-contract-dapp-playground/src/utils/constants.ts @@ -111,14 +111,48 @@ export const HEDERA_NETWORKS = { * @notice information about protected routes */ export const PROTECTED_ROUTES = [ - '/overview', - '/hts-hip-206', - '/hrc-719', - '/exchange-rate-hip-206', - '/prng-hip-351', - '/erc-20', - '/erc-721', + '/hedera/overview', + '/hedera/hts-hip-206', + '/hedera/hrc-719', + '/hedera/exchange-rate-hip-475', + '/hedera/prng-hip-351', + '/hedera/erc-20', + '/hedera/erc-721', ]; /** @notice hashcan baseURL */ export const HASHSCAN_BASE_URL = 'https://hashscan.io'; + +/** + * @notice information for LeftSideBar items + */ +export const LEFT_SIDE_BAR_ITEMS = [ + { + name: 'Overview', + path: PROTECTED_ROUTES[0], + }, + { + name: 'HTS system contract wrapper (HIP-206)', + path: PROTECTED_ROUTES[1], + }, + { + name: 'Token associate (HIP-719 / HRC-719)', + path: PROTECTED_ROUTES[2], + }, + { + name: 'Exchange rate system conract wrapper (Hip-475)', + path: PROTECTED_ROUTES[3], + }, + { + name: 'Pseudo random number system contract wrapper (HIP-351)', + path: PROTECTED_ROUTES[4], + }, + { + name: 'Fungible token (ERC-20)', + path: PROTECTED_ROUTES[5], + }, + { + name: 'Non-fungible token (ERC-721)', + path: PROTECTED_ROUTES[6], + }, +];