소스 검색

:fire: 废弃的前端框架

visuddhinanda 2 년 전
부모
커밋
583e1f9333
51개의 변경된 파일1개의 추가작업 그리고 1195개의 파일을 삭제
  1. 1 1
      documents/laravel_quick_start.md
  2. 0 13
      material-ui/.gitignore
  3. 0 13
      material-ui/README.md
  4. 0 77
      material-ui/package.json
  5. BIN
      material-ui/public/favicon.ico
  6. 0 43
      material-ui/public/index.html
  7. BIN
      material-ui/public/logo192.png
  8. BIN
      material-ui/public/logo512.png
  9. 0 25
      material-ui/public/manifest.json
  10. 0 3
      material-ui/public/robots.txt
  11. 0 10
      material-ui/src/404.tsx
  12. 0 22
      material-ui/src/components/form.tsx
  13. 0 5
      material-ui/src/hooks.ts
  14. 0 4
      material-ui/src/index.css
  15. 0 51
      material-ui/src/index.tsx
  16. 0 65
      material-ui/src/layouts/Copyright.tsx
  17. 0 40
      material-ui/src/layouts/application/index.tsx
  18. 0 5
      material-ui/src/layouts/dashboard/index.tsx
  19. 0 28
      material-ui/src/locales/en-US.ts
  20. 0 30
      material-ui/src/locales/index.ts
  21. 0 5
      material-ui/src/locales/zh-Hans.ts
  22. 0 5
      material-ui/src/locales/zh-Hant.ts
  23. 0 2
      material-ui/src/logo.svg
  24. 0 32
      material-ui/src/plugins/demo/index.tsx
  25. 0 6
      material-ui/src/plugins/demo/posts/edit.tsx
  26. 0 6
      material-ui/src/plugins/demo/posts/index.tsx
  27. 0 6
      material-ui/src/plugins/demo/posts/new.tsx
  28. 0 6
      material-ui/src/plugins/demo/topics/edit.tsx
  29. 0 6
      material-ui/src/plugins/demo/topics/index.tsx
  30. 0 6
      material-ui/src/plugins/demo/topics/new.tsx
  31. 0 16
      material-ui/src/plugins/index.tsx
  32. 0 25
      material-ui/src/plugins/nut/home.tsx
  33. 0 36
      material-ui/src/plugins/nut/index.tsx
  34. 0 130
      material-ui/src/plugins/nut/install.tsx
  35. 0 103
      material-ui/src/plugins/nut/users/NonSignInLayout.tsx
  36. 0 33
      material-ui/src/plugins/nut/users/confirm.tsx
  37. 0 33
      material-ui/src/plugins/nut/users/forgot-password.tsx
  38. 0 6
      material-ui/src/plugins/nut/users/logs.tsx
  39. 0 6
      material-ui/src/plugins/nut/users/reset-password.tsx
  40. 0 43
      material-ui/src/plugins/nut/users/sign-in.tsx
  41. 0 70
      material-ui/src/plugins/nut/users/sign-up.tsx
  42. 0 33
      material-ui/src/plugins/nut/users/unlock.tsx
  43. 0 6
      material-ui/src/plugins/nut/users/update-profile.tsx
  44. 0 1
      material-ui/src/react-app-env.d.ts
  45. 0 40
      material-ui/src/reducers/current-user.ts
  46. 0 35
      material-ui/src/reducers/site-info.ts
  47. 0 15
      material-ui/src/reportWebVitals.ts
  48. 0 1
      material-ui/src/request.ts
  49. 0 5
      material-ui/src/setupTests.ts
  50. 0 17
      material-ui/src/store.ts
  51. 0 26
      material-ui/tsconfig.json

+ 1 - 1
documents/laravel_quick_start.md

@@ -54,5 +54,5 @@ php artisan make:controller --api --model=Lesson  LessonController
 
 前端调用
 
-ApiFetch(`/progress?view=chapter-tag`)
+
 

+ 0 - 13
material-ui/.gitignore

@@ -1,13 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules/
-/yarn.lock
-
-# testing
-
-# production
-/build/
-
-# misc
-/.env.*.local

+ 0 - 13
material-ui/README.md

