Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
ShMcK merged 4 commits intomasterfromfeature/nux
Mar 7, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletionsweb-app/package-lock.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 2 additions & 0 deletionsweb-app/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,6 +38,7 @@
"moment": "^2.24.0",
"prismjs": "^1.19.0",
"react": "^16.13.0",
"react-addons-css-transition-group": "^15.6.2",
"react-dom": "^16.13.0",
"reselect": "^4.0.0",
"typescript": "^3.8.3",
Expand All@@ -58,6 +59,7 @@
"@types/node": "^13.7.7",
"@types/prismjs": "^1.16.0",
"@types/react": "^16.9.23",
"@types/react-addons-css-transition-group": "^15.0.5",
"@types/react-dom": "^16.9.5",
"@typescript-eslint/eslint-plugin": "^2.21.0",
"@typescript-eslint/parser": "^2.21.0",
Expand Down
126 changes: 126 additions & 0 deletionsweb-app/src/components/NewUserExperience/NuxTutorial.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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&nbsp;{' '}
<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&nbsp;
<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
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ import { css, jsx } from '@emotion/core'
import Button from '../../../components/Button'
import Markdown from '../../../components/Markdown'
import ProcessMessages from '../../../components/ProcessMessages'
import NuxTutorial from '../../../components/NewUserExperience/NuxTutorial'
import Step from './Step'

const styles = {
Expand All@@ -14,7 +15,7 @@ const styles = {
display: 'flex' as 'flex',
flexDirection: 'column' as 'column',
padding: 0,
paddingBottom: '4.5rem',
paddingBottom: '5rem',
height: 'auto',
width: '100%',
},
Expand DownExpand Up@@ -42,6 +43,12 @@ const styles = {
},
processes: {
padding: '0 1rem',
position: 'fixed' as 'fixed',
bottom: '4rem',
left: 0,
right: 0,
},
nux: {
position: 'fixed' as 'fixed',
bottom: '2rem',
left: 0,
Expand DownExpand Up@@ -129,6 +136,10 @@ const Level = ({ level, onContinue, onLoadSolution, processes, testStatus }: Pro
</div>
)}

<div css={styles.nux}>
<NuxTutorial />
</div>

<div css={styles.footer}>
<span>
{typeof level.index === 'number' ? `${level.index + 1}. ` : ''}
Expand Down
22 changes: 22 additions & 0 deletionsweb-app/stories/NewUserExperience.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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>
))

[8]ページ先頭

©2009-2025 Movatter.jp