Routes refactored

This commit is contained in:
2024-04-15 17:34:32 +05:30
parent 99c06d4845
commit 0e29b3037c
14 changed files with 157 additions and 131 deletions

View File

@@ -5,129 +5,19 @@ import {
createRoutesFromElements,
RouterProvider,
} from "react-router-dom";
import HomePage from "./pages/HomePage";
import NavBar from "./components/NavBar/NavBar";
import LearnPage from "./pages/LearnPage";
import BuildPage from "./pages/BuildPage";
import Community from "./pages/Community";
import Contact from "./pages/Contact";
import UseCases from "./pages/UseCases";
import ArticleInternalPage from "./components/ArticleInternalPage/ArticleInternalPage";
import NotFound from "./pages/NotFound";
import fintech from "../src/assets/images/usecase-bg.png";
import adTech from "../src/assets/images/addtech.jpg";
import martech from "../src/assets/images/martech.png";
import healthTech from "../src/assets/images/health-tech.png";
import { useCase } from "./data/useCase";
import ArticleInternalOne from "./components/ArticleInternalOne/ArticleInternalOne";
import ArticleInternalTwo from "./components/ArticleInternalTwo/ArticleInternalTwo";
import ArticleInternalThree from "./components/ArticleInternalThree/ArticleInternalThree";
import ArticleInternalFour from "./components/ArticleInternalFour/ArticleInternalFour";
import ArticleInternalfive from "./components/ArticleInternalfive/ArticleInternalfive";
import ArticleInternalSix from "./components/ArticleInternalSix/ArticleInternalSix";
import { route } from "./routes/_routes";
import DefaultLayout from "./Layout/DefaultLayout";
const router = createBrowserRouter(
createRoutesFromElements(
<Route path="/" element={<NavBar />}>
<Route index element={<HomePage />} />
<Route path="LearnPage" element={<LearnPage />} />
<Route path="BuildPage" element={<BuildPage />} />
<Route path="UseCases" element={<UseCases />} />
<Route path="community" element={<Community />} />
{/* <Route
path="Articles/the_proofchain_technical_whitepaper"
element={<ArticleInternalPage />}
/> */}
<Route
path="bring-your-own-blockspace"
element={<ArticleInternalOne />}
/>
<Route
path="rubix-the-sustainable-blockchain-solution-a-green-initiative"
element={<ArticleInternalTwo />}
/>
<Route
path="mining-rubix-tokens-what-you-need-to-know"
element={<ArticleInternalThree />}
/>
<Route
path="securing-wallet-to-wallet-transfers-across-the-network-rubix-solved-it-differently"
element={<ArticleInternalFour />}
/>
<Route
path="enterprise-blockchains-on-a-public-chain"
element={<ArticleInternalfive />}
/>
<Route
path="multichain-over-blockchain-a-reality-check-on-security-threat"
element={<ArticleInternalSix />}
/>
<Route path="Contact" element={<Contact />} />
<Route path="*" element={<NotFound />} />
<Route
path="fin-tech"
element={
<UseCases
bannerHeading={"FinTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={fintech}
useCase={useCase}
/>
}
/>
<Route
path="ad-tech"
element={
<UseCases
bannerHeading={"AdTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={adTech}
useCase={useCase}
/>
}
/>
<Route
path="mar-tech"
element={
<UseCases
bannerHeading={"MarTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={martech}
useCase={useCase}
/>
}
/>
<Route
path="health-tech"
element={
<UseCases
bannerHeading={"HealthTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={healthTech}
useCase={useCase}
/>
}
/>
</Route>
route.map(({ path, element }) => (
<Route key={path} path={path} element={<DefaultLayout>{element}</DefaultLayout>} />
))
)
);
function App() {
return (
<>
<RouterProvider router={router} />
</>
);
return <RouterProvider router={router} />;
}
export default App;

View File

@@ -0,0 +1,15 @@
import React from "react";
import NavBar from "../components/NavBar/NavBar";
import Footer from "../components/Footer/Footer";
const DefaultLayout = ({ children }) => {
return (
<div>
<NavBar />
{children}
<Footer />
</div>
);
};
export default DefaultLayout;

View File

@@ -264,7 +264,7 @@ const ArticleInternalFour = () => {
</Box>
</Box>
</Box>
<Footer />
</>
);
};

View File

@@ -310,7 +310,6 @@ const ArticleInternalOne = () => {
</Box>
</Box>
</Box>
<Footer />
</>
);
};

View File

@@ -345,7 +345,7 @@ const ArticleInternalSix = () => {
</Box>
</Box>
</Box>
<Footer />
</>
);
};

View File

@@ -243,7 +243,7 @@ const ArticleInternalThree = () => {
</Box>
</Box>
</Box>
<Footer />
</>
);
};

View File

@@ -426,7 +426,7 @@ const ArticleInternalTwo = () => {
</Box>
</Box>
</Box>
<Footer />
</>
);
};

