Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/Common/ButtonWithDropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Dropdown from '@app/components/Common/Dropdown';
import { withProperties } from '@app/utils/typeHelpers';
import { Menu } from '@headlessui/react';
import { Menu, MenuButton } from '@headlessui/react';
import { ChevronDownIcon } from '@heroicons/react/24/solid';
import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';

Expand Down Expand Up @@ -54,13 +54,13 @@ const ButtonWithDropdown = ({
</TriggerElement>
{children && (
<span className="relative -ml-px block">
<Menu.Button
<MenuButton
type="button"
className={`relative z-10 inline-flex h-full items-center rounded-r-md px-2 py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out hover:z-20 focus:z-20 ${styleClasses.dropdownSideButtonClasses}`}
aria-label="Expand"
>
{dropdownIcon ? dropdownIcon : <ChevronDownIcon />}
</Menu.Button>
</MenuButton>
<Dropdown.Items dropdownType={buttonType}>{children}</Dropdown.Items>
</span>
)}
Expand Down
20 changes: 13 additions & 7 deletions src/components/Common/Dropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { withProperties } from '@app/utils/typeHelpers';
import { Menu, Transition } from '@headlessui/react';
import {
Menu,
MenuButton,
MenuItem,
MenuItems,
Transition,
} from '@headlessui/react';
import { ChevronDownIcon } from '@heroicons/react/24/solid';
import {
Fragment,
Expand All @@ -19,7 +25,7 @@ const DropdownItem = ({
...props
}: DropdownItemProps) => {
return (
<Menu.Item>
<MenuItem>
<a
className={[
'button-md flex cursor-pointer items-center rounded px-4 py-2 text-sm leading-5 text-white focus:text-white focus:outline-none',
Expand All @@ -31,7 +37,7 @@ const DropdownItem = ({
>
{children}
</a>
</Menu.Item>
</MenuItem>
);
};

Expand All @@ -55,7 +61,7 @@ const DropdownItems = ({
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
<Menu.Items
<MenuItems
className={[
'absolute right-0 z-40 -mr-1 mt-2 w-56 origin-top-right rounded-md p-1 shadow-lg',
dropdownType === 'ghost'
Expand All @@ -66,7 +72,7 @@ const DropdownItems = ({
{...props}
>
<div className="py-1">{children}</div>
</Menu.Items>
</MenuItems>
</Transition>
);
};
Expand All @@ -89,7 +95,7 @@ const Dropdown = ({

return (
<Menu as="div" className="relative z-10">
<Menu.Button
<MenuButton
type="button"
className={[
'button-md inline-flex h-full items-center space-x-2 rounded-md border px-4 py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out hover:z-20 focus:z-20 focus:outline-none',
Expand All @@ -104,7 +110,7 @@ const Dropdown = ({
>
<span>{text}</span>
{children && (dropdownIcon ? dropdownIcon : <ChevronDownIcon />)}
</Menu.Button>
</MenuButton>
{children && (
<DropdownItems dropdownType={buttonType}>{children}</DropdownItems>
)}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Common/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import LoadingSpinner from '@app/components/Common/LoadingSpinner';
import useClickOutside from '@app/hooks/useClickOutside';
import { useLockBodyScroll } from '@app/hooks/useLockBodyScroll';
import globalMessages from '@app/i18n/globalMessages';
import { Transition } from '@headlessui/react';
import { Transition, TransitionChild } from '@headlessui/react';
import type { MouseEvent } from 'react';
import React, { Fragment, useEffect, useRef } from 'react';
import ReactDOM from 'react-dom';
Expand Down Expand Up @@ -88,7 +88,7 @@ const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
useLockBodyScroll(true, disableScrollLock);

return ReactDOM.createPortal(
<Transition.Child
<TransitionChild
as="div"
className="fixed bottom-0 left-0 right-0 top-0 z-50 flex h-full w-full items-center justify-center bg-gray-800/70"
enter="transition-opacity duration-300"
Expand Down Expand Up @@ -242,7 +242,7 @@ const Modal = React.forwardRef<HTMLDivElement, ModalProps>(
</div>
)}
</Transition>
</Transition.Child>,
</TransitionChild>,
document.body
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Common/SlideOver/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable jsx-a11y/click-events-have-key-events */
import { useLockBodyScroll } from '@app/hooks/useLockBodyScroll';
import { Transition } from '@headlessui/react';
import { Transition, TransitionChild } from '@headlessui/react';
import { XMarkIcon } from '@heroicons/react/24/outline';
import { Fragment, useEffect, useRef, useState } from 'react';
import ReactDOM from 'react-dom';
Expand Down Expand Up @@ -40,7 +40,7 @@ const SlideOver = ({
enter="transition-opacity ease-in-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="transition-opacity ease-in-out duration-300"
leave="transition-opacity ease-in-out duration-500 sm:duration-700"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
Expand All @@ -56,7 +56,7 @@ const SlideOver = ({
>
<div className="absolute inset-0 overflow-hidden">
<section className="absolute inset-y-0 right-0 flex max-w-full">
<Transition.Child
<TransitionChild
as="div"
enter="transition-transform ease-in-out duration-500 sm:duration-700"
enterFrom="translate-x-full"
Expand Down Expand Up @@ -102,7 +102,7 @@ const SlideOver = ({
</div>
</div>
</div>
</Transition.Child>
</TransitionChild>
</section>
</div>
</div>
Expand Down
24 changes: 15 additions & 9 deletions src/components/IssueDetails/IssueComment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import Modal from '@app/components/Common/Modal';
import { Permission, useUser } from '@app/hooks/useUser';
import globalMessages from '@app/i18n/globalMessages';
import defineMessages from '@app/utils/defineMessages';
import { Menu, Transition } from '@headlessui/react';
import {
Menu,
MenuButton,
MenuItem,
MenuItems,
Transition,
} from '@headlessui/react';
import { EllipsisVerticalIcon } from '@heroicons/react/24/solid';
import type { default as IssueCommentType } from '@server/entity/IssueComment';
import axios from 'axios';
Expand Down Expand Up @@ -106,13 +112,13 @@ const IssueComment = ({
{({ open }) => (
<>
<div>
<Menu.Button className="flex items-center rounded-full text-gray-400 hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-100">
<MenuButton className="flex items-center rounded-full text-gray-400 hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-100">
<span className="sr-only">Open options</span>
<EllipsisVerticalIcon
className="h-5 w-5"
aria-hidden="true"
/>
</Menu.Button>
</MenuButton>
</div>

<Transition
Expand All @@ -125,13 +131,13 @@ const IssueComment = ({
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
<Menu.Items
<MenuItems
static
className="absolute right-0 mt-2 w-56 origin-top-right rounded-md bg-gray-700 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
>
<div className="py-1">
{isActiveUser && (
<Menu.Item>
<MenuItem>
{({ active }) => (
<button
onClick={() => setIsEditing(true)}
Expand All @@ -144,9 +150,9 @@ const IssueComment = ({
{intl.formatMessage(messages.edit)}
</button>
)}
</Menu.Item>
</MenuItem>
)}
<Menu.Item>
<MenuItem>
{({ active }) => (
<button
onClick={() => setShowDeleteModal(true)}
Expand All @@ -159,9 +165,9 @@ const IssueComment = ({
{intl.formatMessage(messages.delete)}
</button>
)}
</Menu.Item>
</MenuItem>
</div>
</Menu.Items>
</MenuItems>
</Transition>
</>
)}
Expand Down
24 changes: 15 additions & 9 deletions src/components/IssueDetails/IssueDescription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import Button from '@app/components/Common/Button';
import { Permission, useUser } from '@app/hooks/useUser';
import globalMessages from '@app/i18n/globalMessages';
import defineMessages from '@app/utils/defineMessages';
import { Menu, Transition } from '@headlessui/react';
import {
Menu,
MenuButton,
MenuItem,
MenuItems,
Transition,
} from '@headlessui/react';
import { EllipsisVerticalIcon } from '@heroicons/react/24/solid';
import { Field, Form, Formik } from 'formik';
import { useState } from 'react';
Expand Down Expand Up @@ -45,13 +51,13 @@ const IssueDescription = ({
{({ open }) => (
<>
<div>
<Menu.Button className="flex items-center rounded-full text-gray-400 hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-100">
<MenuButton className="flex items-center rounded-full text-gray-400 hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-100">
<span className="sr-only">Open options</span>
<EllipsisVerticalIcon
className="h-5 w-5"
aria-hidden="true"
/>
</Menu.Button>
</MenuButton>
</div>

<Transition
Expand All @@ -64,13 +70,13 @@ const IssueDescription = ({
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
<Menu.Items
<MenuItems
static
className="absolute right-0 mt-2 w-56 origin-top-right rounded-md bg-gray-700 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
>
<div className="py-1">
{belongsToUser && (
<Menu.Item>
<MenuItem>
{({ active }) => (
<button
onClick={() => setIsEditing(true)}
Expand All @@ -83,11 +89,11 @@ const IssueDescription = ({
{intl.formatMessage(messages.edit)}
</button>
)}
</Menu.Item>
</MenuItem>
)}
{(hasPermission(Permission.MANAGE_ISSUES) ||
!commentCount) && (
<Menu.Item>
<MenuItem>
{({ active }) => (
<button
onClick={() => onDelete()}
Expand All @@ -100,10 +106,10 @@ const IssueDescription = ({
{intl.formatMessage(messages.deleteissue)}
</button>
)}
</Menu.Item>
</MenuItem>
)}
</div>
</Menu.Items>
</MenuItems>
</Transition>
</>
)}
Expand Down
10 changes: 4 additions & 6 deletions src/components/IssueModal/CreateIssueModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useToasts from '@app/hooks/useToasts';
import { Permission, useUser } from '@app/hooks/useUser';
import globalMessages from '@app/i18n/globalMessages';
import defineMessages from '@app/utils/defineMessages';
import { RadioGroup } from '@headlessui/react';
import { Label, RadioGroup } from '@headlessui/react';
import { ArrowRightCircleIcon } from '@heroicons/react/24/solid';
import { MediaStatus } from '@server/constants/media';
import type Issue from '@server/entity/Issue';
Expand Down Expand Up @@ -241,9 +241,7 @@ const CreateIssueModal = ({
onChange={(issue) => setFieldValue('selectedIssue', issue)}
className="mt-4"
>
<RadioGroup.Label className="sr-only">
Select an Issue
</RadioGroup.Label>
<Label className="sr-only">Select an Issue</Label>
<div className="-space-y-px overflow-hidden rounded-md bg-gray-800/30">
{issueOptions.map((setting, index) => (
<RadioGroup.Option
Expand Down Expand Up @@ -277,14 +275,14 @@ const CreateIssueModal = ({
<span className="h-1.5 w-1.5 rounded-full bg-white" />
</span>
<div className="ml-3 flex flex-col">
<RadioGroup.Label
<Label
as="span"
className={`block text-sm font-medium ${
checked ? 'text-indigo-100' : 'text-gray-100'
}`}
>
{intl.formatMessage(setting.name)}
</RadioGroup.Label>
</Label>
</div>
</>
)}
Expand Down
10 changes: 5 additions & 5 deletions src/components/Layout/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import VersionStatus from '@app/components/Layout/VersionStatus';
import useClickOutside from '@app/hooks/useClickOutside';
import { Permission, useUser } from '@app/hooks/useUser';
import defineMessages from '@app/utils/defineMessages';
import { Transition } from '@headlessui/react';
import { Transition, TransitionChild } from '@headlessui/react';
import {
ClockIcon,
CogIcon,
Expand Down Expand Up @@ -152,7 +152,7 @@ const Sidebar = ({
<div className="lg:hidden">
<Transition as={Fragment} show={open}>
<div className="fixed inset-0 z-40 flex">
<Transition.Child
<TransitionChild
as="div"
enter="transition-opacity ease-linear duration-300"
enterFrom="opacity-0"
Expand All @@ -164,8 +164,8 @@ const Sidebar = ({
<div className="fixed inset-0">
<div className="absolute inset-0 bg-gray-900 opacity-90" />
</div>
</Transition.Child>
<Transition.Child
</TransitionChild>
<TransitionChild
as="div"
enter="transition-transform ease-in-out duration-300"
enterFrom="-translate-x-full"
Expand Down Expand Up @@ -243,7 +243,7 @@ const Sidebar = ({
{/* <!-- Force sidebar to shrink to fit close icon --> */}
</div>
</>
</Transition.Child>
</TransitionChild>
</div>
</Transition>
</div>
Expand Down
Loading
Loading