-
Notifications
You must be signed in to change notification settings - Fork 3
Feature: Convert menus to JSON #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
c6682ae
d801d87
8f87253
e388fea
e2e7b89
9a7e6dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,120 @@ | ||
| export const PRIMARY_LOCATION = "PRIMARY"; | ||
| export const FOOTER_LOCATION = "FOOTER_1"; | ||
|
|
||
| export const HeaderMenu = [ | ||
|
||
| { | ||
| id: "docs", | ||
| uri: "/docs/", | ||
| label: "Docs", | ||
| }, | ||
| { | ||
| id: "blog", | ||
| uri: "/blog/", | ||
| label: "Blog", | ||
| }, | ||
| { | ||
| id: "showcase", | ||
| uri: "/showcase/", | ||
| label: "Showcase", | ||
| }, | ||
| ]; | ||
|
|
||
| export const FooterMenuSections = { | ||
| downloads: "Downloads", | ||
| community: "Community", | ||
| wpengine: "WP Engine", | ||
| }; | ||
|
|
||
| export const FooterMenus = [ | ||
| { | ||
| id: "faust-cli", | ||
| section: "downloads", | ||
| uri: "https://www.npmjs.com/package/@faustwp/cli", | ||
| label: "@faustwp/cli", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "faust-core", | ||
| section: "downloads", | ||
| uri: "https://www.npmjs.com/package/@faustwp/core", | ||
| label: "@faustwp/core", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "faust-blocks", | ||
| section: "downloads", | ||
| uri: "https://www.npmjs.com/package/@faustwp/blocks", | ||
| label: "@faustwp/blocks", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "faust-js-companion-plugin", | ||
| section: "downloads", | ||
| uri: "https://github.com/wpengine/faustjs/tree/canary/plugins/faustwp", | ||
| label: "Faust.js Companion Plugin", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "wpgraphql-content-blocks", | ||
| section: "downloads", | ||
| uri: "https://github.com/wpengine/wp-graphql-content-blocks", | ||
| label: "WPGraphQL Content Blocks", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "github", | ||
| section: "community", | ||
| uri: "https://github.com/wpengine/faustjs?ref=faustjs", | ||
| label: "Github", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "twitter", | ||
| section: "community", | ||
| uri: "https://twitter.com/wpengine", | ||
| label: "Twitter", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "youtube", | ||
| section: "community", | ||
| uri: "https://www.youtube.com/channel/UCh1WuL54XFb9ZI6m6goFv1g", | ||
| label: "YouTube", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "dicord", | ||
|
||
| section: "community", | ||
| uri: "https://discord.com/invite/headless-wordpress-836253505944813629", | ||
| label: "Headless Discord", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "privacy", | ||
| section: "wpengine", | ||
| uri: "/privacy-policy/", | ||
| label: "Privacy Policy", | ||
| target: "_self", | ||
| }, | ||
| { | ||
| id: "developers", | ||
| section: "wpengine", | ||
| uri: "https://developers.wpengine.com/?ref=faustjs", | ||
| label: "Developers", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "hiring", | ||
| section: "wpengine", | ||
| uri: "https://wpengine.careers/?ref=faustjs", | ||
| label: "We're Hiring!", | ||
| target: "_blank", | ||
| }, | ||
| { | ||
| id: "hosting", | ||
| section: "wpengine", | ||
| uri: "https://wpengine.com/atlas?ref=faustjs", | ||
| label: "Headless Hosting", | ||
| target: "_blank", | ||
| }, | ||
| ]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per this section of the React docs (https://react.dev/learn/conditional-rendering#conditionally-returning-nothing-with-null), the recommended way to render nothing is to return
null. So this line should do that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kellen, That is good to know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kellen for the really good feedback. I can definitely see where your coming from and I agree with your approach too. There is definitely too much overhead for some static links which are not going to be re-used elsewhere. We could also probably set a variable for the class names to try and reduce repetition too.