Skip to content

Commit 854ced0

Browse files
authored
Merge pull request #17 from ShMcK/fix/size
Fix/size
2 parents 3d8c8fa + 7a07a4d commit 854ced0

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

tslint.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"extends": ["tslint:latest", "tslint-config-prettier"],
33
"rules": {
4+
"class-name": true,
5+
"curly": true,
6+
"interface-name": [true, "never-prefix"],
47
"no-string-throw": true,
5-
"no-unused-expression": true,
68
"no-duplicate-variable": true,
7-
"curly": true,
8-
"class-name": true,
9+
"no-implicit-dependencies": false,
10+
"no-unused-expression": true,
11+
"object-literal-sort-keys": false,
12+
"ordered-imports": false,
913
"semicolon": [true, "never"],
10-
"triple-equals": true,
11-
"interface-name": [true, "never-prefix"],
12-
"object-literal-sort-keys": false
14+
"triple-equals": true
1315
},
1416
"defaultSeverity": "warning",
1517
"no-submodule-imports": false

web-app/.storybook/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// import '@alifd/next/dist/next.css'
1+
import'@alifd/next/dist/next.css'
22
import{configure}from'@storybook/react'
33
import'../src/styles/index.css'
44

web-app/src/Routes.tsx

+21-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,34 @@ interface Props {
1212

1313
conststyles={
1414
page: {
15-
width: window.innerWidth,
16-
height: window.innerHeight,
15+
margin: 0,
1716
backgroundColor: 'white',
1817
},
1918
}
2019

2120
constRoutes=({ state }: Props)=>{
21+
const[dimensions,setDimensions]=React.useState({
22+
width: window.innerWidth-20,
23+
height: window.innerHeight-20,
24+
})
25+
26+
// solution for windows getting off size
27+
// without adding multiple listeners
28+
React.useEffect(()=>{
29+
constdimensionsInterval=setInterval(()=>{
30+
setDimensions({
31+
width: window.innerWidth-20,
32+
height: window.innerHeight-20,
33+
})
34+
},5000)
35+
return()=>{
36+
clearInterval(dimensionsInterval)
37+
}
38+
})
39+
2240
// TODO: refactor cond to user <Router><Route> and accept first route as if/else if
2341
return(
24-
<divstyle={styles.page}>
42+
<divstyle={{ ...styles.page, ...dimensions}}>
2543
<Condstate={state}path="SelectTutorial.Startup">
2644
<Loading/>
2745
</Cond>

web-app/src/components/Stage/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ const Stage = ({ stage, steps, onNextStage, complete }: Props) => {
3838
constactiveIndex=stepList.findIndex((stepId: string)=>{
3939
returnsteps[stepId].status.active
4040
})
41-
// only display up until the active step
42-
constfilteredStepList=stepList.slice(0,activeIndex+1)
4341
return(
4442
<divstyle={styles.card}>
4543
<divstyle={styles.content}>
@@ -48,7 +46,7 @@ const Stage = ({ stage, steps, onNextStage, complete }: Props) => {
4846
</div>
4947
<divstyle={styles.steps}>
5048
<Stepcurrent={activeIndex}direction="ver"shape="dot"animationreadOnly>
51-
{filteredStepList.map((stepId: string,index: number)=>{
49+
{stepList.map((stepId: string,index: number)=>{
5250
conststep=steps[stepId]
5351
return(
5452
<Step.Item

web-app/src/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import ReactDOM from 'react-dom'
33
importAppfrom'./App'
44

55
// base styles
6+
// TODO: must be a better way to load @alifd styles
7+
// currently these are loaded in src/editor/ReactWebView.ts as well
8+
import'@alifd/next/dist/next.css'
69
import'./styles/index.css'
710

811
ReactDOM.render(<App/>,document.getElementById('root')asHTMLElement)

0 commit comments

Comments
 (0)
close