@@ -1,13 +0,0 @@
-# Dashboard
-
-## Install dependencies
-
-```bash
-yarn install
-```
-
-### `yarn start`
-
-Runs the app in the development mode. Open [http://localhost:3000/my/](http://localhost:3000/my/) to view it in the browser.
-
-The page will reload if you make edits. You will also see any lint errors in the console.

+ 0 - 77
material-ui/package.json

@@ -1,77 +0,0 @@
-{
-    "name": "iapt",
-    "version": "0.1.0",
-    "private": true,
-    "homepage": "/my/",
-    "dependencies": {
-        "@emotion/react": "^11.8.2",
-        "@emotion/styled": "^11.8.1",
-        "@fontsource/roboto": "^4.5.3",
-        "@loadable/component": "^5.15.2",
-        "@mui/icons-material": "^5.5.0",
-        "@mui/material": "^5.5.0",
-        "@reduxjs/toolkit": "^1.8.0",
-        "@testing-library/jest-dom": "^5.14.1",
-        "@testing-library/react": "^12.0.0",
-        "@testing-library/user-event": "^13.2.1",
-        "@types/jest": "^27.0.1",
-        "@types/loadable__component": "^5.13.4",
-        "@types/node": "^16.7.13",
-        "@types/react": "^17.0.20",
-        "@types/react-dom": "^17.0.9",
-        "@types/react-redux": "^7.1.23",
-        "dinero.js": "^2.0.0-alpha.8",
-        "emoji-mart": "^3.0.1",
-        "google-map-react": "^2.1.10",
-        "js-cookie": "^3.0.1",
-        "jwt-decode": "^3.1.2",
-        "material-design-icons": "^3.0.1",
-        "moment": "^2.29.1",
-        "moment-timezone": "^0.5.34",
-        "qrcode.react": "^2.0.0",
-        "react": "^17.0.2",
-        "react-color": "^2.19.3",
-        "react-copy-to-clipboard": "^5.0.4",
-        "react-dom": "^17.0.2",
-        "react-dropzone": "^12.0.4",
-        "react-helmet-async": "^1.2.3",
-        "react-highlight-words": "^0.17.0",
-        "react-hook-form": "^7.27.1",
-        "react-intl": "^5.24.6",
-        "react-json-view": "^1.21.3",
-        "react-markdown": "^8.0.0",
-        "react-quill": "^2.0.0-beta.4",
-        "react-redux": "^7.2.6",
-        "react-router-dom": "6",
-        "react-scripts": "5.0.0",
-        "react-sparklines": "^1.7.0",
-        "react-syntax-highlighter": "^15.4.5",
-        "typescript": "^4.4.2",
-        "video.js": "^7.17.0",
-        "web-vitals": "^2.1.0"
-    },
-    "scripts": {
-        "start": "react-scripts start",
-        "build": "react-scripts build",
-        "test": "react-scripts test",
-        "eject": "react-scripts eject"
-    },
-    "eslintConfig": {
-        "extends": [
-            "react-app",
-            "react-app/jest"
-        ]
-    },
-    "browserslist": {
-        "production": [
-            ">0.2%",
-            "not dead",
-            "not op_mini all"
-        ],
-        "development": [
-            "last 1 chrome version",
-            "last 1 firefox version",
-            "last 1 safari version"
-        ]
-    }
-}

BIN
material-ui/public/favicon.ico


+ 0 - 43
material-ui/public/index.html

@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8" />
-    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
-    <meta name="theme-color" content="#000000" />
-    <meta
-      name="description"
-      content="Web site created using create-react-app"
-    />
-    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
-    <!--
-      manifest.json provides metadata used when your web app is installed on a
-      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-    -->
-    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
-    <!--
-      Notice the use of %PUBLIC_URL% in the tags above.
-      It will be replaced with the URL of the `public` folder during the build.
-      Only files inside the `public` folder can be referenced from the HTML.
-
-      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
-      work correctly both with client-side routing and a non-root public URL.
-      Learn how to configure a non-root public URL by running `npm run build`.
-    -->
-    <title>React App</title>
-  </head>
-  <body>
-    <noscript>You need to enable JavaScript to run this app.</noscript>
-    <div id="root"></div>
-    <!--
-      This HTML file is a template.
-      If you open it directly in the browser, you will see an empty page.
-
-      You can add webfonts, meta tags, or analytics to this file.
-      The build step will place the bundled scripts into the <body> tag.
-
-      To begin the development, run `npm start` or `yarn start`.
-      To create a production bundle, use `npm run build` or `yarn build`.
-    -->
-  </body>
-</html>

BIN
material-ui/public/logo192.png


BIN
material-ui/public/logo512.png


+ 0 - 25
material-ui/public/manifest.json

@@ -1,25 +0,0 @@
-{
-  "short_name": "React App",
-  "name": "Create React App Sample",
-  "icons": [
-    {
-      "src": "favicon.ico",
-      "sizes": "64x64 32x32 24x24 16x16",
-      "type": "image/x-icon"
-    },
-    {
-      "src": "logo192.png",
-      "type": "image/png",
-      "sizes": "192x192"
-    },
-    {
-      "src": "logo512.png",
-      "type": "image/png",
-      "sizes": "512x512"
-    }
-  ],
-  "start_url": ".",
-  "display": "standalone",
-  "theme_color": "#000000",
-  "background_color": "#ffffff"
-}

+ 0 - 3
material-ui/public/robots.txt

@@ -1,3 +0,0 @@
-# https://www.robotstxt.org/robotstxt.html
-User-agent: *
-Disallow:

+ 0 - 10
material-ui/src/404.tsx

@@ -1,10 +0,0 @@
-import { useIntl } from "react-intl";
-
-import Layout from "./layouts/application";
-
-function Widget() {
-  const intl = useIntl();
-  return <Layout title={intl.formatMessage({ id: "404.title" })}>aaa</Layout>;
-}
-
-export default Widget;

+ 0 - 22
material-ui/src/components/form.tsx

@@ -1,22 +0,0 @@
-export const REAL_NAME_VALIDATOR = {
-  required: true,
-  minLength: 2,
-  maxLength: 32,
-};
-export const NICK_NAME_VALIDATOR = {
-  required: true,
-  minLength: 2,
-  maxLength: 32,
-  pattern: /[\\.\w-]{6,32}/,
-};
-export const EMAIL_VALIDATOR = {
-  required: true,
-  minLength: 6,
-  maxLength: 255,
-  pattern: /^[\\.a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
-};
-export const PASSWORD_VALIDATOR = {
-  required: true,
-  minLength: 6,
-  maxLength: 64,
-};

+ 0 - 5
material-ui/src/hooks.ts

@@ -1,5 +0,0 @@
-import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
-import type { RootState, AppDispatch } from "./store";
-
-export const useAppDispatch = () => useDispatch<AppDispatch>();
-export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

+ 0 - 4
material-ui/src/index.css

@@ -1,4 +0,0 @@
-body {
-  margin: 0;
-  padding: 0;
-}

+ 0 - 51
material-ui/src/index.tsx

@@ -1,51 +0,0 @@
-import "@fontsource/roboto/300.css";
-import "@fontsource/roboto/400.css";
-import "@fontsource/roboto/500.css";
-import "@fontsource/roboto/700.css";
-import "material-design-icons/iconfont/material-icons.css";
-import "react-quill/dist/quill.snow.css";
-
-import "./index.css";
-
-import React from "react";
-import ReactDOM from "react-dom";
-import { IntlProvider } from "react-intl";
-import { BrowserRouter, Route, Routes } from "react-router-dom";
-import { Provider } from "react-redux";
-import CachedOutlinedIcon from "@mui/icons-material/CachedOutlined";
-import loadable from "@loadable/component";
-
-import plugins from "./plugins";
-import { get as getLocale, messages as getMessages } from "./locales";
-import NotFound from "./404";
-import reportWebVitals from "./reportWebVitals";
-import store from "./store";
-
-const lang = getLocale();
-const messages = getMessages(lang);
-
-ReactDOM.render(
-  <React.StrictMode>
-    <Provider store={store}>
-      <IntlProvider messages={messages} locale={lang}>
-        <BrowserRouter basename="/my/">
-          <Routes>
-            {plugins.routes.map((it) => {
-              const W = loadable(it.component, {
-                fallback: <CachedOutlinedIcon />,
-              });
-              return <Route key={it.path} path={it.path} element={<W />} />;
-            })}
-            <Route path="*" element={<NotFound />} />
-          </Routes>
-        </BrowserRouter>
-      </IntlProvider>
-    </Provider>
-  </React.StrictMode>,
-  document.getElementById("root")
-);
-
-// If you want to start measuring performance in your app, pass a function
-// to log results (for example: reportWebVitals(console.log))
-// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
-reportWebVitals();

+ 0 - 65
material-ui/src/layouts/Copyright.tsx

@@ -1,65 +0,0 @@
-import Typography from "@mui/material/Typography";
-import Link from "@mui/material/Link";
-import GitHubIcon from "@mui/icons-material/GitHub";
-import HomeIcon from "@mui/icons-material/Home";
-import { FormattedMessage } from "react-intl";
-import Stack from "@mui/material/Stack";
-import { Helmet } from "react-helmet-async";
-
-import { refresh, selectSiteInfo } from "../reducers/site-info";
-import { useAppSelector, useAppDispatch } from "../hooks";
-import { set as setLocale } from "../locales";
-
-interface IProps {
-    title: string;
-}
-
-const Widget = (props: IProps) => {
-    const site = useAppSelector(selectSiteInfo);
-    const dispatch = useAppDispatch();
-    if (site.languages.length === 0) {
-        dispatch(
-            refresh({
-                title: "demo",
-                subhead: "test",
-                copyright: `${new Date().getFullYear()}`,
-                languages: ["en-US"],
-            })
-        );
-    }
-    return (
-        <Stack spacing={2} direction="row">
-            <Helmet>
-                <title>
-                    {props.title} | {site.title}
-                </title>
-            </Helmet>
-            <Typography variant="body2" color="text.secondary" align="center">
-                ©{site.copyright}
-            </Typography>
-            <Link
-                color="inherit"
-                target="_blank"
-                href="https://github.com/iapt-platform/mint"
-            >
-                <GitHubIcon />
-            </Link>
-            <Link color="inherit" target="_blank" href="/">
-                <HomeIcon />
-            </Link>
-            {site.languages.map((it) => (
-                <Link
-                    onClick={() => {
-                        setLocale(it);
-                        window.location.reload();
-                    }}
-                    key={it}
-                >
-                    <FormattedMessage id={`languages.${it}`} />
-                </Link>
-            ))}
-        </Stack>
-    );
-};
-
-export default Widget;

+ 0 - 40
material-ui/src/layouts/application/index.tsx

@@ -1,40 +0,0 @@
-import { ReactNode } from "react";
-import CssBaseline from "@mui/material/CssBaseline";
-import Box from "@mui/material/Box";
-import Container from "@mui/material/Container";
-import { createTheme, ThemeProvider } from "@mui/material/styles";
-import { HelmetProvider } from "react-helmet-async";
-
-import Copyright from "../Copyright";
-
-const theme = createTheme();
-
-interface IProps {
-  title: string;
-  children: ReactNode;
-}
-
-function Widget({ title, children }: IProps) {
-  return (
-    <HelmetProvider>
-      <ThemeProvider theme={theme}>
-        <Container component="main" maxWidth="xs">
-          <CssBaseline />
-          <Box
-            sx={{
-              marginTop: 8,
-              display: "flex",
-              flexDirection: "column",
-              alignItems: "center",
-            }}
-          >
-            {children}
-          </Box>
-          <Copyright title={title} />
-        </Container>
-      </ThemeProvider>
-    </HelmetProvider>
-  );
-}
-
-export default Widget;

+ 0 - 5
material-ui/src/layouts/dashboard/index.tsx

@@ -1,5 +0,0 @@
-function Widget() {
-  return <div>dashboard layout</div>;
-}
-
-export default Widget;

+ 0 - 28
material-ui/src/locales/en-US.ts

@@ -1,28 +0,0 @@
-const items = {
-  "buttons.search": "Search",
-  "buttons.submit": "Submit",
-
-  "fields.email": "Email address",
-  "fields.real-name": "Real name",
-  "fields.nick-name": "Nick name",
-  "fields.password": "Password",
-  "fields.password-confirmation": "Password confirmation",
-  "fields.body": "Body",
-
-  "helpers.real-name": "Real-name's length should between 2~32",
-  "helpers.email": "Please entry a valid email address",
-  "helpers.password": "Password's length should between 6~64",
-  "helpers.password-confirmation": "Passwords not match",
-
-  "404.title": "Not found",
-
-  "nut.install.title": "Install",
-  "nut.users.sign-in.title": "Sign in",
-  "nut.users.sign-up.title": "Sign Up",
-  "nut.users.confirm.title": "Resend confirmation instructions",
-  "nut.users.unlock.title": "Resend unlock instructions",
-  "nut.users.forgot-password.title": "Forgot your password?",
-  "nut.leave-words.new.title": "Leave us a message",
-};
-
-export default items;

+ 0 - 30
material-ui/src/locales/index.ts

@@ -1,30 +0,0 @@
-import enUS from "./en-US";
-import zhHans from "./zh-Hans";
-import zhHant from "./zh-Hant";
-
-const KEY = "locale";
-
-export const get = (): string => {
-  return localStorage.getItem(KEY) || "en-US";
-};
-
-export const set = (lang: string) => {
-  localStorage.setItem(KEY, lang);
-};
-
-const languages = {
-  "languages.en-US": "English",
-  "languages.zh-Hans": "简体中文",
-  "languages.zh-Hant": "繁體中文",
-};
-
-export const messages = (lang: string): any => {
-  switch (lang) {
-    case "zh-Hans":
-      return { ...languages, ...zhHans };
-    case "zh-Hant":
-      return { ...languages, ...zhHant };
-    default:
-      return { ...languages, ...enUS };
-  }
-};

+ 0 - 5
material-ui/src/locales/zh-Hans.ts

@@ -1,5 +0,0 @@
-const items = {
-  "buttons.search": "搜索",
-};
-
-export default items;

+ 0 - 5
material-ui/src/locales/zh-Hant.ts

@@ -1,5 +0,0 @@
-const items = {
-  "buttons.search": "檢索",
-};
-
-export default items;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 2
material-ui/src/logo.svg


+ 0 - 32
material-ui/src/plugins/demo/index.tsx

@@ -1,32 +0,0 @@
-import { IPlugin } from "..";
-
-export const plugin: IPlugin = {
-    routes: [
-        {
-            path: "/demo/topics/new",
-            component: () => import("./topics/new"),
-        },
-        {
-            path: "/demo/topics/edit",
-            component: () => import("./topics/edit"),
-        },
-        {
-            path: "/demo/topics",
-            component: () => import("./topics/index"),
-        },
-        {
-            path: "/demo/posts/new",
-            component: () => import("./posts/new"),
-        },
-        {
-            path: "/demo/posts/edit",
-            component: () => import("./posts/edit"),
-        },
-        {
-            path: "/demo/posts",
-            component: () => import("./posts/index"),
-        },
-    ],
-};
-
-export default plugin;

+ 0 - 6
material-ui/src/plugins/demo/posts/edit.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-    // TODO
-    return <div>demo posts edit</div>;
-}
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/demo/posts/index.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-    // TODO
-    return <div>demo posts index </div>;
-}
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/demo/posts/new.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-    // TODO
-    return <div>demo posts new</div>;
-}
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/demo/topics/edit.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-    // TODO
-    return <div>demo topics edit</div>;
-}
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/demo/topics/index.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-    // TODO
-    return <div>demo topics index</div>;
-}
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/demo/topics/new.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-    // TODO
-    return <div>demo topics new</div>;
-}
-
-export default Widget;

