Skip to content

Commit f829532

Browse files
committed
[#3144] : Remove legacyTheme
1 parent e609e0e commit f829532

File tree

83 files changed

+3214
-3316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3214
-3316
lines changed

Diff for: src/apps/blocks/index.tsx

+36-38
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,42 @@ import { BlockItem } from "./views/BlockItem";
1010

1111
export const BlocksApp = () => {
1212
return (
13-
<ThemeProvider theme={theme}>
14-
<Box
15-
sx={{
16-
color: "text.primary",
17-
backgroundColor: "background.paper",
18-
height: "100%",
19-
display: "flex",
20-
"*": {
21-
boxSizing: "border-box",
22-
},
23-
}}
13+
<Box
14+
sx={{
15+
color: "text.primary",
16+
backgroundColor: "background.paper",
17+
height: "100%",
18+
display: "flex",
19+
"*": {
20+
boxSizing: "border-box",
21+
},
22+
}}
23+
>
24+
<ResizableContainer
25+
id="blocksNav"
26+
defaultWidth={220}
27+
minWidth={220}
28+
maxWidth={360}
2429
>
25-
<ResizableContainer
26-
id="blocksNav"
27-
defaultWidth={220}
28-
minWidth={220}
29-
maxWidth={360}
30-
>
31-
<Sidebar />
32-
</ResizableContainer>
33-
<Switch>
34-
<Route exact path="/blocks" render={() => <AllBlocks />} />
35-
<Route
36-
path="/blocks/:modelZUID/new"
37-
render={({ match }) => (
38-
<BlockItem isCreate key={match.params.modelZUID} />
39-
)}
40-
/>
41-
<Route
42-
path="/blocks/:modelZUID/:itemZUID"
43-
render={({ match }) => <BlockItem key={match.params.itemZUID} />}
44-
/>
45-
<Route
46-
path="/blocks/:modelZUID"
47-
render={({ match }) => <BlockModel key={match.params.modelZUID} />}
48-
/>
49-
</Switch>
50-
</Box>
51-
</ThemeProvider>
30+
<Sidebar />
31+
</ResizableContainer>
32+
<Switch>
33+
<Route exact path="/blocks" render={() => <AllBlocks />} />
34+
<Route
35+
path="/blocks/:modelZUID/new"
36+
render={({ match }) => (
37+
<BlockItem isCreate key={match.params.modelZUID} />
38+
)}
39+
/>
40+
<Route
41+
path="/blocks/:modelZUID/:itemZUID"
42+
render={({ match }) => <BlockItem key={match.params.itemZUID} />}
43+
/>
44+
<Route
45+
path="/blocks/:modelZUID"
46+
render={({ match }) => <BlockModel key={match.params.modelZUID} />}
47+
/>
48+
</Switch>
49+
</Box>
5250
);
5351
};

Diff for: src/apps/blocks/views/BlockItem.tsx

+10-14
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { useDispatch } from "react-redux";
55
import { useEffect, useState } from "react";
66
import { useParams } from "react-router";
77
import { ItemCreate } from "../../content-editor/src/app/views/ItemCreate";
8-
import { customTheme } from "../../content-editor/src/app/ContentEditor";
9-
import { ThemeProvider } from "@mui/material/styles";
108

119
export const BlockItem = ({ isCreate }: { isCreate?: boolean }) => {
1210
const dispatch = useDispatch();
@@ -36,17 +34,15 @@ export const BlockItem = ({ isCreate }: { isCreate?: boolean }) => {
3634
}
3735

3836
return (
39-
<ThemeProvider theme={customTheme}>
40-
<Box
41-
width="100%"
42-
sx={{
43-
"*": {
44-
boxSizing: "unset",
45-
},
46-
}}
47-
>
48-
{isCreate ? <ItemCreate /> : <ItemEdit />}
49-
</Box>
50-
</ThemeProvider>
37+
<Box
38+
width="100%"
39+
sx={{
40+
"*": {
41+
boxSizing: "unset",
42+
},
43+
}}
44+
>
45+
{isCreate ? <ItemCreate /> : <ItemEdit />}
46+
</Box>
5147
);
5248
};

Diff for: src/apps/code-editor/src/app/components/Differ/Differ.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
height: calc(100vh - 64px - 100px);
55

66
.EditorLayout {
7-
height: calc(100vh - 64px - 57px - 62px - 37px);
7+
height: calc(100vh - 64px - 85px);
88
}
99
}

Diff for: src/apps/code-editor/src/app/components/FileActions/FileActions.js

+82-53
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,24 @@ import { DifferActions } from "./components/DifferActions";
1919
import { EditorActions } from "./components/EditorActions";
2020
import { Delete } from "./components/Delete";
2121

