Skip to content

Commit 7b43bac

Browse files
committed
Add components
1 parent cb37bab commit 7b43bac

File tree

13 files changed

+136
-46
lines changed

13 files changed

+136
-46
lines changed

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": false,
4+
"bracketSameLine": true,
5+
"printWidth": 80,
6+
"proseWrap": "never",
7+
"singleQuote": true,
8+
"trailingComma": "all"
9+
}

docs/create-diagram.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import ThemedImage from '../src/components/ThemedImage';
2+
3+
# Create a diagram
4+
5+
You can create custom diagrams for MySQL, PostgreSQL, SQLite, MariaDB, or SQL Server.
6+
7+
<ThemedImage
8+
lightImageSrc="/img/logo.png"
9+
darkImageSrc="/img/docusaurus.png"
10+
/>
11+
12+
### Create a new blank diagram
13+
14+
### Define tables
15+
16+
### Create relationships
17+
18+
### Organize with subject areas
19+
20+
### Add notes

docs/intro.md

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,14 @@ sidebar_position: 1
33
slug: /
44
---
55

6-
# Tutorial Intro
6+
import Card from '../src/components/Card';
7+
import Flex from '../src/components/Flex';
78

8-
Let's discover **Docusaurus in less than 5 minutes**.
9+
# Get started
910

10-
## Getting Started
11+
Welcome to DrawDB! Start designing, visualizing, and generating SQL scripts for your database schema in just a few steps – no sign-up required.
1112

12-
Get started by **creating a new site**.
13-
14-
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
15-
16-
### What you'll need
17-
18-
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
19-
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
20-
21-
## Generate a new site
22-
23-
Generate a new Docusaurus site using the **classic template**.
24-
25-
The classic template will automatically be added to your project after you run the command:
26-
27-
```bash
28-
npm init docusaurus@latest my-website classic
29-
```
30-
31-
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
32-
33-
The command also installs all necessary dependencies you need to run Docusaurus.
34-
35-
## Start your site
36-
37-
Run the development server:
38-
39-
```bash
40-
cd my-website
41-
npm run start
42-
```
43-
44-
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
45-
46-
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
47-
48-
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
13+
<Flex>
14+
<Card title="📄 Create a new diagram" link='/create-diagram'>Create a new diagram</Card>
15+
<Card title="📄 Create a new diagram" link='/create-diagram'>Create a new diagram</Card>
16+
</Flex>

docs/tutorial-basics/create-a-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
'hello',
5050
{
5151
type: 'category',
52-
label: 'Tutorial',
52+
label: 'Docs',
5353
items: ['tutorial-basics/create-a-document'],
5454
},
5555
],

docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ const config = {
6464
title: 'drawDB',
6565
logo: {
6666
alt: 'drawDB logo',
67-
src: 'img/icon-dark.png',
67+
src: 'img/logo.png',
6868
},
6969
items: [
7070
{
7171
type: 'docSidebar',
7272
sidebarId: 'tutorialSidebar',
7373
position: 'left',
74-
label: 'Tutorial',
74+
label: 'Docs',
7575
},
7676
{
7777
href: 'https://github.com/drawdb-io/drawdb',
@@ -91,7 +91,7 @@ const config = {
9191
title: 'Docs',
9292
items: [
9393
{
94-
label: 'Tutorial',
94+
label: 'Docs',
9595
to: '/docs/intro',
9696
},
9797
],

src/components/Card/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import styles from './styles.module.css';
3+
4+
export default function Card({title, link, children}) {
5+
6+
return (
7+
<a className={styles.card} href={link}>
8+
<div className={styles.card__title}>{title}</div>
9+
<div className={styles.card__body}>{children}</div>
10+
</a>
11+
);
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.card {
2+
display: block;
3+
text-decoration: none !important;
4+
padding: 20px;
5+
border-radius: 8px;
6+
border: 1px solid var(--border-color);
7+
background-color: var(--bg-color-2);
8+
color: var(--color-1);
9+
}
10+
11+
.card:hover {
12+
color: var(--color-1);
13+
}
14+
15+
.card__title {
16+
font-weight: 500;
17+
}
18+
19+
.card__body {
20+
font-size: small;
21+
}

src/components/Flex/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import styles from './styles.module.css';
3+
4+
export default function Flex({children}) {
5+
return (
6+
<div className={styles.flex}>
7+
{React.Children.map(children, (child) => (
8+
<div className={styles.flex__item}>{child}</div>
9+
))}
10+
</div>
11+
);
12+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.flex {
2+
display: flex;
3+
gap: 12px;
4+
flex-wrap: wrap;
5+
}
6+
7+
.flex__item {
8+
flex: 1;
9+
}
10+
11+
@media (max-width: 768px) {
12+
.flex {
13+
gap: 8px;
14+
}
15+
16+
.flex__item {
17+
flex-basis: 100%;
18+
}
19+
}
20+
21+
@media (max-width: 480px) {
22+
.flex {
23+
gap: 4px;
24+
}
25+
26+
.flex__item {
27+
flex-basis: 100%;
28+
}
29+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import {useColorMode} from '@docusaurus/theme-common';
3+
4+
export default function ThemedImage({lightImageSrc, darkImageSrc}) {
5+
const {isDarkTheme} = useColorMode();
6+
7+
return (
8+
<img
9+
src={isDarkTheme ? darkImageSrc : lightImageSrc}
10+
alt="Example banner"
11+
/>
12+
);
13+
}

0 commit comments

Comments
 (0)