Skip to content

Commit

Permalink
Migrate Conf
Browse files Browse the repository at this point in the history
  • Loading branch information
DerGoogler committed Oct 14, 2023
1 parent 85c6fba commit 3c4262b
Show file tree
Hide file tree
Showing 14 changed files with 1,164 additions and 206 deletions.
247 changes: 241 additions & 6 deletions Website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"@types/webpack": "^5.28.0"
},
"dependencies": {
"@babel/runtime": "^7.23.2",
"@babel/standalone": "^7.23.2",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@giscus/react": "^2.3.0",
Expand Down Expand Up @@ -83,6 +85,8 @@
"@babel/core": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@babel/preset-react": "^7.16.5",
"@types/babel__core": "^7.20.2",
"@types/babel__standalone": "^7.1.5",
"@types/fs-extra": "^11.0.1",
"@types/node": "^18.0.6",
"@types/object-assign": "^4.0.30",
Expand All @@ -103,6 +107,7 @@
"license-checker": "^25.0.1",
"mini-css-extract-plugin": "^2.5.3",
"postcss-loader": "^7.0.0",
"raw-loader": "^4.0.2",
"sass": "^1.49.8",
"sass-loader": "^13.0.2",
"style-loader": "^3.3.3",
Expand Down
13 changes: 4 additions & 9 deletions Website/src/activitys/ConfigureActivity.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Page } from "@Components/onsenui/Page";
import { Toolbar } from "@Components/onsenui/Toolbar";
import { useActivity } from "@Hooks/useActivity";
import { useStrings } from "@Hooks/useStrings";
import React from "react";
import { SuFile } from "@Native/SuFile";
import { useLog } from "@Hooks/native/useLog";
import { useTheme } from "@Hooks/useTheme";
import { useSettings } from "@Hooks/useSettings";
import { ConfigureView } from "@Components/ConfigureView";
import { PreviewErrorBoundary } from "./PlaygroundsActivity";

type Extra = {
raw_data?: string;
Expand All @@ -16,15 +14,12 @@ type Extra = {
};

const ConfigureActivity = () => {
const log = useLog("ConfigureActivity");
const { strings } = useStrings();
const { settings, modConf } = useSettings();
const { theme } = useTheme();
const { modConf } = useSettings();
const { context, extra } = useActivity<Extra>();

const config: string = React.useMemo(() => {
if (!extra.raw_data) {
const file = new SuFile(modConf("CONFIG", { MODID: extra.moduleid }));
const file = new SuFile(modConf("CONFINDEX", { MODID: extra.moduleid }));

if (file.exist()) {
return file.read();
Expand All @@ -49,7 +44,7 @@ const ConfigureActivity = () => {

return (
<Page renderToolbar={renderToolbar}>
<ConfigureView modid={extra.moduleid}>{config}</ConfigureView>
<PreviewErrorBoundary modid={extra.moduleid} children={config} renderElement={ConfigureView} />
</Page>
);
};
Expand Down
2 changes: 1 addition & 1 deletion Website/src/activitys/FetchTextActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useNetwork } from "@Hooks/useNetwork";
import { MissingInternet } from "@Components/MissingInternet";

export type FetchTextActivityExtra = {
rendering?(props: React.PropsWithChildren): React.JSX.Element;
rendering?: React.FunctionComponent<any> | React.ComponentType<any>;
modulename: string;
raw_data?: string;
url?: string;
Expand Down
Loading

0 comments on commit 3c4262b

Please sign in to comment.