diff --git a/.env.development b/.env.development index eab70aa3..22959372 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,6 @@ NEXT_PUBLIC_GRAPHQL_URI="http://localhost:3001/graphql" -MONGO_URI="mongodb+srv://johnDoe:T74OcxqL15TRt7Zn@lbke-demo-ara2d.mongodb.net/sample_restaurants?retryWrites=true&w=majority" APOLLO_SERVER_CORS_WHITELIST="http://localhost:3000" ADMIN_EMAIL="you.need.to.change.this.value@vulcanjs.com" -ADMIN_INITIAL_PASSWORD="vulcan_is_cool" \ No newline at end of file +ADMIN_INITIAL_PASSWORD="vulcan_is_cool" +MONGO_URI="mongodb+srv://johnDoe:T74OcxqL15TRt7Zn@lbke-demo-ara2d.mongodb.net/sample_restaurants?retryWrites=true&w=majority" +# MONGO_URI="mongodb://localhost:27017/vulcan-next-app" \ No newline at end of file diff --git a/cypress/integration/vns/private.spec.ts b/cypress/integration/vns/private.spec.ts index f8c581e9..4d185e21 100644 --- a/cypress/integration/vns/private.spec.ts +++ b/cypress/integration/vns/private.spec.ts @@ -1,3 +1,9 @@ +/** + * NOTE: this tests cover the "withPrivateAccess" hook + * which can be considered as deprecated + * + * See "auth.spec.ts" for a more recent test + */ describe("private pages", () => { describe("server side", () => { it("redirects when accessing private page", () => { diff --git a/next.config.js b/next.config.js index d7497214..0f05a6f4 100644 --- a/next.config.js +++ b/next.config.js @@ -58,9 +58,14 @@ module.exports = (phase, { defaultConfig }) => { let extendedConfig; extendedConfig = extendNextConfig(defaultConfig); - extendedConfig.env = {}; - extendedConfig.serverRuntimeConfig = {}; - extendedConfig.publicRuntimeConfig = {}; + extendedConfig.env = { + NEXT_PUBLIC_IS_USING_DEMO_DATABASE: !!(process.env.MONGO_URI || "").match( + /lbke\-demo/ + ), + NEXT_PUBLIC_IS_USING_LOCAL_DATABSE: !!(process.env.MONGO_URI || "").match( + /localhost/ + ), + }; // Enable Webpack analyzer if (process.env.ANALYZE && process.env.ANALYZE !== "false") { diff --git a/src/components/home/home.tsx b/src/components/home/home.tsx index 899eaa23..cda0e07f 100644 --- a/src/components/home/home.tsx +++ b/src/components/home/home.tsx @@ -4,13 +4,33 @@ import { Typography } from "@material-ui/core"; export const Home = () => (
- - - Below, find Vulcan Next Readme loaded from an MD file using{" "} - MDXJS - - +
+ + Hi there! You are running Vulcan Next! You are doing great so far. + + + Below, find Vulcan Next Readme loaded from a markdown file using{" "} + MDXJS. + + + You can also read the rest of{" "} + Vulcan documentation here. + + Have fun! +
+
); diff --git a/src/components/layout/MDXMuiLayout.tsx b/src/components/layout/MDXMuiLayout.tsx index 89d9c966..26aa7f16 100644 --- a/src/components/layout/MDXMuiLayout.tsx +++ b/src/components/layout/MDXMuiLayout.tsx @@ -47,7 +47,8 @@ const components = { //inlineCode: Typography, //hr: Typography, a: Link, - //img: Typography, + // TODO: didn't find a way to override image styling... + img: (props) => , }; const MDXMuiLayout = ({ children }: MDXLayoutProps) => { return ( diff --git a/src/components/user/form.js b/src/components/user/form.tsx similarity index 100% rename from src/components/user/form.js rename to src/components/user/form.tsx diff --git a/src/components/user/layout.js b/src/components/user/layout.tsx similarity index 56% rename from src/components/user/layout.js rename to src/components/user/layout.tsx index e5577252..c5ba56e9 100644 --- a/src/components/user/layout.js +++ b/src/components/user/layout.tsx @@ -1,14 +1,28 @@ import Head from "next/head"; -import Footer from "~/components/layout/Footer"; const Layout = (props) => ( <> - With Cookies + Auth
-
{props.children}
+
+ {process.env.NEXT_PUBLIC_IS_USING_DEMO_DATABASE ? ( +
+

You are using LBKE read-only demo database.

+

+ To enable authentication features, please setup your own local + database. +

+

+ See home README for relevant instructions. +

+
+ ) : ( + props.children + )} +
{/*