Skip to content

Commit

Permalink
Docs page
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjapotocin committed Oct 19, 2023
1 parent d68ab35 commit 42d8f0c
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 29 deletions.
18 changes: 16 additions & 2 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@ import Footer from "./Footer/Footer";
import Navbar from "./Navbar/Navbar";
import Search from "@components/Search/Search";
import SearchContextProvider from "./Search/Search.context";
import styled from "styled-components";
import { Source_Sans_Pro } from "next/font/google";

const font = Source_Sans_Pro({
style: "normal",
weight: ["400", "600", "700"],
subsets: ["latin"],
});

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
<StWrapper className={font.className}>
<SearchContextProvider>
<Navbar />
<main>{children}</main>
<Footer />
<Search />
</SearchContextProvider>
</>
</StWrapper>
);
}

const StWrapper = styled.div`
min-height: 100vh;
display: flex;
flex-direction: column;
`;
22 changes: 6 additions & 16 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,17 @@ import { ThemeProvider } from "styled-components";
import Layout from "../components/Layout";
import { GlobalStyle } from "../styles/GlobalStyles";
import { theme } from "../styles/theme";
import { Source_Sans_Pro } from "next/font/google";

const font = Source_Sans_Pro({
style: "normal",
weight: ["400", "600", "700"],
subsets: ["latin"],
});

export default function App({ Component, pageProps }: AppProps) {
return (
<ThemeProvider theme={theme}>
<GlobalStyle />

<div className={font.className}>
<Layout>
<Head>
<title>Orange Data Mining</title>
</Head>
<Component {...pageProps} />
</Layout>
</div>
<Layout>
<Head>
<title>Orange Data Mining</title>
</Head>
<Component {...pageProps} />
</Layout>
</ThemeProvider>
);
}
59 changes: 48 additions & 11 deletions pages/docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import fs from "fs";
import matter from "gray-matter";
import { serialize } from "next-mdx-remote/serialize";
import MdContent from "@components/MdContent/MdContent";
import MainLayout from "@components/UiKit/MainLayout";
import styled from "styled-components";
import device from "@styles/utils/breakpoints";

export async function getStaticProps() {
const mdFiles = getAllMdFilesInDir(path.join("public", "docs"));
Expand Down Expand Up @@ -41,19 +44,53 @@ export async function getStaticProps() {
};
}

export default function Docs({ sections, index }: { sections: any[]; index: any }) {
export default function Docs({
sections,
index,
}: {
sections: any[];
index: any;
}) {
return (
<Adapt $mt>
<h1>{index.title}</h1>

{sections.map(({ title, mdxSource, image }) => (
<React.Fragment key={title}>
<h2>{title}</h2>
<MdContent key={title} content={mdxSource} />
</React.Fragment>
))}
<MainLayout title={index.title}>
<StSectionsWrapper>
{sections.map(({ title, mdxSource }) => (
<div key={title}>
<h2>{title}</h2>
<MdContent key={title} content={mdxSource} />
</div>
))}
</StSectionsWrapper>

<MdContent content={index.mdxSource} />
</Adapt>
</MainLayout>
);
}

const StSectionsWrapper = styled.div`
padding: 0 30px;
max-width: 1000px;
margin: 80px auto;
display: flex;
justify-content: space-between;
column-gap: 40px;
row-gap: 60px;
flex-wrap: wrap;
h2 {
font-size: 24px;
font-weight: 600;
margin-bottom: 20px;
}
a {
font-size: 18px;
font-weight: 600;
display: block;
width: fit-content;
}
a + a {
margin-top: 10px;
}
`;
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions styles/GlobalStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const GlobalStyle = createGlobalStyle`
main {
padding-top: 80px;
flex: 1;
}
ol, ul {
Expand Down

1 comment on commit 42d8f0c

@vercel
Copy link

@vercel vercel bot commented on 42d8f0c Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

orange-web2 – ./

orange-web2-biolab.vercel.app
orange-web2-git-main-biolab.vercel.app
orange-web2.vercel.app

Please sign in to comment.