diff --git a/frontend-react/src/App.js b/frontend-react/src/App.js deleted file mode 100644 index bd99f91b47da4fc3099e5bdaccd63a5f603a843b..0000000000000000000000000000000000000000 --- a/frontend-react/src/App.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import image from "./images/recipe.jpg"; -import "/App.css"; -import ChatBotRobot from "./Chatbotcomponent"; - -function App() { - return ( - <span> - <div className="App" style={{ backgroundImage:`url(${image})`,backgroundRepeat:"no-repeat",backgroundSize:"cover" }}> - <header className="App-header"> - <h3> RECIPE EXPERTS. </h3> - <p> Welcomes you's to the smart assistance by our Sam the Advisor. </p> - </header> - </div> - <ChatBotRobot /> - </span> - ); -} - -export default App; diff --git a/frontend-react/src/App.test.js b/frontend-react/src/App.test.js deleted file mode 100644 index 657a2f55895308bafed18017eace442d3837a6a8..0000000000000000000000000000000000000000 --- a/frontend-react/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - const { getByText } = render(<App />); - const linkElement = getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/frontend-react/src/Chatbot.js b/frontend-react/src/Chatbot.js deleted file mode 100644 index e9541f22cf8559cd8821a5bf07a7108a338b021e..0000000000000000000000000000000000000000 --- a/frontend-react/src/Chatbot.js +++ /dev/null @@ -1,50 +0,0 @@ -import React, {useEffect, useState} from "react"; -import './Chatbot.css'; - -import {Header} from "./Header"; -import {UserInput} from "./UserInput"; -import {MessageArea} from "./MessageArea"; - -import {io} from "socket.io-client"; -const socket = io("ws://localhost:5000"); - -function Chatbot() { - /* - Handle messages - */ - const [messages, setMessages] = useState([{ - text: "Hello, i am the Internet Technologies Chatbot, how can i help you?", - position: "left" - }]); - - useEffect(() => { - //if last message is a non-empty question, ask the server - let lastMessage = messages[messages.length - 1] - if (lastMessage.text !== "" && lastMessage.position === "right") { - socket.emit('question', lastMessage.text); - } - - //handle server responses - socket.on("answer", (data) => { - setMessages([...messages, {text: data, position: "left"}]) - }); - - }, [messages]); - - function onSubmitMessage(inputText) { - setMessages([...messages, {text: inputText, position: "right"}]) - } - - /* - Render HTML - */ - return ( - <div className="chat_window"> - <Header /> - <MessageArea messages={messages} /> - <UserInput onSubmitMessage={onSubmitMessage} /> - </div> - ); -} - -export default Chatbot; diff --git a/frontend-react/src/Chatbotcomponent.jsx b/frontend-react/src/Chatbotcomponent.jsx deleted file mode 100644 index 6a5e85899a3f9164b8156708a306ea4e2d966d0c..0000000000000000000000000000000000000000 --- a/frontend-react/src/Chatbotcomponent.jsx +++ /dev/null @@ -1,77 +0,0 @@ -import React from "react"; -import { Launcher } from "react-chat-window" -import io from "socket.io-client"; - -class ChatBotRobot extends React.Component { - constructor(props) { - super(props); - - this.state = { - messageList: [], - socket: io("http://localhost:3000"), - room: "user1", - } - - } - - UNSAFE_componentWillMount() { - this._sendMessage("Hello! Welcome to 'RESWHIZ'. I am your RECIPE recommendation assistance. Would you like to see what can I do?Type 'start' to get started. !"); - } - - componentDidMount() { - this.state.socket.connect(true); - this.state.socket.emit('join', this.state.room); - - this.state.socket.on("send-msg-response", async (msg) => { - this.state.messageList.pop(); - await this.setState({ - messageList: [...this.state.messageList] - }) - - this._sendMessage(msg); - }) - - } - - async _onMessageWasSent(message) { - await this.setState({ - messageList: [...this.state.messageList, message] - }) - - this._sendMessage("••••"); - console.log(message.data.text); - await this.state.socket.emit('new-msg', { msg: message.data.text, room: this.state.room }) - - } - - _sendMessage(text) { - if (text.length > 0) { - this.setState({ - messageList: [...this.state.messageList, { - author: 'them', - type: 'text', - data: { text } - },] - }) - } - } - - render() { - - return ( - <div id="chatbox" className="chatbox"> - <Launcher - agentProfile={{ - teamName: 'RESWHIZ', - image: 'Chatbot.png' - }} - onMessageWasSent={this._onMessageWasSent.bind(this)} - messageList={this.state.messageList} - showEmoji - /> - </div> - ); - } -} - -export default ChatBotRobot; diff --git a/frontend-react/src/Header.css b/frontend-react/src/Header.css deleted file mode 100644 index ffeef43db5a8643025936399e436d0be08bca1aa..0000000000000000000000000000000000000000 --- a/frontend-react/src/Header.css +++ /dev/null @@ -1,32 +0,0 @@ -.top_menu { - background-color: #fff; - width: 100%; - padding: 20px 0 15px; - box-shadow: 0 1px 30px rgba(0, 0, 0, 0.1); -} -.top_menu .buttons { - margin: 3px 0 0 20px; - position: absolute; -} -.top_menu .buttons .button { - width: 16px; - height: 16px; - border-radius: 50%; - display: inline-block; - margin-right: 10px; - position: relative; -} -.top_menu .buttons .button.close { - background-color: #f5886e; -} -.top_menu .buttons .button.minimize { - background-color: #fdbf68; -} -.top_menu .buttons .button.maximize { - background-color: #a3d063; -} -.top_menu .title { - text-align: center; - color: #bcbdc0; - font-size: 20px; -} diff --git a/frontend-react/src/Header.js b/frontend-react/src/Header.js deleted file mode 100644 index 85e907f271fac83ae884ddaff798413e7a3e799b..0000000000000000000000000000000000000000 --- a/frontend-react/src/Header.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; -import './Header.css' - -function Header() { - return ( - <div className="top_menu"> - <div className="buttons"> - <div className="button close"/> - <div className="button minimize"/> - <div className="button maximize"/> - </div> - <div className="title">Chat</div> - </div> - ) -} - -export {Header} \ No newline at end of file diff --git a/frontend-react/src/Message.css b/frontend-react/src/Message.css deleted file mode 100644 index fb280a2ff132af1b7e001f0d6df855495d4ac367..0000000000000000000000000000000000000000 --- a/frontend-react/src/Message.css +++ /dev/null @@ -1,76 +0,0 @@ -#messages .message { - clear: both; - overflow: hidden; - margin-bottom: 20px; - transition: all 0.5s linear; - opacity: 0; -} -#messages .message.left .avatar { - background-color: #f5886e; - float: left; -} -#messages .message.left .text_wrapper { - background-color: #ffe6cb; - margin-left: 20px; -} -#messages .message.left .text_wrapper::after, #messages .message.left .text_wrapper::before { - right: 100%; - border-right-color: #ffe6cb; -} -#messages .message.left .text { - color: #c48843; -} -#messages .message.right .avatar { - background-color: #fdbf68; - float: right; -} -#messages .message.right .text_wrapper { - background-color: #c7eafc; - margin-right: 20px; - float: right; -} -#messages .message.right .text_wrapper::after, #messages .message.right .text_wrapper::before { - left: 100%; - border-left-color: #c7eafc; -} -#messages .message.right .text { - color: #45829b; -} -#messages .message.appeared { - opacity: 1; -} -#messages .message .avatar { - width: 60px; - height: 60px; - border-radius: 50%; - display: inline-block; -} -#messages .message .text_wrapper { - display: inline-block; - padding: 20px; - border-radius: 6px; - width: calc(100% - 85px); - min-width: 100px; - position: relative; -} -#messages .message .text_wrapper::after, #messages .message .text_wrapper:before { - top: 18px; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} -#messages .message .text_wrapper::after { - border-width: 13px; - margin-top: 0px; -} -#messages .message .text_wrapper::before { - border-width: 15px; - margin-top: -2px; -} -#messages .message .text_wrapper .text { - font-size: 18px; - font-weight: 300; -} \ No newline at end of file diff --git a/frontend-react/src/Message.js b/frontend-react/src/Message.js deleted file mode 100644 index 8a6edd213e4350675d1453b8150d783178fc0e8e..0000000000000000000000000000000000000000 --- a/frontend-react/src/Message.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; -import './Message.css' - -function Message(props) { - - return ( - <li className={"message appeared " + props.position}> - <div className="avatar"/> - <div className="text_wrapper"> - <div className="text">{props.text}</div> - </div> - </li> - ) -} - -export {Message} \ No newline at end of file diff --git a/frontend-react/src/MessageArea.css b/frontend-react/src/MessageArea.css deleted file mode 100644 index d125e2c0ecd2c800cbe0b7b4a449e1a787fec63e..0000000000000000000000000000000000000000 --- a/frontend-react/src/MessageArea.css +++ /dev/null @@ -1,8 +0,0 @@ -#messages { - position: relative; - list-style: none; - padding: 20px 10px 0 10px; - margin: 0; - height: 347px; - overflow: scroll; -} \ No newline at end of file diff --git a/frontend-react/src/MessageArea.js b/frontend-react/src/MessageArea.js deleted file mode 100644 index 447d243bc2ba3a8ddbcbfabfd2a3b599d4c8429a..0000000000000000000000000000000000000000 --- a/frontend-react/src/MessageArea.js +++ /dev/null @@ -1,32 +0,0 @@ -import React, {useEffect, useRef} from "react"; -import './MessageArea.css' -import {Message} from "./Message"; - -function MessageArea(props) { - - /* - Autoscrolling - */ - const messagesEndRef = useRef(null) - - useEffect(() => { - //scroll to bottom when a message is sent or received - if (props.messages.length > 1) { - scrollToBottom(); - } - }) - - function scrollToBottom() { - messagesEndRef.current.scrollIntoView({behavior: "smooth"}) - } - - return ( - <ul id="messages"> - {props.messages.map((item, i) => - (<Message text={item.text} position={item.position}/>))} - <li ref={messagesEndRef}/> - </ul> - ) -} - -export {MessageArea} \ No newline at end of file diff --git a/frontend-react/src/UserInput.css b/frontend-react/src/UserInput.css deleted file mode 100644 index 102b7ddc24e6d7d9ec4cbc09be2619cd0d68cee8..0000000000000000000000000000000000000000 --- a/frontend-react/src/UserInput.css +++ /dev/null @@ -1,52 +0,0 @@ -.bottom_wrapper { - position: relative; - width: 100%; - background-color: #fff; - padding: 20px 20px; - bottom: 0; -} -.bottom_wrapper .message_input_wrapper { - display: inline-block; - height: 50px; - border-radius: 25px; - border: 1px solid #bcbdc0; - width: calc(100% - 160px); - position: relative; - padding: 0 20px; -} -.bottom_wrapper .message_input_wrapper .message_input { - border: none; - height: 100%; - box-sizing: border-box; - width: calc(100% - 40px); - position: absolute; - outline-width: 0; - color: gray; -} -.bottom_wrapper .send_message { - width: 140px; - height: 50px; - display: inline-block; - border-radius: 50px; - background-color: #a3d063; - border: 2px solid #a3d063; - color: #fff; - cursor: pointer; - transition: all 0.2s linear; - text-align: center; - float: right; -} -.bottom_wrapper .send_message:hover { - color: #a3d063; - background-color: #fff; -} -.bottom_wrapper .send_message .text { - font-size: 18px; - font-weight: 300; - display: inline-block; - line-height: 48px; -} - -.message_template { - display: none; -} \ No newline at end of file diff --git a/frontend-react/src/UserInput.js b/frontend-react/src/UserInput.js deleted file mode 100644 index 0b008785279d1b7c757c60503e49bde181e04e29..0000000000000000000000000000000000000000 --- a/frontend-react/src/UserInput.js +++ /dev/null @@ -1,34 +0,0 @@ -import React, {useState} from "react"; -import './UserInput.css' - -function UserInput(props) { - - /* - Handle input text - */ - const [inputText, setInputText] = useState("") - - function handleChange(e) { - setInputText(e.target.value) - } - - function handleSubmit() { - props.onSubmitMessage(inputText); - setInputText(""); - } - - return ( - <div className="bottom_wrapper clearfix"> - <div className="message_input_wrapper"> - <input className="message_input" value={inputText} onChange={handleChange} - placeholder="Type your message here..."/> - </div> - <div className="send_message" onClick={handleSubmit}> - <div className="icon"/> - <div className="text">Send</div> - </div> - </div> - ) -} - -export {UserInput} \ No newline at end of file diff --git a/frontend-react/src/images/icon 1.png b/frontend-react/src/images/icon 1.png deleted file mode 100644 index 0021bfc7de97a2f71ea81694f48fef892d330a24..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/icon 1.png and /dev/null differ diff --git a/frontend-react/src/images/icon 2.png b/frontend-react/src/images/icon 2.png deleted file mode 100644 index 70840f057c87d1fab43d94f0de6e493eb9af3d75..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/icon 2.png and /dev/null differ diff --git a/frontend-react/src/images/recipe.jpg b/frontend-react/src/images/recipe.jpg deleted file mode 100644 index 5315970cb48e4f22baa963d7e175ebcfe56d29a8..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/recipe.jpg and /dev/null differ diff --git a/frontend-react/src/images/refresh.png b/frontend-react/src/images/refresh.png deleted file mode 100644 index 0c11bafdca4e37dd679a89d834038d067a3ae95e..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/refresh.png and /dev/null differ diff --git a/frontend-react/src/images/reload.png b/frontend-react/src/images/reload.png deleted file mode 100644 index 228d8c59ec3fdbe692d63af66025dcee0ccc3d74..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/reload.png and /dev/null differ diff --git a/frontend-react/src/images/style.css b/frontend-react/src/images/style.css deleted file mode 100644 index 3f0e20a31af592c10b7447a11801d16475bea58b..0000000000000000000000000000000000000000 --- a/frontend-react/src/images/style.css +++ /dev/null @@ -1,356 +0,0 @@ -body{ - background: linear-gradient(135deg, #a7acad 0%, #bac5cc 100%); - margin: 0; -} - - -.main { - transition: margin 400ms cubic-bezier(0.17,0.04,0.03,0.94); - position: relative; - height: calc(100vh - 40px); - max-width: 900px; - margin: auto; - margin-top: 20px; - background-color: #d0d0d0; - border: 3px solid white; - border-radius: 30px; - overflow: hidden; -} - - -#sidebar { - background: linear-gradient(135deg, #be7819 0%, #fd8d00 100%); - position: absolute; - top: -250px; - left: 0; - width: 100%; - height: 250px; - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); - transition: top 400ms cubic-bezier(0.17,0.04,0.03,0.94); - color: white; - font-family: 'Times New Roman'; -} - -.down_label { - display: block; - position: absolute; - right: 50px; - top: 0; - cursor: pointer; - background: #fd8d00; - width: 30px; - height: 20px; - border-radius: 0 0 5px 5px; - color: white; - font-size: 1em; - text-align: center; - cursor: pointer; - transition: all 400ms cubic-bezier(0.17,0.04,0.03,0.94); - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); - padding: 10px; - z-index: 100; -} - - -.down_label:hover { - box-shadow: 0 5px 11px 0 rgba(0,0,0,0.18),0 4px 15px 0 rgba(0,0,0,0.15) -} - - -.down_label:after, .down_button:checked + .down_label { - content: "="; - font-family: "Arial"; -} - - -.down_button:checked ~ #sidebar { - top: 0 -} - - -.down_button:checked ~ .down_label { - top: 250px; - background-color: #f1ed04; -} - - -.down_button:checked ~ .main { - margin-top: 300px -} - - -ul{ - margin: 0; - padding: 0; - background: linear-gradient(135deg, #be7819 0%, #fd8d00 100%); - color: white; -} -li{ - list-style-type: none; - display: inline-block; - color: inherit; -} -.bar{ - margin-left: 30px; - padding: 8px; - border: none; - cursor: pointer; - background: none; - font-size: 1.3em; - color: inherit; - font-family: "Arial"; -} - -#home{ - cursor: default; -} -.bar:hover{ - transition: 0.3s; - background: #b5c7c3; -} -#dark_theme{ - position: absolute; - right: 30px; - margin-top: 0; - margin-bottom: 0; -} - -#text{ - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - -footer{ - margin: 20px; - color: #5b5b5b; -} - -.placeholder-white::placeholder { - color: white; -} - -.msg_area{ - position: absolute; - width: 100%; - height: calc(100% - 103px); - background-image: url("wall 1.jpeg"); - background-size: cover; - overflow: auto; -} - -.msg_area.black{ - background-image: url("wall 2.jpeg"); -} -.header{ - margin: auto; - padding: 10px; - text-align: center; - font-size: 1.5em; - color: #5b5b5b; - background: #d0d0d0; - border-bottom: 3px solid white; - border-top-left-radius: 30px; - border-top-right-radius: 30px; - font-family: "Arial"; - font-size: 1.6em; -} -.refresh { - position: absolute; - top: 10px; - width: 30px; - height: 22px; - right: 20px; - border: none; - cursor: pointer; - appearance: none; - background-color: inherit; -} -.update { - position: absolute; - right: 0; - top: 0; - left: 0; - bottom: 0; - width: 30px; - height: 22px; - transition: .2s; -} -.update.hover { - position: absolute; - top: 0; - right: 0; - left: 0; - bottom: 0; - opacity: 0; - transition: opacity .2s; -} -.refresh:hover .update.hover { - opacity: 1; - transform: rotate(180deg); -} -.refresh:hover .update { - opacity: 0; - transform: rotate(180deg); -} -.left_message{ - display: flex; - max-width: 80%; - margin-left: 20px; - margin-top: 20px; - margin-bottom: 20px; - word-wrap: break-word; -} -.right_message{ - display: flex; - max-width: 80%; - flex-direction: row-reverse; - margin: 20px 20px 20px auto; - word-wrap: break-word; -} - -.msg{ - min-width: 100px; - padding: 10px 10px 15px 10px; - border-top-left-radius: 10px; - border-top-right-radius: 10px; - font-family: 'Times New Roman'; - word-wrap: break-word; - -} -.msg.left{ - margin-left: 10px; - border-bottom-right-radius: 10px; - background: linear-gradient(135deg, #f1ed04 0%, #be7819 100%); -} -.msg.right{ - margin-right: 10px; - border-bottom-left-radius: 10px; - color: white; - background: linear-gradient(135deg, #be7819 0%, #fd8d00 100%); -} -.mes_info{ - display: flex; - margin-bottom: 5px; - margin-left: 6px; - font-weight: bold; - font-size: 1.2em; -} -.mes_header{ - margin-right: 6px; - max-width: 60%; -} -.mes_time{ - margin: auto 1px 5px auto; - font-size: 0.5em; -} - -.mes_text{ - margin-left: 6px; - font-size: 1em; -} - - -@media (min-width: 992px){ - .msg_area{ - height: calc(100% - 101px); - } -} - -.icon{ - width: 50px; - height: 50px; - min-width: 50px; - margin: auto 0 0 0; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - background-image: image("icon 1.png"); - border-radius: 50%; -} - -.icon.left{ - background-image: image("icon 2.png"); -} - - -.header_bottom{ - position: absolute; - display: flex; - width: 100%; - height: 50px; - bottom: 0; - background: #d0d0d0; - border-top: 3px solid white; - border-bottom-left-radius: 30px; - border-bottom-right-radius: 30px; -} -#input_area{ - display: flex; - width: 60%; - flex: 1; - margin: 8px 3px 8px 11px; - padding: 2px 2px 2px 10px; - border: none; - border-radius: 5px 5px 5px 15px; - font-size: 1.3em; - height: auto; - overflow-y: auto; - resize: none; -} -.send_button{ - width: 60px; - margin: 8px 8px 8px 3px; - cursor: pointer; - border: none; - border-radius: 5px 5px 15px 5px; - color: #ffffff; - background-color: #f1ed04; - transition-duration: 0.3s; - overflow: hidden; - text-align: center; -} -.send_button:hover{ - background-color: #fd8d00; -} - -footer{ - margin-top: 0; - margin-bottom: 5px; - margin-left: 20px; - color: #5b5b5b; -} - -@media (max-width: 767px) { - .mes_text{ - font-size: 2em; - } - .mes_info{ - font-size: 2.5em; - } - .msg_area{ - height: calc(100% - 93px); - } - .header{ - padding: 5px; - } - .refresh{ - top: 5px; - } - .bar { - padding: 6px; - margin-left: 10px; - font-size: 0.8em; - } - - #dark_theme { - right: 10px; - top: 0.3px; - } - - #text{ - font-size: 0.8em; - } - -} \ No newline at end of file diff --git a/frontend-react/src/images/wall 1.jpeg b/frontend-react/src/images/wall 1.jpeg deleted file mode 100644 index abc0363035bd93bb47ce73162281fb5e60f1f5a6..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/wall 1.jpeg and /dev/null differ diff --git a/frontend-react/src/images/wall 2.jpeg b/frontend-react/src/images/wall 2.jpeg deleted file mode 100644 index 72eb953ff92cd77b391b33f3a73969c09b6d06dd..0000000000000000000000000000000000000000 Binary files a/frontend-react/src/images/wall 2.jpeg and /dev/null differ diff --git a/frontend-react/src/index.css b/frontend-react/src/index.css deleted file mode 100644 index 9d7cf0d45918a53274359fd48f378fe42a257fd5..0000000000000000000000000000000000000000 --- a/frontend-react/src/index.css +++ /dev/null @@ -1,10 +0,0 @@ -body { - margin: 0; - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: 'Courier New', Courier, monospace; -} diff --git a/frontend-react/src/index.js b/frontend-react/src/index.js deleted file mode 100644 index 8697e7a43e469faaa0bf99ce480a55971e07436f..0000000000000000000000000000000000000000 --- a/frontend-react/src/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import "./index.css"; -import App from "./App"; -import * as serviceWorker from "./serviceWorker"; - -ReactDOM.render(<App />, document.getElementById('root')); - -// To enhance your app's offline functionality and improve loading speed, -// consider changing unregister() to register() below. -// However, be aware that this choice has some potential drawbacks. -// For a deeper understanding of service workers, -// explore further: https://bit.ly/CRA-PWA -serviceWorker.unregister(); diff --git a/frontend-react/src/logo.svg b/frontend-react/src/logo.svg deleted file mode 100644 index 86c1148887daaeccb023ed4b3115438e64d82e87..0000000000000000000000000000000000000000 --- a/frontend-react/src/logo.svg +++ /dev/null @@ -1,7 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"> - <g fill="#cbf55c"> - <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/> - <circle cx="420.9" cy="296.5" r="45.7"/> - <path d="M520.5 78.1z"/> - </g> -</svg> diff --git a/frontend-react/src/serviceWorker.js b/frontend-react/src/serviceWorker.js deleted file mode 100644 index 1ea33ec3473ef4ef4af69af2a884f3a8a69f1837..0000000000000000000000000000000000000000 --- a/frontend-react/src/serviceWorker.js +++ /dev/null @@ -1,137 +0,0 @@ -// This code snippet allows you to register a service worker, -// enabling faster loading and offline capabilities for your app. -// By default, the registration function is not called. - -// While this enhances user experience by enabling quicker loading and -// offline functionality, it's important to note that developers -// and users will only see updated content after closing all existing tabs on a page. -// This is because previously cached resources are updated in the background. - -// To understand the advantages of this approach and learn how to opt-in, -// please refer to our documentation: https://bit.ly/CRA-PWA - -const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.0/8 are considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) -); - -export function register(config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } - - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); - - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' - ); - }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } - }); - } -} - -function registerValidSW(swUrl, config) { - navigator.serviceWorker - .register(swUrl) - .then(registration => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' - ); - - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); - - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch(error => { - console.error('Error during service worker registration:', error); - }); -} - -function checkValidServiceWorker(swUrl, config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl, { - headers: { 'Service-Worker': 'script' } - }) - .then(response => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); - if ( - response.status === 404 || - (contentType != null && contentType.indexOf('javascript') === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); - }); -} - -export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then(registration => { - registration.unregister(); - }); - } -} diff --git a/frontend-react/src/setupTests.js b/frontend-react/src/setupTests.js deleted file mode 100644 index 74b1a275a0ea7df518f17bcea5375abf003abe55..0000000000000000000000000000000000000000 --- a/frontend-react/src/setupTests.js +++ /dev/null @@ -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/extend-expect';