chore: upgrade paragon version to 20.12.1 (#315)

This commit is contained in:
Awais Ansari
2022-10-05 15:08:36 +05:00
committed by GitHub
parent 35ad0ae0c3
commit 52550149ea
5 changed files with 416 additions and 181 deletions

View File

@@ -6,7 +6,7 @@ import { useSelector } from 'react-redux';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { logError } from '@edx/frontend-platform/logging';
import {
Button, Dropdown, Icon, IconButton, ModalPopup,
Button, Dropdown, Icon, IconButton, ModalPopup, useToggle,
} from '@edx/paragon';
import { MoreHoriz } from '@edx/paragon/icons';
@@ -23,8 +23,8 @@ function ActionsDropdown({
disabled,
actionHandlers,
}) {
const [isOpen, setOpen] = useState(false);
const dropdownIconRef = React.useRef(null);
const [isOpen, open, close] = useToggle(false);
const [target, setTarget] = useState(null);
const actions = useActions(commentOrPost);
const handleActions = (action) => {
const actionFunction = actionHandlers[action];
@@ -42,17 +42,17 @@ function ActionsDropdown({
return (
<>
<IconButton
onClick={() => setOpen(!isOpen)}
onClick={open}
alt={intl.formatMessage(messages.actionsAlt)}
src={MoreHoriz}
iconAs={Icon}
disabled={disabled}
size="sm"
ref={dropdownIconRef}
ref={setTarget}
/>
<ModalPopup
onClose={() => setOpen(false)}
positionRef={dropdownIconRef}
onClose={close}
positionRef={target}
isOpen={isOpen}
placement="auto-start"
>
@@ -70,7 +70,7 @@ function ActionsDropdown({
variant="tertiary"
size="inline"
onClick={() => {
setOpen(false);
close();
handleActions(action.action);
}}
className="d-flex justify-content-start py-1.5 mr-4"

View File

@@ -10,6 +10,7 @@ import {
APP_INIT_ERROR, APP_READY, initialize, subscribe,
} from '@edx/frontend-platform';
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
import { messages as paragonMessages } from '@edx/paragon';
import { DiscussionsHome } from './discussions';
import appMessages from './i18n';
@@ -37,5 +38,6 @@ initialize({
headerMessages,
footerMessages,
appMessages,
paragonMessages,
],
});

View File

@@ -227,7 +227,7 @@ header {
.header-action-bar {
background-color: #fff;
z-index: 2;
z-index: 9999;
box-shadow: 0px 2px 4px rgb(0 0 0 / 15%), 0px 2px 8px rgb(0 0 0 / 15%);
position: sticky;
top: 0;