-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4c3fe5
commit 3d1e82f
Showing
9 changed files
with
131 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { PageLayout } from "~/components/layout"; | ||
import { MuiMdxLayout } from "~/components/layout/MuiMdxLayout"; | ||
import { Steps } from "./Steps"; | ||
export const LearnLayout = ({ children, ...props }) => { | ||
return ( | ||
<PageLayout> | ||
<MuiMdxLayout {...props}> | ||
<nav> | ||
<Steps /> | ||
</nav> | ||
<main>{children}</main> | ||
</MuiMdxLayout> | ||
</PageLayout> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { List, ListItem, ListItemButton } from "@mui/material"; | ||
import { useEffect, useState } from "react"; | ||
|
||
/** | ||
* @client-only | ||
*/ | ||
const detectStep = () => { | ||
const { host, pathname } = window.location; | ||
// Running on vulcan-next.vercel.app => step 0 | ||
if (host.match(/vulcan-next.vercel.app/) || pathname.match(/intro-online/)) { | ||
return 0; | ||
} | ||
// Vulcan Next installed and running locally => step 1 | ||
return 1; | ||
// If Mongo URL is local => next step | ||
// etc. | ||
}; | ||
const useCurrentStep = () => { | ||
const [step, setStep] = useState<number>(-1); | ||
useEffect(() => { | ||
const nextStep = detectStep(); | ||
if (nextStep !== step) { | ||
setStep(detectStep); | ||
} | ||
}); | ||
return step; | ||
}; | ||
export const Steps = () => { | ||
const currentStep = useCurrentStep(); | ||
// TODO: also associate a link to step | ||
// be careful with step 0, that happens online | ||
return ( | ||
<List> | ||
{["Step 0", "Step 1"].map((stepName, stepIdx) => { | ||
return ( | ||
<ListItem key={stepName}> | ||
<ListItemButton | ||
disabled={stepIdx > currentStep} | ||
selected={stepIdx === currentStep} | ||
> | ||
{stepName} | ||
</ListItemButton> | ||
</ListItem> | ||
); | ||
})} | ||
</List> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Button } from "@mui/material"; | ||
import { LearnLayout } from "~/components/vn/learn/LearnLayout"; | ||
|
||
# Step 1: Opening Vulcan locally | ||
|
||
Great, you installed and started Vulcan on your own machine! | ||
|
||
The "`localhost`" in the url means that Vulcan Next is currently running on your own computer, | ||
litterally the "local host". | ||
|
||
## Go to step 2 | ||
|
||
<Button> | ||
<a target="_blank" rel="noreferrer" href="/learn/mongo"> | ||
Now, let's setup the database | ||
</a> | ||
</Button> | ||
|
||
**Had some trouble with this step?** | ||
|
||
[Join us on Slack and ask your questions directly](http://slack.vulcanjs.org/) | ||
|
||
export default function IntroOfflinePage(props) { | ||
return <LearnLayout {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Button } from "@mui/material"; | ||
import { LearnLayout } from "~/components/vn/learn/LearnLayout"; | ||
|
||
# Step 2: Plug the database | ||
|
||
## TL;DR | ||
|
||
TODO | ||
|
||
## Prerequesites | ||
|
||
- Install Docker | ||
- (Optional) Install Compass | ||
|
||
## Hello Mongo | ||
|
||
**Congratulation, you beat step 0 and installed Vulcan on your own computer!** | ||
|
||
This step is also about configuration. This time, we are going to plug the database | ||
|
||
## Go to step 2 | ||
|
||
**Congratulation, you beat the first and hardest step!** | ||
|
||
<Button> | ||
<a target="_blank" rel="noreferrer" href="/learn/mongo"> | ||
Now, click to open your local version of Vulcan | ||
</a> | ||
</Button> | ||
|
||
**Had some trouble with this first step?** | ||
|
||
[Join us on Slack and ask your questions directly](http://slack.vulcanjs.org/) | ||
|
||
export default function IntroOfflinePage(props) { | ||
return <LearnLayout {...props} />; | ||
} |