+ 0 - 16
material-ui/src/plugins/index.tsx

@@ -1,16 +0,0 @@
-import nut from "./nut";
-import demo from "./demo";
-
-export interface IRoute {
-    path: string;
-    component: any;
-}
-
-export interface IPlugin {
-    routes: IRoute[];
-}
-
-const plugin: IPlugin = {
-    routes: [...demo.routes, ...nut.routes],
-};
-export default plugin;

+ 0 - 25
material-ui/src/plugins/nut/home.tsx

@@ -1,25 +0,0 @@
-import { FormattedMessage } from "react-intl";
-import { Link } from "react-router-dom";
-
-function Widget() {
-  // TODO
-  return (
-    <div>
-      home of <FormattedMessage id="languages.zh-Hant" />
-      <ol>
-        <li>
-          <Link to="/users/sign-in">Sign In</Link>
-        </li>
-        <li>
-          <Link to="/users/sign-up">Sign up</Link>
-        </li>
-        <li>
-          <Link to="/install">install</Link>
-        </li>
-        <li></li>
-      </ol>
-    </div>
-  );
-}
-
-export default Widget;

+ 0 - 36
material-ui/src/plugins/nut/index.tsx

@@ -1,36 +0,0 @@
-import { IPlugin } from "..";
-
-const plugin: IPlugin = {
-    routes: [
-        {
-            path: "/users/forgot-password",
-            component: () => import("./users/forgot-password"),
-        },
-        {
-            path: "/users/unlock",
-            component: () => import("./users/unlock"),
-        },
-        {
-            path: "/users/confirm",
-            component: () => import("./users/confirm"),
-        },
-        {
-            path: "/users/sign-in",
-            component: () => import("./users/sign-in"),
-        },
-        {
-            path: "/users/sign-up",
-            component: () => import("./users/sign-up"),
-        },
-        {
-            path: "/install",
-            component: () => import("./install"),
-        },
-        {
-            path: "/",
-            component: () => import("./home"),
-        },
-    ],
-};
-
-export default plugin;