View File

@@ -46,8 +46,7 @@ const ArticleInternalfive = () => {
textAlign={"center"}
className="rubix-text-heading-2 rubix-fw-600"
>
Securing wallet to wallet transfers across the network: Rubix solved
it differently
Enterprise blockchains on a Public Chain!
</Text>
<Text textAlign={"center"} className="rubix-text-xsmall rubix-fw-500">
@@ -226,7 +225,7 @@ const ArticleInternalfive = () => {
<img
style={{ backgroundColor: "#fff" }}
width={"100%"}
src="https://www.rubix.net/wp-content/uploads/independent-proofchains-of-tokens.png"
src="https://www.rubix.net/wp-content/uploads/multiple-quorum-validating-transactions.png"
/>
</Text>
<Text pb={5} fontSize="xl">
@@ -296,7 +295,7 @@ const ArticleInternalfive = () => {
</Box>
</Box>
</Box>
<Footer />
</>
);
};

View File

@@ -20,7 +20,6 @@ const BuildPage = () => {
<Tools />
<Connect />
<LearnMore />
<Footer />
</>
);
};

View File

@@ -41,7 +41,6 @@ const Community = () => {
{/* <Happen />
<Insights /> */}
<LearnMore />
<Footer />
</>
);
};

View File

@@ -10,7 +10,6 @@ const Contact = () => {
return (
<>
<Form />
<Footer />
</>
);
};

View File

@@ -46,8 +46,6 @@ const HomePage = () => {
{!isMobile ? <Partner /> : <PartnerMobile />}
{/* <Client /> */}
{!isMobile ? <Resources /> : <ResourcesMobile />}
<Footer />
</>
);
};

View File

@@ -22,7 +22,6 @@ const UseCases = ({
bannerImage={bannerImage}
useCase={useCase}
/>
<Footer />
</>
);
};

129
src/routes/_routes.jsx Normal file
View File

@@ -0,0 +1,129 @@
import ArticleInternalFour from "../components/ArticleInternalFour/ArticleInternalFour";
import ArticleInternalOne from "../components/ArticleInternalOne/ArticleInternalOne";
import ArticleInternalSix from "../components/ArticleInternalSix/ArticleInternalSix";
import ArticleInternalThree from "../components/ArticleInternalThree/ArticleInternalThree";
import ArticleInternalTwo from "../components/ArticleInternalTwo/ArticleInternalTwo";
import ArticleInternalfive from "../components/ArticleInternalfive/ArticleInternalfive";
import { useCase } from "../data/useCase";
import BuildPage from "../pages/BuildPage";
import Community from "../pages/Community";
import HomePage from "../pages/HomePage";
import LearnPage from "../pages/LearnPage";
import NotFound from "../pages/NotFound";
import UseCases from "../pages/UseCases";
import fintech from "../assets/images/usecase-bg.png";
import adTech from "../assets/images/addtech.jpg";
import martech from "../assets/images/martech.png";
import healthTech from "../assets/images/health-tech.png";
import Form from "../components/Contact/Form";
import UseCase from "../components/UseCase/UseCase";
export const route = [
{
path: "/",
element: <HomePage />,
},
{
path: "LearnPage",
element: <LearnPage />,
},
{
path: "BuildPage",
element: <BuildPage />,
},
{
path: "UseCases",
element: <UseCases />,
},
{
path: "community",
element: <Community />,
},
{
path: "bring-your-own-blockspace",
element: <ArticleInternalOne />,
},
{
path: "rubix-the-sustainable-blockchain-solution-a-green-initiative",
element: <ArticleInternalTwo />,
},
{
path: "mining-rubix-tokens-what-you-need-to-know",
element: <ArticleInternalThree />,
},
{
path: "securing-wallet-to-wallet-transfers-across-the-network-rubix-solved-it-differently",
element: <ArticleInternalFour />,
},
{
path: "enterprise-blockchains-on-a-public-chain",
element: <ArticleInternalfive />,
},
{
path: "multichain-over-blockchain-a-reality-check-on-security-threat",
element: <ArticleInternalSix />,
},
{
path: "Contact",
element: <Form />,
},
{
path: "*",
element: <NotFound />,
},
{
path: "fin-tech",
element: (
<UseCase
bannerHeading={"FinTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={fintech}
useCase={useCase}
/>
),
},
{
path: "ad-tech",
element: (
<UseCase
bannerHeading={"AdTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={adTech}
useCase={useCase}
/>
),
},
{
path: "mar-tech",
element: (
<UseCase
bannerHeading={"MarTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={martech}
useCase={useCase}
/>
),
},
{
path: "health-tech",
element: (
<UseCase
bannerHeading={"HealthTech"}
bannerSubHeading={
"Stay up to date on whats happening with Rubix, learn about upcoming events and access important resources."
}
bannerImage={healthTech}
useCase={useCase}
/>
),
},
];