- Notifications
You must be signed in to change notification settings - Fork39
Create help center on tutorial page#127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletionsweb-app/package-lock.json
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
2 changes: 2 additions & 0 deletionsweb-app/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletionsweb-app/src/components/NewUserExperience/NuxTutorial.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
import React from 'react' | ||
import { Collapse, Icon } from '@alifd/next' | ||
import ReactCSSTransitionGroup from 'react-addons-css-transition-group' | ||
import './transition.css' | ||
const Panel = Collapse.Panel | ||
const styles = { | ||
container: { | ||
position: 'relative' as 'relative', | ||
transition: 'all .35s', | ||
}, | ||
header: { | ||
display: 'flex' as 'flex', | ||
backgroundColor: '#6a67ce', | ||
color: 'white', | ||
padding: '0.5rem', | ||
}, | ||
title: { | ||
fontSize: '1rem', | ||
}, | ||
toggle: { | ||
display: 'flex' as 'flex', | ||
alignItems: 'center' as 'center', | ||
width: '1.5rem', | ||
}, | ||
} | ||
const NewUserExperienceTutorialCollapsible = () => { | ||
const [expandedKeys, setExpandedKeys] = React.useState<string[]>([]) | ||
return ( | ||
<Collapse onExpand={setExpandedKeys} expandedKeys={expandedKeys}> | ||
<Panel title="What To Do"> | ||
<div> | ||
<p>Update the editor code and press save to to complete the list of "Tasks".</p> | ||
</div> | ||
</Panel> | ||
<Panel title="How It Works"> | ||
<div> | ||
<p> | ||
When you press save in the editor, CodeRoad runs tests to check if you completed the current task and can | ||
continue to the next task. | ||
</p> | ||
<br /> | ||
<p> | ||
Progress is tracked and advanced by using Git in the background. On startup, CodeRoad launches a new local | ||
Git repo. New tasks are loaded as new commits, and your task solution code is automatically saved as the | ||
next Git commit. | ||
</p> | ||
</div> | ||
</Panel> | ||
<Panel title="How to Debug"> | ||
<p>You can debug a tutorial in a number of ways:</p> | ||
<br /> | ||
<ol> | ||
<li> | ||
1. Press save in the editor and use the feedback from failed test messages in the console output. The output | ||
can be found by opening the integrated VSCode terminal, and selecting the tab "Output". Learn more about the | ||
integrated terminal in VSCode at {' '} | ||
<a href="https://code.visualstudio.com/docs/editor/integrated-terminal"> | ||
https://code.visualstudio.com/docs/editor/integrated-terminal | ||
</a> | ||
. | ||
</li> | ||
<br /> | ||
<li> | ||
2. Run the VSCode Debugger located in the left hand icon panel. To start debugging, press the green arrow | ||
button at the top labelled "RUN AND DEBUG". Learn more about debugging with the VSCode Debugger at | ||
<a href="https://code.visualstudio.com/docs/editor/debugging"> | ||
https://code.visualstudio.com/docs/editor/debugging | ||
</a> | ||
. | ||
</li> | ||
<br /> | ||
<li> | ||
3. Run the tests in the command line (eg. `npm run test`) and use the output from the tests to debug. Feel | ||
free to use the integrated VScode terminal noted above or another terminal with the project working | ||
directory open. . | ||
</li> | ||
</ol> | ||
</Panel> | ||
<Panel title="I'm Stuck"> | ||
<p>A few tips to help you if you get stuck.</p> | ||
<ol> | ||
<li> | ||
Read the tests. The tests can be found in the test directory and can be read in detail to help you | ||
understand what's failing. | ||
</li> | ||
<br /> | ||
<li> | ||
Load the solution. Each step in CodeRoad is stored as a Git commit - including the solution. Load the | ||
solution by pressing the help icon under the current task, and select the option "load solution". | ||
</li> | ||
</ol> | ||
</Panel> | ||
<Panel title="Contact"> | ||
We'd love to hear your comments, requests, issues, questions - reach out at{' '} | ||
<a href="mailto:coderoadapp@gmail.com">coderoadapp@gmail.com</a>. | ||
</Panel> | ||
</Collapse> | ||
) | ||
} | ||
interface Props { | ||
css?: React.CSSProperties | ||
} | ||
const NewUserExperienceTutorial = (props: Props) => { | ||
const [isOpen, setIsOpen] = React.useState<boolean>(false) | ||
const onToggle = () => { | ||
setIsOpen(!isOpen) | ||
} | ||
return ( | ||
<div css={{ ...styles.container, ...props.css }}> | ||
<div css={styles.header} onClick={onToggle} style={{ cursor: 'pointer' }}> | ||
<span css={styles.toggle}>{isOpen ? <Icon type="close" size="xs" /> : <Icon type="help" size="small" />}</span> | ||
<span css={styles.title}>Help</span> | ||
</div> | ||
<ReactCSSTransitionGroup transitionName="slide" transitionEnterTimeout={500} transitionLeaveTimeout={300}> | ||
{isOpen && <NewUserExperienceTutorialCollapsible />} | ||
</ReactCSSTransitionGroup> | ||
</div> | ||
) | ||
} | ||
export default NewUserExperienceTutorial |
21 changes: 21 additions & 0 deletionsweb-app/src/components/NewUserExperience/transition.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.slide-enter { | ||
max-height: 0; | ||
overflow: hidden; | ||
} | ||
.slide-enter.slide-enter-active { | ||
max-height: 100rem; | ||
overflow: auto; | ||
transition: max-height 500ms ease-in; | ||
} | ||
.slide-leave { | ||
max-height: 100rem; | ||
overflow: auto; | ||
} | ||
.slide-leave.slide-leave-active { | ||
max-height: 0; | ||
overflow: hidden; | ||
transition: max-height 300ms ease-out; | ||
} |
13 changes: 12 additions & 1 deletionweb-app/src/containers/Tutorial/LevelPage/Level.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletionsweb-app/stories/NewUserExperience.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { storiesOf } from '@storybook/react' | ||
import React from 'react' | ||
import { css, jsx } from '@emotion/core' | ||
import SideBarDecorator from './utils/SideBarDecorator' | ||
import NewUserExperienceTutorial from '../src/components/NewUserExperience/NuxTutorial' | ||
const styles = { | ||
container: { | ||
position: 'absolute', | ||
bottom: 0, | ||
left: 0, | ||
right: 0, | ||
}, | ||
} | ||
storiesOf('NewUserExperience', module) | ||
.addDecorator(SideBarDecorator) | ||
.add('NUXTutorial', () => ( | ||
<div css={styles.container}> | ||
<NewUserExperienceTutorial /> | ||
</div> | ||
)) |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.