+ 0 - 130
material-ui/src/plugins/nut/install.tsx

@@ -1,130 +0,0 @@
-import TextField from "@mui/material/TextField";
-import Grid from "@mui/material/Grid";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-import { useForm, Controller, SubmitHandler } from "react-hook-form";
-import { useIntl } from "react-intl";
-
-import Layout from "./users/NonSignInLayout";
-import {
-  REAL_NAME_VALIDATOR,
-  EMAIL_VALIDATOR,
-  PASSWORD_VALIDATOR,
-} from "../../components/form";
-
-interface IFormData {
-  realName: string;
-  email: string;
-  password: string;
-  passwordConfirmation: string;
-}
-
-const Widget = () => {
-  const intl = useIntl();
-  const {
-    control,
-    formState: { errors },
-    handleSubmit,
-  } = useForm<IFormData>({
-    defaultValues: {
-      realName: "",
-      email: "",
-      password: "",
-      passwordConfirmation: "",
-    },
-  });
-  const onSubmit: SubmitHandler<IFormData> = (data) => {
-    // TODO
-    console.log(data);
-  };
-  return (
-    <Layout
-      logo={<LockOutlinedIcon />}
-      title={intl.formatMessage({ id: "nut.install.title" })}
-      handleSubmit={handleSubmit(onSubmit)}
-    >
-      <Grid item xs={12}>
-        <Controller
-          name="realName"
-          control={control}
-          rules={REAL_NAME_VALIDATOR}
-          render={({ field }) => (
-            <TextField
-              required
-              fullWidth
-              label={intl.formatMessage({ id: "fields.real-name" })}
-              error={errors.realName !== undefined}
-              helperText={
-                errors.realName &&
-                intl.formatMessage({ id: "helpers.real-name" })
-              }
-              {...field}
-            />
-          )}
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <Controller
-          name="email"
-          rules={EMAIL_VALIDATOR}
-          control={control}
-          render={({ field }) => (
-            <TextField
-              required
-              fullWidth
-              label={intl.formatMessage({ id: "fields.email" })}
-              type="email"
-              error={errors.email !== undefined}
-              helperText={
-                errors.email && intl.formatMessage({ id: "helpers.email" })
-              }
-              {...field}
-            />
-          )}
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <Controller
-          name="password"
-          rules={PASSWORD_VALIDATOR}
-          control={control}
-          render={({ field }) => (
-            <TextField
-              required
-              fullWidth
-              label={intl.formatMessage({ id: "fields.password" })}
-              type="password"
-              error={errors.password !== undefined}
-              helperText={
-                errors.password &&
-                intl.formatMessage({ id: "helpers.password" })
-              }
-              {...field}
-            />
-          )}
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <Controller
-          name="passwordConfirmation"
-          control={control}
-          render={({ field }) => (
-            <TextField
-              required
-              fullWidth
-              label={intl.formatMessage({ id: "fields.password-confirmation" })}
-              type="password"
-              error={errors.passwordConfirmation !== undefined}
-              helperText={
-                errors.passwordConfirmation &&
-                intl.formatMessage({ id: "helpers.password-confirmation" })
-              }
-              {...field}
-            />
-          )}
-        />
-      </Grid>
-    </Layout>
-  );
-};
-
-export default Widget;

