diff --git a/.env b/.env index 4aa2f97..d3e6955 100644 --- a/.env +++ b/.env @@ -1,4 +1,5 @@ NODE_ENV=development API_URL=http://localhost:3001/api/ EXTERNAL_LOGIN=true -CKEDITOR_LICENSE_KEY=GPL \ No newline at end of file +CKEDITOR_LICENSE_KEY=GPL +STICKER_TEXT=Source \ No newline at end of file diff --git a/.env.example b/.env.example deleted file mode 100644 index 51dfa74..0000000 --- a/.env.example +++ /dev/null @@ -1,3 +0,0 @@ -NODE_ENV=development -API_URL=http://localhost:3001/api/ -EXTERNAL_LOGIN=true \ No newline at end of file diff --git a/public/runtime-env.js b/public/runtime-env.js index 8fe1694..2be6a9b 100644 --- a/public/runtime-env.js +++ b/public/runtime-env.js @@ -1 +1 @@ -window.__RUNTIME_CONFIG__ = {"NODE_ENV":"development","API_URL":"http://localhost:3001/api/","EXTERNAL_LOGIN":"true","CKEDITOR_LICENSE_KEY":"GPL"}; \ No newline at end of file +window.__RUNTIME_CONFIG__ = {"NODE_ENV":"development","API_URL":"http://localhost:3001/api/","EXTERNAL_LOGIN":"true","CKEDITOR_LICENSE_KEY":"GPL","STICKER_TEXT":"Source"}; \ No newline at end of file diff --git a/src/Sass/_frame.scss b/src/Sass/_frame.scss index a2b6bbf..c1f0c8b 100644 --- a/src/Sass/_frame.scss +++ b/src/Sass/_frame.scss @@ -1,22 +1,45 @@ -@import './_esuiteVariables.scss'; +@import "./_esuiteVariables.scss"; .frame { - width: 100vw; - height: 100vh; - overflow: hidden; + width: 100vw; + height: 100vh; + overflow: hidden; + + .sticker { + position: fixed; + top: 30px; + left: -60px; + padding: 4px 0; + width: 200px; + text-align: center; + text-transform: uppercase; + font-weight: bold; + font-size: 0.875em; + line-height: 1em; + background: #fffe4e; + color: #333; + border-top: 2px solid #c9c353; + border-bottom: 2px solid #c9c353; + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); + z-index: 2; + } } .frame-row { - display: flex; + display: flex; } -.frame-leftMenu { - height: auto; +.frame-leftMenu { + height: auto; } .frame-workArea { - height: calc(100vh - 76px); - width: 100%; - overflow: auto; - padding: $frameWorkAreaPadding; -} \ No newline at end of file + height: calc(100vh - 76px); + width: 100%; + overflow: auto; + padding: $frameWorkAreaPadding; +} diff --git a/src/modules/frame/components/Mainframe.tsx b/src/modules/frame/components/Mainframe.tsx index 1aa5fdb..a267cd7 100644 --- a/src/modules/frame/components/Mainframe.tsx +++ b/src/modules/frame/components/Mainframe.tsx @@ -3,6 +3,7 @@ import TopMenu from "./TopMenu"; import LeftMenu from "./LeftMenu"; import "../../../Sass/_frame.scss"; +import Sticker from "./Sticker"; type MainFrameProps = { title?: string | null; @@ -19,6 +20,7 @@ const Mainframe: React.FC = ({ title, children }) => {
{children}
+ ); }; diff --git a/src/modules/frame/components/Sticker.tsx b/src/modules/frame/components/Sticker.tsx new file mode 100644 index 0000000..ba7bb6c --- /dev/null +++ b/src/modules/frame/components/Sticker.tsx @@ -0,0 +1,14 @@ +const isBlank = (value: string | null | undefined) => + !value || value.trim().length === 0; + +const Sticker: React.FC = () => { + if (isBlank(window.__RUNTIME_CONFIG__.STICKER_TEXT)) { + return null; + } + + return ( + {window.__RUNTIME_CONFIG__.STICKER_TEXT} + ); +}; + +export default Sticker; diff --git a/src/modules/frame/components/loginFrame.tsx b/src/modules/frame/components/loginFrame.tsx index b021252..0e1fa90 100644 --- a/src/modules/frame/components/loginFrame.tsx +++ b/src/modules/frame/components/loginFrame.tsx @@ -3,6 +3,7 @@ import React from "react"; import "../../../Sass/login.scss"; import Logo from "../../../img/logo"; +import Sticker from "./Sticker"; interface LoginFrameProps { children?: JSX.Element; @@ -10,7 +11,7 @@ interface LoginFrameProps { const LoginFrame: React.FC = ({ children }) => { return ( -
+
@@ -21,6 +22,7 @@ const LoginFrame: React.FC = ({ children }) => {
+
); }; diff --git a/src/modules/homepage/Env.tsx b/src/modules/homepage/Env.tsx index c282d2c..befc6b6 100644 --- a/src/modules/homepage/Env.tsx +++ b/src/modules/homepage/Env.tsx @@ -22,6 +22,10 @@ const EnvPage: React.FC = () => { ? "GPL" : "hidden"}

+

+ window.__RUNTIME_CONFIG__.STICKER_TEXT ={" "} + {window.__RUNTIME_CONFIG__.STICKER_TEXT} +

); }; diff --git a/src/types/globals.ts b/src/types/globals.ts index 1aac836..fa7cac2 100644 --- a/src/types/globals.ts +++ b/src/types/globals.ts @@ -7,6 +7,7 @@ declare global { API_URL: string; EXTERNAL_LOGIN: boolean; CKEDITOR_LICENSE_KEY?: string; + STICKER_TEXT: string; }; } }