11import VersionStatus from '@app/components/Layout/VersionStatus' ;
2- import Transition from '@app/components/Transition' ;
32import useClickOutside from '@app/hooks/useClickOutside' ;
43import { Permission , useUser } from '@app/hooks/useUser' ;
4+ import { Transition } from '@headlessui/react' ;
55import {
66 ClockIcon ,
77 CogIcon ,
@@ -12,7 +12,7 @@ import {
1212} from '@heroicons/react/outline' ;
1313import Link from 'next/link' ;
1414import { useRouter } from 'next/router' ;
15- import { useRef } from 'react' ;
15+ import { Fragment , useRef } from 'react' ;
1616import { defineMessages , useIntl } from 'react-intl' ;
1717
1818const messages = defineMessages ( {
@@ -94,9 +94,10 @@ const Sidebar = ({ open, setClosed }: SidebarProps) => {
9494 return (
9595 < >
9696 < div className = "lg:hidden" >
97- < Transition show = { open } >
97+ < Transition as = { Fragment } show = { open } >
9898 < div className = "fixed inset-0 z-40 flex" >
99- < Transition
99+ < Transition . Child
100+ as = "div"
100101 enter = "transition-opacity ease-linear duration-300"
101102 enterFrom = "opacity-0"
102103 enterTo = "opacity-100"
@@ -107,8 +108,9 @@ const Sidebar = ({ open, setClosed }: SidebarProps) => {
107108 < div className = "fixed inset-0" >
108109 < div className = "absolute inset-0 bg-gray-900 opacity-90" > </ div >
109110 </ div >
110- </ Transition >
111- < Transition
111+ </ Transition . Child >
112+ < Transition . Child
113+ as = "div"
112114 enter = "transition ease-in-out duration-300 transform"
113115 enterFrom = "-translate-x-full"
114116 enterTo = "translate-x-0"
@@ -117,7 +119,7 @@ const Sidebar = ({ open, setClosed }: SidebarProps) => {
117119 leaveTo = "-translate-x-full"
118120 >
119121 < >
120- < div className = "sidebar relative flex w-full max-w-xs flex-1 flex-col bg-gray-800" >
122+ < div className = "sidebar relative flex h-full w-full max-w-xs flex-1 flex-col bg-gray-800" >
121123 < div className = "sidebar-close-button absolute top-0 right-0 -mr-14 p-1" >
122124 < button
123125 className = "flex h-12 w-12 items-center justify-center rounded-full focus:bg-gray-600 focus:outline-none"
@@ -129,7 +131,7 @@ const Sidebar = ({ open, setClosed }: SidebarProps) => {
129131 </ div >
130132 < div
131133 ref = { navRef }
132- className = "flex h-0 flex-1 flex-col overflow-y-auto pt-8 pb-8 sm:pb-4"
134+ className = "flex flex-1 flex-col overflow-y-auto pt-8 pb-8 sm:pb-4"
133135 >
134136 < div className = "flex flex-shrink-0 items-center px-2" >
135137 < span className = "px-4 text-xl text-gray-50" >
@@ -192,7 +194,7 @@ const Sidebar = ({ open, setClosed }: SidebarProps) => {
192194 { /* <!-- Force sidebar to shrink to fit close icon --> */ }
193195 </ div >
194196 </ >
195- </ Transition >
197+ </ Transition . Child >
196198 </ div >
197199 </ Transition >
198200 </ div >
0 commit comments