+ 0 - 103
material-ui/src/plugins/nut/users/NonSignInLayout.tsx

@@ -1,103 +0,0 @@
-import { ReactNode } from "react";
-import Button from "@mui/material/Button";
-import Grid from "@mui/material/Grid";
-import Box from "@mui/material/Box";
-import Avatar from "@mui/material/Avatar";
-import Typography from "@mui/material/Typography";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-import PersonPinOutlinedIcon from "@mui/icons-material/PersonPinOutlined";
-import PersonAddAltOutlinedIcon from "@mui/icons-material/PersonAddAltOutlined";
-import ConfirmationNumberOutlinedIcon from "@mui/icons-material/ConfirmationNumberOutlined";
-import PasswordOutlinedIcon from "@mui/icons-material/PasswordOutlined";
-import ListItemIcon from "@mui/material/ListItemIcon";
-import ListItemText from "@mui/material/ListItemText";
-import List from "@mui/material/List";
-import ListItem from "@mui/material/ListItem";
-import ListItemButton from "@mui/material/ListItemButton";
-import { useNavigate } from "react-router-dom";
-import { FormattedMessage } from "react-intl";
-
-import Layout from "../../../layouts/application";
-
-const shared_links = [
-    {
-        to: "/users/sign-in",
-        label: "nut.users.sign-in.title",
-        icon: <PersonPinOutlinedIcon />,
-    },
-    {
-        to: "/users/sign-up",
-        label: "nut.users.sign-up.title",
-        icon: <PersonAddAltOutlinedIcon />,
-    },
-    {
-        to: "/users/confirm",
-        label: "nut.users.confirm.title",
-        icon: <ConfirmationNumberOutlinedIcon />,
-    },
-    {
-        to: "/users/unlock",
-        label: "nut.users.unlock.title",
-        icon: <LockOutlinedIcon />,
-    },
-    {
-        to: "/users/forgot-password",
-        label: "nut.users.forgot-password.title",
-        icon: <PasswordOutlinedIcon />,
-    },
-];
-interface IProps {
-    title: string;
-    children: ReactNode;
-    logo: ReactNode;
-    handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
-}
-
-function Widget({ title, logo, children, handleSubmit }: IProps) {
-    // const onSubmit = (event: React.FormEvent<HTMLFormElement>) => {
-    //   event.preventDefault();
-    //   const data = new FormData(event.currentTarget);
-    //   handleSubmit(data);
-    // };
-    const navigate = useNavigate();
-    return (
-        <Layout title={title}>
-            <Avatar sx={{ bgcolor: "secondary.main" }}>{logo}</Avatar>
-            <Typography component="h1" variant="h5">
-                {title}
-            </Typography>
-            <Box component="form" noValidate onSubmit={handleSubmit}>
-                <Grid container spacing={2}>
-                    {children}
-                    <Grid item>
-                        <Button type="submit" fullWidth variant="contained">
-                            <FormattedMessage id="buttons.submit" />
-                        </Button>
-                    </Grid>
-                    <Grid item>
-                        <List>
-                            {shared_links.map((it) => (
-                                <ListItem key={it.to} disablePadding>
-                                    <ListItemButton
-                                        onClick={() => navigate(it.to)}
-                                    >
-                                        <ListItemIcon>{it.icon}</ListItemIcon>
-                                        <ListItemText
-                                            primary={
-                                                <FormattedMessage
-                                                    id={it.label}
-                                                />
-                                            }
-                                        />
-                                    </ListItemButton>
-                                </ListItem>
-                            ))}
-                        </List>
-                    </Grid>
-                </Grid>
-            </Box>
-        </Layout>
-    );
-}
-
-export default Widget;

