Skip to content

Commit 59a8a48

Browse files
committed
fix most right section active state
1 parent 6f9d358 commit 59a8a48

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/graphql-playground/src/components/Playground.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,4 +1155,8 @@ const GraphiqlWrapper = styled.div`
11551155
height: 100%;
11561156
position: relative;
11571157
overflow: hidden;
1158+
visibility: hidden;
1159+
&.active {
1160+
visibility: visible;
1161+
}
11581162
`

packages/graphql-playground/src/components/Playground/DocExplorer/TypeLink.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export interface Props {
3030
showParentName?: boolean
3131
collapsable?: boolean
3232
sessionId: string
33+
lastActive: boolean
3334
}
3435

3536
interface State {
@@ -113,6 +114,7 @@ class TypeLink extends React.Component<
113114
keyMove,
114115
showParentName,
115116
isActive,
117+
lastActive,
116118
} = this.props
117119
const isGraphqlType = isType(type)
118120

@@ -130,7 +132,7 @@ class TypeLink extends React.Component<
130132
className={cx('doc-category-item', className, {
131133
clickable,
132134
active: isActive,
133-
// 'last-active': isLastActive,
135+
'last-active': lastActive,
134136
'no-hover': keyMove,
135137
})}
136138
onClick={this.onClick}
@@ -157,7 +159,7 @@ class TypeLink extends React.Component<
157159
}
158160
`}</style>
159161
<style jsx={true} global={true}>{`
160-
/*.doc-category-item.last-active,*/
162+
.doc-category-item.last-active,
161163
.doc-category-item.clickable:hover:not(.no-hover) {
162164
background-color: #2a7ed3 !important;
163165
color: #fff !important;
@@ -251,12 +253,14 @@ const mapStateToProps = (state, { x, y, sessionId }) => {
251253
return {
252254
isActive,
253255
keyMove: docs.keyMove,
256+
lastActive: isActive && x === docs.navStack.length - 1,
254257
}
255258
}
256259
}
257260
return {
258261
isActive: false,
259262
keyMove: false,
263+
lastActive: false,
260264
}
261265
}
262266

0 commit comments

Comments
 (0)