Skip to content

Commit 1938eb7

Browse files
Theme: remove overwriteStyles switch
1 parent 8de6657 commit 1938eb7

File tree

1 file changed

+3
-45
lines changed
  • client/packages/lowcoder/src/pages/setting/theme/detail

1 file changed

+3
-45
lines changed

client/packages/lowcoder/src/pages/setting/theme/detail/index.tsx

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ type LocationProp = {
7676
name: string;
7777
id: string;
7878
type: DETAIL_TYPE;
79-
overwriteStyles?: boolean;
8079
};
8180

8281
type ThemeDetailPageProps = {
@@ -99,15 +98,14 @@ type ThemeDetailPageState = {
9998

10099
class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailPageState> {
101100
themeDefault: ThemeDetail;
102-
overwriteStyles: boolean;
103101
readonly id: string;
104102
readonly type: string;
105103
readonly inputRef: React.RefObject<InputRef>;
106104
footerRef = React.createRef<HTMLDivElement>();
107105

108106
constructor(props: ThemeDetailPageProps) {
109107
super(props);
110-
const { name, id, theme, type, overwriteStyles } = props.location.state || {};
108+
const { name, id, theme, type } = props.location.state || {};
111109
if (!name || !id || !theme || !type) {
112110
history.replace(BASE_URL);
113111
window.location.reload();
@@ -124,7 +122,6 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
124122

125123
this.id = id;
126124
this.type = type;
127-
this.overwriteStyles = Boolean(overwriteStyles);
128125
this.state = {
129126
theme,
130127
name,
@@ -138,36 +135,6 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
138135
this.setState({ theme: this.themeDefault });
139136
}
140137

141-
handleOverwriteStyles(overwriteStyles: boolean) {
142-
this.props.fetchCommonSettings(this.props.orgId, ({ themeList }) => {
143-
let list = [];
144-
const currentTheme = {
145-
name: this.state.name,
146-
id: this.id,
147-
updateTime: new Date().getTime(),
148-
theme: this.themeDefault,
149-
overwriteStyles: overwriteStyles,
150-
};
151-
list = themeList!.map((theme) => {
152-
if (theme.id === this.id) {
153-
return currentTheme;
154-
} else {
155-
return theme;
156-
}
157-
});
158-
159-
this.props.setCommonSettings({
160-
orgId: this.props.orgId,
161-
data: { key: "themeList", value: list },
162-
onSuccess: () => {
163-
messageInstance.success(trans("theme.saveSuccessMsg"));
164-
this.themeDefault = this.state.theme;
165-
this.overwriteStyles = overwriteStyles;
166-
},
167-
});
168-
});
169-
}
170-
171138
handleSave() {
172139
this.props.fetchCommonSettings(this.props.orgId, ({ themeList }) => {
173140
let list = [];
@@ -376,15 +343,6 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
376343
<ArrowIcon />
377344
<span>{this.state.name}</span>
378345
</HeaderBack>
379-
<Flex gap={8}>
380-
<b style={{margin: 0}}>
381-
Overwrite styles
382-
</b>
383-
<Switch defaultValue={this.overwriteStyles} onChange={() => {
384-
console.log('change');
385-
this.handleOverwriteStyles(!this.overwriteStyles)
386-
}}/>
387-
</Flex>
388346
</Header>
389347

390348
<DetailContent>
@@ -586,7 +544,7 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
586544
</Card>
587545
</ThemeSettingsView>
588546

589-
{/* <ThemeSettingsView>
547+
<ThemeSettingsView>
590548
<StyleThemeSettingsCover>
591549
<ChartCompIcon width={"36px"} style={{marginRight : "10px"}}/> <h2 style={{color: "#ffffff", marginTop : "8px"}}> {trans("theme.charts")}</h2>
592550
</StyleThemeSettingsCover>
@@ -618,7 +576,7 @@ class ThemeDetailPage extends React.Component<ThemeDetailPageProps, ThemeDetailP
618576
<PreviewApp style={{ height: "380px", width: "100%", margin: "0" }} theme={this.state.theme} dsl={chartDsl} />
619577
</Flex>
620578
</Card>
621-
</ThemeSettingsView> */}
579+
</ThemeSettingsView>
622580

623581
</DetailContent>
624582

0 commit comments

Comments
 (0)