+ 0 - 33
material-ui/src/plugins/nut/users/confirm.tsx

@@ -1,33 +0,0 @@
-import TextField from "@mui/material/TextField";
-import Grid from "@mui/material/Grid";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-
-import Layout from "./NonSignInLayout";
-import { useIntl } from "react-intl";
-
-const Widget = () => {
-  const handleSubmit = () => {
-    // TODO
-    // console.log(data.get("email"));
-  };
-  const intl = useIntl();
-  return (
-    <Layout
-      logo={<LockOutlinedIcon />}
-      title={intl.formatMessage({ id: "nut.users.confirm.title" })}
-      handleSubmit={handleSubmit}
-    >
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          id="email"
-          label={intl.formatMessage({ id: "fields.email" })}
-          name="email"
-        />
-      </Grid>
-    </Layout>
-  );
-};
-
-export default Widget;

+ 0 - 33
material-ui/src/plugins/nut/users/forgot-password.tsx

@@ -1,33 +0,0 @@
-import TextField from "@mui/material/TextField";
-import Grid from "@mui/material/Grid";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-
-import Layout from "./NonSignInLayout";
-import { useIntl } from "react-intl";
-
-const Widget = () => {
-  const handleSubmit = () => {
-    // TODO
-    // console.log(data.get("email"));
-  };
-  const intl = useIntl();
-  return (
-    <Layout
-      logo={<LockOutlinedIcon />}
-      title={intl.formatMessage({ id: "nut.users.forgot-password.title" })}
-      handleSubmit={handleSubmit}
-    >
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          id="email"
-          label={intl.formatMessage({ id: "fields.email" })}
-          name="email"
-        />
-      </Grid>
-    </Layout>
-  );
-};
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/nut/users/logs.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-  // TODO
-  return <div>logs</div>;
-}
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/nut/users/reset-password.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-  // TODO
-  return <div>reset password</div>;
-}
-
-export default Widget;

