From a7591d1a81cc2c13b931e537f83221d754c7ef1f Mon Sep 17 00:00:00 2001 From: gauravsingh94 Date: Sat, 21 Oct 2023 20:02:14 +0530 Subject: [PATCH 1/2] fix the issue-#2524. --- .env.example | 33 ----------------------- client/modules/IDE/components/Sidebar.jsx | 19 ++++++++++++- 2 files changed, 18 insertions(+), 34 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index eade709c69..0000000000 --- a/.env.example +++ /dev/null @@ -1,33 +0,0 @@ -API_URL=/editor -AWS_ACCESS_KEY= -AWS_REGION= -AWS_SECRET_KEY= -CORS_ALLOW_LOCALHOST=true -EMAIL_SENDER= -EMAIL_VERIFY_SECRET_TOKEN=whatever_you_want_this_to_be_it_only_matters_for_production -EXAMPLE_USER_EMAIL=examples@p5js.org -EXAMPLE_USER_PASSWORD=hellop5js -GG_EXAMPLES_USERNAME=generativedesign -GG_EXAMPLES_EMAIL=benedikt.gross@generative-gestaltung.de -GG_EXAMPLES_PASS=generativedesign -GITHUB_ID= -GITHUB_SECRET= -GOOGLE_ID= (use google+ api) -GOOGLE_SECRET= (use google+ api) -MAILGUN_DOMAIN= -MAILGUN_KEY= -ML5_LIBRARY_USERNAME=ml5 -ML5_LIBRARY_EMAIL=examples@ml5js.org -ML5_LIBRARY_PASS=helloml5 -MOBILE_ENABLED=true -MONGO_URL=mongodb://localhost:27017/p5js-web-editor -PORT=8000 -PREVIEW_PORT=8002 -EDITOR_URL=http://localhost:8000 -PREVIEW_URL=http://localhost:8002 -S3_BUCKET= -S3_BUCKET_URL_BASE= -SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production -TRANSLATIONS_ENABLED=true -UI_ACCESS_TOKEN_ENABLED=false -UPLOAD_LIMIT=250000000 diff --git a/client/modules/IDE/components/Sidebar.jsx b/client/modules/IDE/components/Sidebar.jsx index c01815d339..d7e469d696 100644 --- a/client/modules/IDE/components/Sidebar.jsx +++ b/client/modules/IDE/components/Sidebar.jsx @@ -1,4 +1,4 @@ -import React, { useRef, useState } from 'react'; +import React, { useRef, useState, useEffect } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; @@ -67,6 +67,23 @@ export default function SideBar() { 'sidebar--cant-edit': !canEditProject }); + useEffect(() => { + const handleClickOutside = (e) => { + if ( + projectOptionsVisible && + !sidebarOptionsRef.current.contains(e.target) + ) { + dispatch(closeProjectOptions()); + } + }; + + document.addEventListener('click', handleClickOutside); + + return () => { + document.removeEventListener('click', handleClickOutside); + }; + }, [projectOptionsVisible, dispatch]); + return ( {ide.sidebarIsExpanded && ( From f0337fdacbd6fa553e872ff3c7694a23ca272a02 Mon Sep 17 00:00:00 2001 From: gauravsingh94 Date: Sun, 22 Oct 2023 06:31:51 +0530 Subject: [PATCH 2/2] fix the issue-#2524. --- .env.example | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000..eade709c69 --- /dev/null +++ b/.env.example @@ -0,0 +1,33 @@ +API_URL=/editor +AWS_ACCESS_KEY= +AWS_REGION= +AWS_SECRET_KEY= +CORS_ALLOW_LOCALHOST=true +EMAIL_SENDER= +EMAIL_VERIFY_SECRET_TOKEN=whatever_you_want_this_to_be_it_only_matters_for_production +EXAMPLE_USER_EMAIL=examples@p5js.org +EXAMPLE_USER_PASSWORD=hellop5js +GG_EXAMPLES_USERNAME=generativedesign +GG_EXAMPLES_EMAIL=benedikt.gross@generative-gestaltung.de +GG_EXAMPLES_PASS=generativedesign +GITHUB_ID= +GITHUB_SECRET= +GOOGLE_ID= (use google+ api) +GOOGLE_SECRET= (use google+ api) +MAILGUN_DOMAIN= +MAILGUN_KEY= +ML5_LIBRARY_USERNAME=ml5 +ML5_LIBRARY_EMAIL=examples@ml5js.org +ML5_LIBRARY_PASS=helloml5 +MOBILE_ENABLED=true +MONGO_URL=mongodb://localhost:27017/p5js-web-editor +PORT=8000 +PREVIEW_PORT=8002 +EDITOR_URL=http://localhost:8000 +PREVIEW_URL=http://localhost:8002 +S3_BUCKET= +S3_BUCKET_URL_BASE= +SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production +TRANSLATIONS_ENABLED=true +UI_ACCESS_TOKEN_ENABLED=false +UPLOAD_LIMIT=250000000