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

Commit98c7c50

Browse files
committed
media query on step progress
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent0d5ef9d commit98c7c50

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

‎web-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"react-addons-css-transition-group":"^15.6.2",
4040
"react-dom":"^16.13.1",
4141
"reselect":"^4.0.0",
42+
"use-media":"^1.4.0",
4243
"xstate":"^4.11.0"
4344
},
4445
"devDependencies": {

‎web-app/src/containers/Tutorial/components/Reset.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Reset = (props: Props) => {
2525

2626
return(
2727
<>
28-
<Buttontype="secondary"onClick={()=>setModalState('confirm')}disabled={props.disabled}>
28+
<Buttontype="secondary"size="medium"onClick={()=>setModalState('confirm')}disabled={props.disabled}>
2929
Reset
3030
</Button>
3131
<Dialog

‎web-app/src/containers/Tutorial/components/StepProgress.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import*asReactfrom'react'
22
import{Progress}from'@alifd/next'
3+
importuseMediafrom'use-media'
34

45
conststyles={
56
progress:{
@@ -23,19 +24,25 @@ const StepProgress = (props: Props) => {
2324
{props.current} of{props.max}
2425
</span>
2526
)
26-
return(
27-
<Progress
28-
state="success"
29-
progressive
30-
percent={(props.current/props.max)*100}
31-
shape="line"
32-
color="rgb(85, 132, 255)"
33-
css={styles.progress}
34-
textRender={()=>{
35-
returnText
36-
}}
37-
/>
38-
)
27+
28+
constisWide=useMedia({minWidth:'340px'})
29+
30+
if(isWide){
31+
return(
32+
<Progress
33+
state="success"
34+
progressive
35+
percent={(props.current/props.max)*100}
36+
shape="line"
37+
color="rgb(85, 132, 255)"
38+
css={styles.progress}
39+
textRender={()=>{
40+
returnText
41+
}}
42+
/>
43+
)
44+
}
45+
return<divcss={{marginRight:'0.5rem',fontSize:'80%'}}>{Text}</div>
3946
}
4047

4148
exportdefaultStepProgress

‎web-app/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13431,6 +13431,11 @@ use-callback-ref@^1.2.1:
1343113431
resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.2.3.tgz#9f939dfb5740807bbf9dd79cdd4e99d27e827756"
1343213432
integrity sha512-DPBPh1i2adCZoIArRlTuKRy7yue7QogtEnfv0AKrWsY+GA+4EKe37zhRDouNnyWMoNQFYZZRF+2dLHsWE4YvJA==
1343313433

13434+
use-media@^1.4.0:
13435+
version "1.4.0"
13436+
resolved "https://registry.yarnpkg.com/use-media/-/use-media-1.4.0.tgz#e777bf1f382a7aacabbd1f9ce3da2b62e58b2a98"
13437+
integrity sha512-XsgyUAf3nhzZmEfhc5MqLHwyaPjs78bgytpVJ/xDl0TF4Bptf3vEpBNBBT/EIKOmsOc8UbuECq3mrP3mt1QANA==
13438+
1343413439
use-sidecar@^1.0.1:
1343513440
version "1.0.2"
1343613441
resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.0.2.tgz#e72f582a75842f7de4ef8becd6235a4720ad8af6"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp