Skip to content

Commit

Permalink
[PM-7918] Design Feedback and other cleanup (#136)
Browse files Browse the repository at this point in the history
* add forms sidebar to homepage and center docs content blocks

* remove workaround for preventing unused searchbar from taking up whitespace

* redorder forms sidebar items, collapse all but login by default, and fix incorrect filename for Create items
  • Loading branch information
jprusik authored May 10, 2024
1 parent 1450705 commit 7ff5c80
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 84 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collapsed": true,
"label": "Create",
"link": {
"type": "generated-index",
"description": "Common patterns for account creation forms"
},
"collapsed": false
"position": 5
}
3 changes: 2 additions & 1 deletion client/docs/forms/identity/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collapsed": true,
"label": "Identity",
"link": {
"type": "generated-index",
"description": "Common patterns for identity forms"
},
"collapsed": false
"position": 2
}
4 changes: 2 additions & 2 deletions client/docs/forms/login/_category_.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"collapsed": false,
"label": "Login",
"position": 1,
"link": {
"type": "generated-index",
"description": "Common patterns for login forms"
},
"collapsed": false
"position": 1
}
3 changes: 2 additions & 1 deletion client/docs/forms/payment/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collapsed": true,
"label": "Payment",
"link": {
"type": "generated-index",
"description": "Common patterns for payment forms"
},
"collapsed": false
"position": 3
}
3 changes: 2 additions & 1 deletion client/docs/forms/search/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collapsed": true,
"label": "Search",
"link": {
"type": "generated-index",
"description": "Common patterns for search inputs"
},
"collapsed": false
"position": 4
}
3 changes: 2 additions & 1 deletion client/docs/forms/update/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collapsed": true,
"label": "Update",
"link": {
"type": "generated-index",
"description": "Common patterns for authentication update forms"
},
"collapsed": false
"position": 6
}
1 change: 1 addition & 0 deletions client/src/pages/index.md → client/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Intro
displayed_sidebar: formsSidebar
---

# Let's test the web!
Expand Down
4 changes: 4 additions & 0 deletions client/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const config: Config = {
{
docs: {
breadcrumbs: false,
// @TODO there is a known issue where docs `routeBasePath` set to "/" breaks 404 pages
// https://github.com/facebook/docusaurus/issues/9665
// https://github.com/facebook/docusaurus/issues/9688

routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
},
Expand Down
24 changes: 0 additions & 24 deletions client/sidebars.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
formsSidebar: [{ type: "autogenerated", dirName: "forms" }],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
};

module.exports = sidebars;
17 changes: 5 additions & 12 deletions client/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,18 @@
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}

.theme-doc-markdown > header:first-of-type details > summary {
list-style: none;
}
.theme-doc-markdown > header:first-of-type details > summary::after {
font-size: 24px;
content: " ▸";
}
.theme-doc-markdown > header:first-of-type details[open] > summary::after {
font-size: 24px;
content: " ▾";
}

.theme-doc-markdown > header:first-of-type h1:first-of-type {
display: inline-block;
cursor: pointer;
font-size: 24px;
margin-bottom: 5px;
}

main [class^="docItemCol_"],
main [class*=" docItemCol_"] {
margin: auto;
}

select,
input:not([type]), /* text type is stripped from built html */
input[type="url"],
Expand Down
10 changes: 0 additions & 10 deletions client/src/theme/Navbar/Search/index.js

This file was deleted.

31 changes: 0 additions & 31 deletions client/src/theme/Navbar/Search/styles.module.css

This file was deleted.

0 comments on commit 7ff5c80

Please sign in to comment.