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

Commit649efa6

Browse files
committed
closescoderoad#92. fix up load next step ui
1 parent43c1659 commit649efa6

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

‎web-app/src/components/StepHelp/index.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import{Balloon}from'@alifd/next'
22
import*asReactfrom'react'
33
import{css,jsx}from'@emotion/core'
4+
importIconfrom'../Icon'
45
importButtonfrom'../Button'
56

67
conststyles={
@@ -28,17 +29,32 @@ interface Props {
2829
}
2930

3031
constStepHelp=(props:Props)=>{
32+
const[visible,setVisible]=React.useState(false)
3133
// TODO extract or replace load solution
3234
const[loadedSolution,setLoadedSolution]=React.useState()
3335
constonClickHandler=()=>{
3436
if(!loadedSolution){
3537
setLoadedSolution(true)
3638
props.onLoadSolution()
39+
setVisible(false)
3740
}
3841
}
39-
constpromptLeft=<Buttoncss={styles.iconButton}>i</Button>
42+
constpromptLeft=(
43+
<Buttoncss={styles.iconButton}onClick={()=>setVisible(!visible)}>
44+
<Icontype="help"/>
45+
</Button>
46+
)
4047
return(
41-
<Balloontrigger={promptLeft}align="l"alignEdgetriggerType="click"css={{width:150}}closable={false}>
48+
<Balloon
49+
trigger={promptLeft}
50+
align="l"
51+
alignEdge
52+
triggerType="click"
53+
css={{width:150}}
54+
closable
55+
visible={visible}
56+
onClose={()=>setVisible(false)}
57+
>
4258
<div>
4359
<h4css={styles.balloonTitle}>Stuck?</h4>
4460
<divcss={styles.balloonOptions}>

‎web-app/stories/Step.stories.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,8 @@ const paragraphText = `Markdown included \`code\`, *bold*, & _italics_.
3131
storiesOf('Level',module)
3232
.addDecorator(SideBarDecorator)
3333
.addDecorator(withKnobs)
34-
.add('Step',()=>(
35-
<Step
36-
order={1}
37-
content={text('text',stepText)}
38-
status={select('mode',{ACTIVE:'ACTIVE',COMPLETE:'COMPLETE',INCOMPLETE:'INCOMPLETE'},'COMPLETE','step')}
39-
onLoadSolution={action('onLoadSolution')}
40-
/>
34+
.add('Active Step',()=>(
35+
<Steporder={1}content={text('text',stepText)}status="ACTIVE"onLoadSolution={action('onLoadSolution')}/>
4136
))
4237
.add('Step Markdown',()=>(
4338
<Step

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp