Skip to content

Commit 9269763

Browse files
authored
[DEV-3593] Fix api page layout (#1998)
* fix chips and apirestsection selector style * add changeset * fixes as requested by review * fix text clamp * merge with main and fix compile
1 parent 24b1e72 commit 9269763

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

.changeset/free-colts-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"nextjs-website": patch
3+
---
4+
5+
Fix chip colors, fix api selector style

apps/nextjs-website/src/components/atoms/ApiViewer/ApiViewer.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ const ApiViewer: FC<ApiViewerProps> = ({ specURL }) => {
6464
#api-info {
6565
margin-left: 0 !important;
6666
}
67+
.nav-method {
68+
border-radius: 4px !important;
69+
min-width: 48px !important;
70+
min-height: 22px !important;
71+
padding-top: 2px !important;
72+
font-size: 12px !important;
73+
font-weight: 600 !important;
74+
justify-content: center;
75+
align-items: center;
76+
text-align: center;
77+
background-color: ${palette.info[100]} !important;
78+
margin-right: 8px !important;
79+
}
6780
`;
6881
rapidocEl.shadowRoot.appendChild(style);
6982
}
@@ -80,7 +93,7 @@ const ApiViewer: FC<ApiViewerProps> = ({ specURL }) => {
8093
return () => {
8194
rapidocEl.removeEventListener('spec-loaded', injectStyles);
8295
};
83-
}, []);
96+
}, [palette.info]);
8497

8598
// Cast strict TS error for custom element
8699
const RapiDoc = 'rapi-doc' as unknown as ElementType;

apps/nextjs-website/src/components/molecules/ApiRestSection/ApiRestSection.styles.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ export const getStyles = (palette: Palette) => {
55
return {
66
select: {
77
minWidth: { sx: 'auto', sm: '400px' },
8-
color: white,
8+
color: palette.text.primary,
99
margin: 1,
1010
'& .MuiOutlinedInput-notchedOutline': {
11-
borderColor: `${white} !important`, // !important is needed due to MUI that overwrite style via javascript
11+
borderColor: `${palette.primary.main} !important`, // !important is needed due to MUI that overwrite style via javascript
1212
},
1313

1414
'& .MuiSelect-icon': {
15-
color: white,
15+
color: palette.primary.main,
1616
},
1717
},
1818
selectContainer: {
19-
background: palette.primary.dark,
19+
background: white,
2020
height: 72,
2121
paddingRight: 2,
2222
},

apps/nextjs-website/src/components/molecules/ApiRestSection/ApiRestSection.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const ApiRestSection = ({
5555
specURLs,
5656
specURLsName,
5757
}: ApiRestPageProps) => {
58-
const { palette } = useTheme();
58+
const { palette, spacing } = useTheme();
5959

6060
const [selectedItemURL, setSelectedItemURL] = useState(specURLs[0].url);
6161

@@ -105,11 +105,19 @@ const ApiRestSection = ({
105105
<Stack
106106
sx={styles.selectContainer}
107107
direction='row'
108-
justifyContent='flex-end'
108+
justifyContent='flex-start'
109109
alignContent='center'
110+
marginLeft={spacing(2.125)}
110111
>
111112
<StyledFormControl size='medium'>
112-
<InputLabel id='select-api-label'>{specURLsName}</InputLabel>
113+
<InputLabel
114+
id='select-api-label'
115+
sx={{
116+
color: `${palette.primary.main} !important`,
117+
}}
118+
>
119+
{specURLsName}
120+
</InputLabel>
113121
<Select
114122
labelId='select-api-label'
115123
value={selectedItemURL}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)