Skip to content

Commit

Permalink
Merge pull request #325 from vordgi/rd-324
Browse files Browse the repository at this point in the history
rd-324 implement different containers
  • Loading branch information
vordgi authored Oct 16, 2024
2 parents 4064601 + 5eff0b7 commit 205518c
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/robindoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "robindoc",
"version": "2.0.1",
"version": "2.1.0",
"description": "",
"main": "./lib/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
width: 100%;

@media screen and (width >= $lg) {
width: 220px;
padding: 0 12px;
max-height: calc(100vh - var(--header-height));
overflow: auto;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import "src/assets/_vars";

.r-blog-container {
min-height: calc(100vh - var(--header-height));
overflow-wrap: break-word;

@media screen and (width >= $lg) {
display: grid;
justify-content: space-between;
column-gap: 40px;
grid-template-areas: "breadcrumbs contents" "content contents" "pagination contents";
grid-template-columns: 760px 220px;
grid-template-rows: auto 1fr auto;
}
}
13 changes: 13 additions & 0 deletions packages/robindoc/src/components/elements/blog-container/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";

import { Container } from "@src/components/ui/container";

import "./blog-container.scss";

export const BlogContainer: React.FC<React.PropsWithChildren> = ({ children }) => {
return (
<Container component="main" className="r-blog-container">
{children}
</Container>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "src/assets/_vars";

.r-main {
.r-docs-container {
min-height: calc(100vh - var(--header-height));
overflow-wrap: break-word;

Expand All @@ -9,14 +9,14 @@
justify-content: center;
column-gap: 32px;
grid-template-areas: "sidebar breadcrumbs" "sidebar contents" "sidebar content" "sidebar pagination";
grid-template-columns: auto calc(100% - 248px);
grid-template-columns: 1fr calc(100% - 248px);
grid-template-rows: auto auto 1fr auto;
}

@media screen and (width >= $lg) {
column-gap: 40px;
grid-template-areas: "sidebar breadcrumbs contents" "sidebar content contents" "sidebar pagination contents";
grid-template-columns: auto 640px auto;
grid-template-columns: 1fr 640px 1fr;
grid-template-rows: auto 1fr auto;
}
}
13 changes: 13 additions & 0 deletions packages/robindoc/src/components/elements/docs-container/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";

import { Container } from "@src/components/ui/container";

import "./docs-container.scss";

export const DocsContainer: React.FC<React.PropsWithChildren> = ({ children }) => {
return (
<Container component="main" className="r-docs-container">
{children}
</Container>
);
};
13 changes: 0 additions & 13 deletions packages/robindoc/src/components/elements/main/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "src/assets/_vars";

.r-sidebar {
width: 220px;
grid-area: sidebar;

@media screen and (width < $sm) {
Expand Down
3 changes: 2 additions & 1 deletion packages/robindoc/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { initializeRobindoc } from "./core/utils/initialize-robindoc";
export { Header } from "./components/elements/header";
export { Footer } from "./components/elements/footer";
export { RobinProvider } from "./components/elements/robin-provider";
export { Main } from "./components/elements/main";
export { DocsContainer } from "./components/elements/docs-container";
export { BlogContainer } from "./components/elements/blog-container";
export { KeylinkToContent } from "./components/elements/keylink-to-content";
export { KeylinkToNavigation } from "./components/elements/keylink-to-navigation";
6 changes: 3 additions & 3 deletions site/src/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Metadata } from "next";
import { Main, KeylinkToNavigation } from 'robindoc';
import { DocsContainer, KeylinkToNavigation } from 'robindoc';

import { Sidebar } from "./robindoc";

Expand All @@ -13,11 +13,11 @@ export const metadata: Metadata = {

const DocsLayout = ({ children }: Readonly<{ children?: JSX.Element }>) => {
return (
<Main>
<DocsContainer>
<Sidebar />
{children}
<KeylinkToNavigation />
</Main>
</DocsContainer>
);
}

Expand Down
4 changes: 2 additions & 2 deletions site/src/app/docs/robindoc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initializeRobindoc } from "robindoc";

export const { Page, Sidebar, getPages, getMeta, getPageContent, getPageData } = initializeRobindoc(async () => ({
export const { Page, Sidebar, getPages, getMeta, getPageContent, getPageData } = initializeRobindoc({
configuration: {
// sourceRoot: 'https://github.com/vordgi/robindoc/tree/main/docs',
sourceRoot: '../docs',
Expand All @@ -20,4 +20,4 @@ export const { Page, Sidebar, getPages, getMeta, getPageContent, getPageData } =
},
"auto"
],
}));
});

0 comments on commit 205518c

Please sign in to comment.