Skip to content

Commit

Permalink
fix: doc service webpage sidebar should limit to 40% window width (#5839
Browse files Browse the repository at this point in the history
)

Motivation:

- Some service/struct names can be too long and cause app to look weird.

#5091 (comment)

Modifications:

- Make texts in sidebar wrap.
- Limit sidebar to occupy at most 40% of the window width.

Result:

Wrapping example:

<img width="1052" alt="image"
src="https://github.com/user-attachments/assets/e7e68c67-e05e-4084-9dec-ecabad2424ef">


![image](https://github.com/user-attachments/assets/5ca1186a-e4c1-474e-a4fb-6a2b38f1c9a5)
  • Loading branch information
Dogacel authored Aug 2, 2024
1 parent 6a1d9bf commit d7d5e0b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs-client/src/containers/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const useStyles = makeStyles((theme: Theme) =>
width: '80%',
},
height: '100vh',
maxWidth: '40vw',
overflowY: 'auto',
},
content: {
Expand Down Expand Up @@ -250,6 +251,9 @@ const AppDrawer: React.FunctionComponent<AppDrawerProps> = ({
<ListItemText
primaryTypographyProps={{
variant: 'body2',
style: {
wordBreak: 'break-all',
},
}}
>
<code>{`${method.name}()`}</code>
Expand All @@ -259,6 +263,9 @@ const AppDrawer: React.FunctionComponent<AppDrawerProps> = ({
key={`${endpoint.pathMapping}`}
primaryTypographyProps={{
variant: 'caption',
style: {
wordBreak: 'break-all',
},
}}
>
{endpoint.pathMapping}
Expand Down Expand Up @@ -294,6 +301,9 @@ const AppDrawer: React.FunctionComponent<AppDrawerProps> = ({
inset
primaryTypographyProps={{
variant: 'body2',
style: {
wordBreak: 'break-all',
},
}}
>
{specification.hasUniqueEnumNames() ? (
Expand Down Expand Up @@ -329,6 +339,9 @@ const AppDrawer: React.FunctionComponent<AppDrawerProps> = ({
inset
primaryTypographyProps={{
variant: 'body2',
style: {
wordBreak: 'break-all',
},
}}
>
{specification.hasUniqueStructNames() ? (
Expand Down Expand Up @@ -364,6 +377,9 @@ const AppDrawer: React.FunctionComponent<AppDrawerProps> = ({
inset
primaryTypographyProps={{
variant: 'body2',
style: {
wordBreak: 'break-all',
},
}}
>
{specification.hasUniqueStructNames() ? (
Expand Down

0 comments on commit d7d5e0b

Please sign in to comment.