Skip to content

Commit 493b737

Browse files
authored
feat: Merge pull request #72 from waoai/fix/integrate-react-material-workspace-layout
Integrate React Material Workspace Layout + Add Collapsing Sidebar
2 parents d4196f8 + c93ecdd commit 493b737

File tree

17 files changed

+3909
-2727
lines changed

17 files changed

+3909
-2727
lines changed

.flowconfig

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[options]
2+
esproposal.optional_chaining=enable

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"react-hotkeys": "^2.0.0",
1919
"react-json-view": "^1.19.1",
2020
"react-markdown": "^4.0.6",
21+
"react-material-workspace-layout": "^0.1.16",
2122
"react-monaco-editor": "^0.25.1",
2223
"react-remove-scroll": "^2.0.4",
2324
"react-select": "^3.0.8",
@@ -66,6 +67,7 @@
6667
"devDependencies": {
6768
"@babel/cli": "^7.2.3",
6869
"@babel/core": "^7.2.2",
70+
"@babel/plugin-proposal-optional-chaining": "^7.10.4",
6971
"@storybook/addon-actions": "^5.3.14",
7072
"@storybook/addon-links": "^5.3.14",
7173
"@storybook/addons": "^5.3.14",
@@ -76,7 +78,7 @@
7678
"prettier": "^2.0.5",
7779
"raw.macro": "^0.3.0",
7880
"react-github-btn": "^1.1.1",
79-
"react-scripts": "^2.1.8"
81+
"react-scripts": "^3.4.1"
8082
},
8183
"prettier": {
8284
"semi": false

src/Annotator/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ export const Annotator = ({
7979
onPrevImage,
8080
autoSegmentationOptions = { type: "autoseg" },
8181
}: Props) => {
82-
if (!images && !videoSrc)
83-
return 'Missing required prop "images" or "videoSrc"'
8482
const annotationType = images ? "image" : "video"
8583
const [state, dispatchToReducer] = useReducer(
8684
historyHandler(
@@ -152,6 +150,9 @@ export const Annotator = ({
152150
})
153151
}, [selectedImage])
154152

153+
if (!images && !videoSrc)
154+
return 'Missing required prop "images" or "videoSrc"'
155+
155156
return (
156157
<SettingsProvider>
157158
<MainLayout

src/FullImageSegmentationAnnotator/index.story.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import FullImageSegmentationAnnotator from "./"
1313

1414
storiesOf("FullImageSegmentationAnnotator.Basic", module)
1515
.add("Orange 2 Class", () => (
16-
<div style={{ width: "100vw", height: "100vh" }}>
16+
<div style={{ width: "95vw", height: "95vh" }}>
1717
<FullImageSegmentationAnnotator
1818
images={[
1919
{
@@ -59,7 +59,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
5959
</div>
6060
))
6161
.add("S3 CORS domain", () => (
62-
<div style={{ width: "100vw", height: "100vh" }}>
62+
<div style={{ width: "95vw", height: "95vh" }}>
6363
<FullImageSegmentationAnnotator
6464
images={[
6565
{
@@ -90,7 +90,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
9090
</div>
9191
))
9292
.add("Orange 3 Class", () => (
93-
<div style={{ width: "100vw", height: "100vh" }}>
93+
<div style={{ width: "95vw", height: "95vh" }}>
9494
<FullImageSegmentationAnnotator
9595
images={[
9696
{
@@ -120,7 +120,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
120120
</div>
121121
))
122122
.add("Hard 1, 8 Class, Simple Mode", () => (
123-
<div style={{ width: "100vw", height: "100vh" }}>
123+
<div style={{ width: "95vw", height: "95vh" }}>
124124
<FullImageSegmentationAnnotator
125125
images={[
126126
{
@@ -135,7 +135,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
135135
</div>
136136
))
137137
.add("Hard 1, 8 Class", () => (
138-
<div style={{ width: "100vw", height: "100vh" }}>
138+
<div style={{ width: "95vw", height: "95vh" }}>
139139
<FullImageSegmentationAnnotator
140140
images={[
141141
{
@@ -149,7 +149,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
149149
</div>
150150
))
151151
.add("Hard 2, 8 Class", () => (
152-
<div style={{ width: "100vw", height: "100vh" }}>
152+
<div style={{ width: "95vw", height: "95vh" }}>
153153
<FullImageSegmentationAnnotator
154154
images={[
155155
{
@@ -163,7 +163,7 @@ storiesOf("FullImageSegmentationAnnotator.Basic", module)
163163
</div>
164164
))
165165
.add("Hard 3, 8 Class", () => (
166-
<div style={{ width: "100vw", height: "100vh" }}>
166+
<div style={{ width: "95vw", height: "95vh" }}>
167167
<FullImageSegmentationAnnotator
168168
images={[
169169
{

src/Header/index.js

-107
This file was deleted.

src/Header/styles.js

-25
This file was deleted.

src/HeaderButton/index.js

-54
This file was deleted.

src/ImageMask/index.story.js

-46
This file was deleted.

src/KeyframeTimeline/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const Container = styled("div")({
1414
display: "flex",
1515
flexGrow: 1,
1616
minWidth: 240,
17+
height: 64,
1718
marginLeft: 16,
1819
marginRight: 16,
1920
})

0 commit comments

Comments
 (0)