Skip to content

Commit d3bb969

Browse files
authored
Replace React Joyride with React Tour (#22)
1 parent aeb14a2 commit d3bb969

File tree

12 files changed

+270
-240
lines changed

12 files changed

+270
-240
lines changed

__tests__/app/containers/SideBar.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('SideBar Container', () => {
1010
const { store } = configureStore();
1111
const wrapper = mount(
1212
<SidebarContainer
13-
toggleJoyRide={Function}
13+
toggleReactTour={Function}
1414
setIsAuthenticationOpen={(v: boolean) => undefined}
1515
/>,
1616
{

__tests__/app/containers/__snapshots__/SideBar.test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`SideBar Container Should render 1`] = `
44
<Connect(Sidebar)
55
setIsAuthenticationOpen={[Function]}
6-
toggleJoyRide={[Function]}
6+
toggleReactTour={[Function]}
77
>
88
<Sidebar
99
closeSidePanelTab={[Function]}
@@ -13,7 +13,7 @@ exports[`SideBar Container Should render 1`] = `
1313
resetAppState={[Function]}
1414
setIsAuthenticationOpen={[Function]}
1515
sidePanelTab="NONE"
16-
toggleJoyRide={[Function]}
16+
toggleReactTour={[Function]}
1717
toggleUserProfileModal={[Function]}
1818
>
1919
<div

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"@types/jest": "^23.3.10",
7373
"@types/node": "10.11.7",
7474
"@types/pako": "^1.0.0",
75-
"@types/react": "^16.4.16",
75+
"@types/react": "^16.9.18",
7676
"@types/react-bootstrap": "^0.32.15",
7777
"@types/react-dom": "^16.0.9",
7878
"@types/react-flags-select": "^1.1.2",
@@ -135,6 +135,7 @@
135135
"dependencies": {
136136
"@types/commonmark": "^0.27.3",
137137
"@types/react-router-dom": "^5.1.3",
138+
"@types/reactour": "^1.13.1",
138139
"bootstrap": "^4.2.1",
139140
"classnames": "^2.2.6",
140141
"codecharacter-renderer": "^2.3.1",
@@ -149,7 +150,6 @@
149150
"react-flags-select": "^1.1.10",
150151
"react-ga": "^2.7.0",
151152
"react-google-recaptcha": "^1.0.5",
152-
"react-joyride": "^2.0.4",
153153
"react-markdown": "^4.0.6",
154154
"react-monaco-editor": "^0.22.0",
155155
"react-paginate": "^6.2.1",
@@ -160,6 +160,7 @@
160160
"react-router-redux": "^4.0.8",
161161
"react-spinners": "^0.5.1",
162162
"react-split-pane": "^0.1.84",
163+
"reactour": "^1.16.0",
163164
"redux": "^4.0.1",
164165
"redux-actions": "^2.6.1",
165166
"redux-persist": "^5.10.0",

src/app/components/Dashboard.tsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ErrorBoundary } from 'app/components/ErrorBoundary';
2-
import Joyride from 'app/components/Joyride';
2+
import ReactTour from 'app/components/ReactTour';
33
import CodeStatus from 'app/containers/code/CodeStatus';
44
import Editor from 'app/containers/code/Editor';
55
import GameLog from 'app/containers/GameLog';
@@ -42,7 +42,7 @@ export class Dashboard extends React.Component<
4242
this.state = {
4343
fixedLeftPaneWidth,
4444
editorWidthRatio: this.initialEditorRatio,
45-
isJoyRideActive: false,
45+
isReactTourActive: false,
4646
rendererHeight: this.initialRendererHeight,
4747
splitPaneState: DashboardInterfaces.SplitPaneState.BOTH,
4848
windowWidth: window.innerWidth,
@@ -69,7 +69,7 @@ export class Dashboard extends React.Component<
6969
windowWidth,
7070
fixedLeftPaneWidth,
7171
splitPaneState,
72-
isJoyRideActive,
72+
isReactTourActive,
7373
} = this.state;
7474
const {
7575
isLoggedIn,
@@ -107,8 +107,9 @@ export class Dashboard extends React.Component<
107107
return (
108108
<div>
109109
{isWelcomeModalOpen ? <Welcome closeWelcomeModal={() => closeWelcomeModal()} /> : null}
110-
{isLoggedIn && isJoyRideActive ? <Joyride toggleJoyRide={this.onToggleJoyRide} /> : null}
111-
110+
{isLoggedIn && isReactTourActive && !isWelcomeModalOpen ? (
111+
<ReactTour toggleReactTour={this.onToggleReactTour} />
112+
) : null}
112113
{isLoggedIn ? <SocketHandler /> : null}
113114
<SplitPane
114115
style={{
@@ -131,7 +132,7 @@ export class Dashboard extends React.Component<
131132
}}
132133
>
133134
<SideBar
134-
toggleJoyRide={this.onToggleJoyRide}
135+
toggleReactTour={this.onToggleReactTour}
135136
setIsAuthenticationOpen={setIsAuthenticationOpen}
136137
/>
137138
</div>
@@ -143,7 +144,9 @@ export class Dashboard extends React.Component<
143144
>
144145
<CodeStatus width={editorWidth} />
145146
{this.state.splitPaneState !== DashboardInterfaces.SplitPaneState.RENDERER ? (
146-
<Editor editorWidth={editorWidth} />
147+
<div id="editor_div">
148+
<Editor editorWidth={editorWidth} />
149+
</div>
147150
) : null}
148151
</div>
149152
</Row>
@@ -208,9 +211,9 @@ export class Dashboard extends React.Component<
208211
});
209212
};
210213

211-
private onToggleJoyRide = (): void => {
214+
private onToggleReactTour = (): void => {
212215
this.setState({
213-
isJoyRideActive: !this.state.isJoyRideActive,
216+
isReactTourActive: !this.state.isReactTourActive,
214217
});
215218
};
216219
}

src/app/components/Joyride.tsx

-223
This file was deleted.

0 commit comments

Comments
 (0)