From 36c5fd82120b035a37ba38a34a53086d3e526344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Wed, 18 Sep 2024 19:00:12 -0300 Subject: [PATCH 1/3] feat: expose containerProps in StudioFooter --- package-lock.json | 7 +++--- package.json | 1 + src/components/studio-footer/StudioFooter.jsx | 24 +++++++++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index b57109268..a5cd7bc75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "peerDependencies": { "@edx/frontend-platform": "^7.0.0 || ^8.0.0", "@openedx/paragon": ">= 21.11.3 < 23.0.0", + "classnames": "^2.5.1", "prop-types": "^15.5.10", "react": "^16.9.0 || ^17.0.0", "react-dom": "^16.9.0 || ^17.0.0" @@ -8451,9 +8452,9 @@ "license": "MIT" }, "node_modules/classnames": { - "version": "2.3.2", - "dev": true, - "license": "MIT" + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" }, "node_modules/clean-css": { "version": "5.3.2", diff --git a/package.json b/package.json index d28297ff6..e4b4dacfb 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "peerDependencies": { "@edx/frontend-platform": "^7.0.0 || ^8.0.0", "@openedx/paragon": ">= 21.11.3 < 23.0.0", + "classnames": "^2.5.1", "prop-types": "^15.5.10", "react": "^16.9.0 || ^17.0.0", "react-dom": "^16.9.0 || ^17.0.0" diff --git a/src/components/studio-footer/StudioFooter.jsx b/src/components/studio-footer/StudioFooter.jsx index 81add577d..d5a11c170 100644 --- a/src/components/studio-footer/StudioFooter.jsx +++ b/src/components/studio-footer/StudioFooter.jsx @@ -1,6 +1,6 @@ import React, { useContext, useState } from 'react'; import _ from 'lodash'; -import { intlShape, injectIntl, FormattedMessage } from '@edx/frontend-platform/i18n'; +import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n'; import { ensureConfig } from '@edx/frontend-platform'; import { AppContext } from '@edx/frontend-platform/react'; import { @@ -12,6 +12,8 @@ import { TransitionReplace, } from '@openedx/paragon'; import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons'; +import classNames from 'classnames'; + import messages from './messages'; ensureConfig([ @@ -26,12 +28,14 @@ ensureConfig([ ], 'Studio Footer component'); const StudioFooter = ({ - // injected - intl, + containerProps, }) => { + const intl = useIntl(); const [isOpen, setIsOpen] = useState(false); const { config } = useContext(AppContext); + const { containerClassName, ...restContainerProps } = containerProps || {}; + return ( <>
@@ -49,7 +53,11 @@ const StudioFooter = ({
- + {isOpen ? ( @@ -139,8 +147,10 @@ const StudioFooter = ({ }; StudioFooter.propTypes = { - // injected - intl: intlShape.isRequired, + containerProps: Container.propTypes, +}; + +StudioFooter.defaultProps = { }; -export default injectIntl(StudioFooter); +export default StudioFooter; From a996f116b07a32e9401dc83f429de23e46513b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Thu, 19 Sep 2024 09:50:51 -0300 Subject: [PATCH 2/3] fix: add defaultProps to containerProps --- src/components/studio-footer/StudioFooter.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/studio-footer/StudioFooter.jsx b/src/components/studio-footer/StudioFooter.jsx index d5a11c170..ddb0745d7 100644 --- a/src/components/studio-footer/StudioFooter.jsx +++ b/src/components/studio-footer/StudioFooter.jsx @@ -13,6 +13,7 @@ import { } from '@openedx/paragon'; import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import messages from './messages'; @@ -147,10 +148,11 @@ const StudioFooter = ({ }; StudioFooter.propTypes = { - containerProps: Container.propTypes, + containerProps: PropTypes.shape(Container.propTypes), }; StudioFooter.defaultProps = { + containerProps: {}, }; export default StudioFooter; From 14804efbbc867a5be05811730c61f2cb9bbe4e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Tue, 1 Oct 2024 10:27:32 -0300 Subject: [PATCH 3/3] chore: fix dependencies --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 94881a7b2..69e5f99a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@fortawesome/free-regular-svg-icons": "6.6.0", "@fortawesome/free-solid-svg-icons": "6.6.0", "@fortawesome/react-fontawesome": "0.2.2", + "classnames": "^2.5.1", "jest-environment-jsdom": "^29.7.0", "lodash": "^4.17.21", "ts-jest": "^29.1.2" @@ -40,8 +41,7 @@ }, "peerDependencies": { "@edx/frontend-platform": "^7.0.0 || ^8.0.0", - "@openedx/paragon": "^22.8.0", - "classnames": "^2.5.1", + "@openedx/paragon": ">= 21.11.3 < 23.0.0", "prop-types": "^15.5.10", "react": "^16.9.0 || ^17.0.0", "react-dom": "^16.9.0 || ^17.0.0" diff --git a/package.json b/package.json index 6d988c51d..fc72cb1a7 100644 --- a/package.json +++ b/package.json @@ -59,14 +59,14 @@ "@fortawesome/free-regular-svg-icons": "6.6.0", "@fortawesome/free-solid-svg-icons": "6.6.0", "@fortawesome/react-fontawesome": "0.2.2", + "classnames": "^2.5.1", "jest-environment-jsdom": "^29.7.0", "lodash": "^4.17.21", "ts-jest": "^29.1.2" }, "peerDependencies": { "@edx/frontend-platform": "^7.0.0 || ^8.0.0", - "@openedx/paragon": "^22.8.0", - "classnames": "^2.5.1", + "@openedx/paragon": ">= 21.11.3 < 23.0.0", "prop-types": "^15.5.10", "react": "^16.9.0 || ^17.0.0", "react-dom": "^16.9.0 || ^17.0.0"