22-
import styles from "./FileActions.less";
22+
import { Box, AppBar, IconButton, Typography, Divider } from "@mui/material";
2323
export const FileActions = memo(function FileActions(props) {
2424
const match = useRouteMatch("/code/file/:fileType/:fileZUID");
2525

2626
return (
27-
<header className={styles.FileActions}>
28-
<div className={styles.FileMeta}>
27+
<Box
28+
component="header"
29+
display="flex"
30+
flexDirection="row"
31+
justifyContent="space-between"
32+
alignItems="center"
33+
minHeight="42px"
34+
position="relative"
35+
zIndex={1}
36+
padding="8px 0 12px 0px"
37+
whiteSpace="nowrap"
38+
>
39+
<Box display="flex" alignItems="center" whiteSpace="nowrap" flexGrow={1}>
2940
{props.contentModelZUID ? (
3041
<Link
3142
underline="none"
@@ -38,38 +49,43 @@ export const FileActions = memo(function FileActions(props) {
3849
<FontAwesomeIcon icon={faBolt} />
3950
</Link>
4051
) : (
41-
<FontAwesomeIcon className={styles.FileLink} icon={faFileCode} />
52+
<Box sx={{ m: 0, pr: 2, pl: 3.25, py: 0 }}>
53+
<FontAwesomeIcon icon={faFileCode} />
54+
</Box>
4255
)}
4356

4457
<Switch>
4558
<Route path={`${match.url}`}>
46-
<div className={styles.QuickLinks}>
59+
<Box display="flex" flexDirection="row" alignItems="center">
4760
{props.contentModelZUID && (
4861
<Fragment>
62+
<Delete
63+
dispatch={props.dispatch}
64+
fileZUID={props.fileZUID}
65+
status={props.status}
66+
fileName={props.fileName}
67+
/>
4968
<AppLink
50-
className={styles.Link}
5169
to={`/content/${props.contentModelZUID}`}
5270
title="Edit Related Content"
5371
>
54-
<Button variant="contained" size="small">
72+
<IconButton size="small" sx={{ color: "grey.400" }}>
5573
<EditIcon fontSize="small" />
56-
</Button>
74+
</IconButton>
5775
</AppLink>
5876

5977
<AppLink
60-
className={styles.Link}
6178
to={`/schema/${props.contentModelZUID}`}
6279
title="Edit Related Model"
6380
>
64-
<Button variant="contained" size="small">
81+
<IconButton size="small" sx={{ color: "grey.400" }}>
6582
<StorageIcon fontSize="small" />
66-
</Button>
83+
</IconButton>
6784
</AppLink>
6885
</Fragment>
6986
)}
7087

7188
<AppLink
72-
className={styles.Link}
7389
to={`/code/file/${props.fileType}/${
7490
props.fileZUID
7591
}/diff/local,${
@@ -79,58 +95,71 @@ export const FileActions = memo(function FileActions(props) {
7995
}`}
8096
title="Diff Versions"
8197
>
82-
<Button variant="contained" size="small">
98+
<IconButton size="small" sx={{ color: "grey.400" }}>
8399
<HistoryIcon fontSize="small" />
84-
</Button>
100+
</IconButton>
85101
</AppLink>
86-
</div>
102+
</Box>
87103
</Route>
88104
</Switch>
89105

90-
<div className={styles.FileName}>
91-
<CopyButton variant="contained" size="small" value={props.fileZUID} />
92-
{props.fileName}
93-
</div>
94-
</div>
106+
<Box display="flex" alignItems="center" whiteSpace="nowrap">
107+
<CopyButton
108+
variant="text"
109+
value={props.fileZUID}
110+
sx={{
111+
color: "grey.400",
112+
fontSize: "12px",
113+
}}
114+
/>
115+
<Typography variant="body2" noWrap>
116+
{props.fileName}
117+
</Typography>
118+
</Box>
119+
</Box>
95120

96121
{!props.synced && (
97122
<Notice>
98123
There is a new remote version ahead of your local changes
99124
</Notice>
100125
)}
101126

102-
<Switch>
103-
<Route path={`${match.url}/diff`}>
104-
<DifferActions
105-
dispatch={props.dispatch}
106-
fileZUID={props.fileZUID}
107-
fileType={props.fileType}
108-
publishedVersion={props.publishedVersion}
109-
status={props.status}
110-
synced={props.synced}
111-
setVersionCodeLeft={props.setVersionCodeLeft}
112-
setVersionCodeRight={props.setVersionCodeRight}
113-
setLoading={props.setLoading}
114-
currentCode={props.currentCode}
115-
/>
116-
</Route>
117-
<Route path={`${match.url}`}>
118-
<EditorActions
119-
dispatch={props.dispatch}
120-
fileZUID={props.fileZUID}
121-
fileType={props.fileType}
122-
version={props.version}
123-
synced={props.synced}
124-
status={props.status}
125-
/>
126-
<Delete
127-
dispatch={props.dispatch}
128-
fileZUID={props.fileZUID}
129-
status={props.status}
130-
fileName={props.fileName}
131-
/>
132-
</Route>
133-
</Switch>
134-
</header>
127+
<Box
128+
display="flex"
129+
flexDirection="row"
130+
alignItems="center"
131+
justifyContent="space-between"
132+
flexGrow={0}
133+
px={1}
134+
>
135+
<Switch>
136+
<Route path={`${match.url}/diff`}>
137+
<DifferActions
138+
dispatch={props.dispatch}
139+
fileZUID={props.fileZUID}
140+
fileType={props.fileType}
141+
publishedVersion={props.publishedVersion}
142+
status={props.status}
143+
synced={props.synced}
144+
setVersionCodeLeft={props.setVersionCodeLeft}
145+
setVersionCodeRight={props.setVersionCodeRight}
146+
setLoading={props.setLoading}
147+
currentCode={props.currentCode}
148+
/>
149+
</Route>
150+
151+
<Route path={`${match.url}`}>
152+
<EditorActions
153+
dispatch={props.dispatch}
154+
fileZUID={props.fileZUID}
155+
fileType={props.fileType}
156+
version={props.version}
157+
synced={props.synced}
158+
status={props.status}
159+
/>
160+
</Route>
161+
</Switch>
162+
</Box>
163+
</Box>
135164
);
136165
});

Diff for: src/apps/code-editor/src/app/components/FileActions/FileActions.less

-58
This file was deleted.

0 commit comments

Comments
 (0)