+ 0 - 43
material-ui/src/plugins/nut/users/sign-in.tsx

@@ -1,43 +0,0 @@
-import TextField from "@mui/material/TextField";
-import Grid from "@mui/material/Grid";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-
-import Layout from "./NonSignInLayout";
-import { useIntl } from "react-intl";
-
-const Widget = () => {
-  const handleSubmit = () => {
-    // TODO
-    // console.log(data.get("email"));
-  };
-  const intl = useIntl();
-  return (
-    <Layout
-      logo={<LockOutlinedIcon />}
-      title={intl.formatMessage({ id: "nut.users.sign-in.title" })}
-      handleSubmit={handleSubmit}
-    >
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          id="email"
-          label={intl.formatMessage({ id: "fields.email" })}
-          name="email"
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          name="password"
-          label={intl.formatMessage({ id: "fields.password" })}
-          type="password"
-          id="password"
-        />
-      </Grid>
-    </Layout>
-  );
-};
-
-export default Widget;

+ 0 - 70
material-ui/src/plugins/nut/users/sign-up.tsx

@@ -1,70 +0,0 @@
-import TextField from "@mui/material/TextField";
-import FormControlLabel from "@mui/material/FormControlLabel";
-import Checkbox from "@mui/material/Checkbox";
-import Grid from "@mui/material/Grid";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-import { useIntl } from "react-intl";
-
-import Layout from "./NonSignInLayout";
-
-const Widget = () => {
-  const handleSubmit = () => {
-    // TODO
-    // console.log(data.get("email"));
-  };
-  const intl = useIntl();
-  return (
-    <Layout
-      logo={<LockOutlinedIcon />}
-      title={intl.formatMessage({ id: "nut.users.sign-up.title" })}
-      handleSubmit={handleSubmit}
-    >
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          id="realName"
-          label={intl.formatMessage({ id: "fields.real-name" })}
-          name="lastName"
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          id="email"
-          label={intl.formatMessage({ id: "fields.email" })}
-          name="email"
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          name="password"
-          label={intl.formatMessage({ id: "fields.password" })}
-          type="password"
-          id="password"
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          name="passwordConfirmation"
-          label={intl.formatMessage({ id: "fields.password-confirmation" })}
-          type="password"
-          id="passwordConfirmation"
-        />
-      </Grid>
-      <Grid item xs={12}>
-        <FormControlLabel
-          control={<Checkbox value="allowExtraEmails" color="primary" />}
-          label="I want to receive inspiration, marketing promotions and updates via email."
-        />
-      </Grid>
-    </Layout>
-  );
-};
-
-export default Widget;

+ 0 - 33
material-ui/src/plugins/nut/users/unlock.tsx

@@ -1,33 +0,0 @@
-import TextField from "@mui/material/TextField";
-import Grid from "@mui/material/Grid";
-import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
-
-import Layout from "./NonSignInLayout";
-import { useIntl } from "react-intl";
-
-const Widget = () => {
-  const handleSubmit = () => {
-    // TODO
-    // console.log(data.get("email"));
-  };
-  const intl = useIntl();
-  return (
-    <Layout
-      logo={<LockOutlinedIcon />}
-      title={intl.formatMessage({ id: "nut.users.unlock.title" })}
-      handleSubmit={handleSubmit}
-    >
-      <Grid item xs={12}>
-        <TextField
-          required
-          fullWidth
-          id="email"
-          label={intl.formatMessage({ id: "fields.email" })}
-          name="email"
-        />
-      </Grid>
-    </Layout>
-  );
-};
-
-export default Widget;

