File tree Expand file tree Collapse file tree 7 files changed +44
-18
lines changed Expand file tree Collapse file tree 7 files changed +44
-18
lines changed Original file line number Diff line number Diff line change 7
7
const transitionDelay = 50 ;
8
8
9
9
exports . shouldUpdateScroll = ( { routerProps : { location } } ) => {
10
- if ( ! location . hash ) {
10
+ if ( ! location . hash || ! document . getElementById ( location . hash . substr ( 1 ) ) ) {
11
11
window . setTimeout ( ( ) => window . scrollTo ( 0 , 0 ) , transitionDelay ) ;
12
12
} else {
13
13
window . setTimeout (
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const ResponseItem = props => {
29
29
return (
30
30
l && (
31
31
< div key = { i } className = "response-wrapper" >
32
- < div className = { ` flex mb-2 pt-2 initResponse` } >
32
+ < div className = " flex mb-2 pt-2 initResponse" >
33
33
< div className = "w-1/4" >
34
34
< div >
35
35
< b > { p } </ b >
@@ -99,7 +99,11 @@ export const ResponseItem = props => {
99
99
</ div >
100
100
) }
101
101
< div >
102
- < div > { l . description } </ div >
102
+ < Markdown
103
+ source = { l . description }
104
+ escapeHtml = { false }
105
+ className = "api-desc"
106
+ />
103
107
</ div >
104
108
</ div >
105
109
</ div >
@@ -139,7 +143,13 @@ export const ResponseItem = props => {
139
143
} ) }
140
144
</ div >
141
145
) }
142
- < div > { data . description } </ div >
146
+ < div >
147
+ < Markdown
148
+ source = { data . description }
149
+ escapeHtml = { false }
150
+ className = "api-desc"
151
+ />
152
+ </ div >
143
153
</ div >
144
154
</ div >
145
155
</ div >
@@ -185,7 +195,13 @@ export const ResponseItem = props => {
185
195
} ) }
186
196
</ div >
187
197
) }
188
- < div > { data . description } </ div >
198
+ < div >
199
+ < Markdown
200
+ source = { data . description }
201
+ escapeHtml = { false }
202
+ className = "api-desc"
203
+ />
204
+ </ div >
189
205
</ div >
190
206
</ div >
191
207
</ div >
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export const Security = props => {
7
7
< div className = "mr-4" >
8
8
< b > Authorizations:</ b >
9
9
</ div >
10
- < div class = "flex flex-col" >
10
+ < div className = "flex flex-col" >
11
11
< div > personalAccessToken</ div >
12
12
< div >
13
13
< span > oAuth: </ span > (< span className = "tag" > { oauth } </ span > )
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class SideMenu extends React.Component {
34
34
} ) ;
35
35
36
36
hash &&
37
+ document . getElementById ( hash . substr ( 1 ) ) !== null &&
37
38
window . setTimeout (
38
39
( ) =>
39
40
document
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ const apiPage = ({ data }) => {
44
44
< Sidebar />
45
45
</ div >
46
46
< div className = "api-content-wrapper" >
47
- < div class = "api-content mx-auto" >
47
+ < div className = "api-content mx-auto" >
48
48
< h1 className = "mb-4 " >
49
49
{ ( n . get && n . get . tags ) ||
50
50
( n . post && n . post . tags ) ||
@@ -57,10 +57,9 @@ const apiPage = ({ data }) => {
57
57
return (
58
58
m && (
59
59
< div key = { i } className = "flex flex-col" >
60
+ < span id = { mode } className = "endpoint-anchor" />
60
61
< div className = "w-full mb-8 py-2" >
61
- < h2 id = { mode } className = "mt-0" >
62
- { m . summary }
63
- </ h2 >
62
+ < h2 className = "mt-0" > { m . summary } </ h2 >
64
63
< div className = "bg-ThemeCell p-4 mt-4 mb-8" >
65
64
< span className = "tag big bold mr-2 uppercase" >
66
65
{ mode }
@@ -71,7 +70,7 @@ const apiPage = ({ data }) => {
71
70
< Markdown
72
71
source = { m . description }
73
72
escapeHtml = { false }
74
- className = "mt -8 api-desc"
73
+ className = "my -8 api-desc"
75
74
/>
76
75
77
76
{ m . parameters && (
@@ -107,8 +106,8 @@ const apiPage = ({ data }) => {
107
106
. properties [ p ] ;
108
107
return (
109
108
b && (
110
- < div key = { i } >
111
- < div className = "flex mb-4" >
109
+ < div key = { i } className = "response-wrapper" >
110
+ < div className = "flex mb-4 initResponse " >
112
111
< div className = "w-1/4" >
113
112
< div >
114
113
< b > { p } </ b >
Original file line number Diff line number Diff line change @@ -23,10 +23,15 @@ input[type="text"] {
23
23
}
24
24
25
25
.api-desc code {
26
- @apply font-normal px-1 bg-ThemeTagGrey inline text-sm ;
26
+ @apply font-normal px-1 bg-ThemeTagGrey inline text-xs relative ;
27
27
padding-top : 4px ;
28
28
padding-bottom : 3px ;
29
29
width : fit-content;
30
+ top : -1px ;
31
+ }
32
+
33
+ .api-desc p : first-child {
34
+ margin-top : 0 ;
30
35
}
31
36
32
37
.api-body table {
Original file line number Diff line number Diff line change 25
25
margin-left : 300px ;
26
26
}
27
27
28
+ .main-wrapper {
29
+ }
30
+
28
31
.api-content {
29
32
max-width : 60vw ;
30
33
margin-left : 16.66667% ;
34
37
@apply mb-8;
35
38
}
36
39
40
+ .endpoint-anchor {
41
+ position : relative;
42
+ top : -84px ;
43
+ visibility : hidden;
44
+ }
45
+
37
46
.list-group {
38
47
max-height : 0 ;
39
48
visibility : hidden;
92
101
@apply border-grey-light;
93
102
}
94
103
95
- .response-wrapper .initResponse : first-child {
96
- /* border: 0; */
97
- }
98
-
99
104
.subResponse {
100
105
border-left-width : 1px ;
101
106
@apply border-grey-light;
You can’t perform that action at this time.
0 commit comments