+ 0 - 6
material-ui/src/plugins/nut/users/update-profile.tsx

@@ -1,6 +0,0 @@
-function Widget() {
-  // TODO
-  return <div>update profile</div>;
-}
-
-export default Widget;

+ 0 - 1
material-ui/src/react-app-env.d.ts

@@ -1 +0,0 @@
-/// <reference types="react-scripts" />

+ 0 - 40
material-ui/src/reducers/current-user.ts

@@ -1,40 +0,0 @@
-import { createSlice, PayloadAction } from "@reduxjs/toolkit";
-
-import type { RootState } from "../store";
-
-interface IState {
-  id?: string;
-  roles?: string[];
-}
-
-const initialState: IState = {};
-
-export const slice = createSlice({
-  name: "current-user",
-  initialState,
-  reducers: {
-    signIn: (state, action: PayloadAction<string>) => {
-      console.log(action.payload);
-      state.id = "todo";
-      state.roles = [];
-    },
-    signOut: (state) => {
-      state = {};
-    },
-  },
-});
-
-export const { signIn, signOut } = slice.actions;
-
-const ADMINISTRATOR = "administrator";
-
-export const isSignIn = (state: RootState): boolean =>
-  state.currentUser.id !== undefined;
-export const isAdministrtor = (state: RootState): boolean =>
-  hasRole(state, ADMINISTRATOR);
-
-export const hasRole = (state: RootState, role: string): boolean =>
-  state.currentUser.roles !== undefined &&
-  state.currentUser.roles.includes(role);
-
-export default slice.reducer;

+ 0 - 35
material-ui/src/reducers/site-info.ts

@@ -1,35 +0,0 @@
-import { createSlice, PayloadAction } from "@reduxjs/toolkit";
-
-import type { RootState } from "../store";
-
-interface IState {
-  title: string;
-  subhead: string;
-  copyright: string;
-  languages: string[];
-}
-
-const initialState: IState = {
-  title: "",
-  subhead: "",
-  copyright: "",
-  languages: [],
-};
-
-const slice = createSlice({
-  name: "site-info",
-  initialState,
-  reducers: {
-    refresh: (state, action: PayloadAction<IState>) => {
-      Object.assign(state, action.payload);
-    },
-  },
-});
-
-export const { refresh } = slice.actions;
-
-export const selectSiteInfo = (state: RootState): IState => {
-  return { ...state.siteInfo };
-};
-
-export default slice.reducer;

+ 0 - 15
material-ui/src/reportWebVitals.ts

@@ -1,15 +0,0 @@
-import { ReportHandler } from 'web-vitals';
-
-const reportWebVitals = (onPerfEntry?: ReportHandler) => {
-  if (onPerfEntry && onPerfEntry instanceof Function) {
-    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
-      getCLS(onPerfEntry);
-      getFID(onPerfEntry);
-      getFCP(onPerfEntry);
-      getLCP(onPerfEntry);
-      getTTFB(onPerfEntry);
-    });
-  }
-};
-
-export default reportWebVitals;

+ 0 - 1
material-ui/src/request.ts

@@ -1 +0,0 @@
-export const graphql = () => {};

+ 0 - 5
material-ui/src/setupTests.ts

@@ -1,5 +0,0 @@
-// jest-dom adds custom jest matchers for asserting on DOM nodes.
-// allows you to do things like:
-// expect(element).toHaveTextContent(/react/i)
-// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom';

+ 0 - 17
material-ui/src/store.ts

@@ -1,17 +0,0 @@
-import { configureStore } from "@reduxjs/toolkit";
-
-import currentUser from "./reducers/current-user";
-import siteInfo from "./reducers/site-info";
-
-const store = configureStore({
-  reducer: {
-    currentUser,
-    siteInfo,
-  },
-});
-
-export type RootState = ReturnType<typeof store.getState>;
-
-export type AppDispatch = typeof store.dispatch;
-
-export default store;

+ 0 - 26
material-ui/tsconfig.json

@@ -1,26 +0,0 @@
-{
-  "compilerOptions": {
-    "target": "es5",
-    "lib": [
-      "dom",
-      "dom.iterable",
-      "esnext"
-    ],
-    "allowJs": true,
-    "skipLibCheck": true,
-    "esModuleInterop": true,
-    "allowSyntheticDefaultImports": true,
-    "strict": true,
-    "forceConsistentCasingInFileNames": true,
-    "noFallthroughCasesInSwitch": true,
-    "module": "esnext",
-    "moduleResolution": "node",
-    "resolveJsonModule": true,
-    "isolatedModules": true,
-    "noEmit": true,
-    "jsx": "react-jsx"
-  },
-  "include": [
-    "src"
-  ]
-}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.