From 428a53ed293d46d6a6e3856963c26070a9f66117 Mon Sep 17 00:00:00 2001 From: teagu123 <103398790+teagu123@users.noreply.github.com> Date: Sat, 5 Oct 2024 16:49:25 +0900 Subject: [PATCH] Fix/issue #129 (#130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix : 프로젝트 글쓰기 권한 전체로 변경 * Fix : local 삭제후 commit --- src/pages/project/components/Header.tsx | 17 +---------------- src/pages/project/components/HeaderStyle.tsx | 5 ++--- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/pages/project/components/Header.tsx b/src/pages/project/components/Header.tsx index c45fde79..c5da46ce 100644 --- a/src/pages/project/components/Header.tsx +++ b/src/pages/project/components/Header.tsx @@ -3,10 +3,7 @@ import * as P from './HeaderStyle'; import WriteIcon from '../../../img/project/write.svg'; import { useNavigate } from 'react-router-dom'; import { ProjectAPI } from './ProjectList'; - import { Gen } from '../register/RegisterOptions'; -import { useAuth } from '../../../hooks/useAuth'; -import { RolePriority } from '../../../constants/Role'; interface IHeader { setProjectApi: React.Dispatch>; @@ -19,18 +16,6 @@ function Header({ setProjectApi }: IHeader) { setActiveTab(index); }; - const { userinfo, isLoading } = useAuth(); - const isSuperAdminInfo = - RolePriority.findIndex(role => role === userinfo.role) >= 3; - - const [isAdmin, setIsAdmin] = useState(false); - - useEffect(() => { - if (isSuperAdminInfo && !isLoading) { - setIsAdmin(true); - } - }, [isLoading, isSuperAdminInfo]); - useEffect(() => { // 전체를 클릭할 경우 if (activeTab === undefined) { @@ -82,7 +67,7 @@ function Header({ setProjectApi }: IHeader) { - + write 글쓰기 diff --git a/src/pages/project/components/HeaderStyle.tsx b/src/pages/project/components/HeaderStyle.tsx index d5a03ce0..ad7cdd3d 100644 --- a/src/pages/project/components/HeaderStyle.tsx +++ b/src/pages/project/components/HeaderStyle.tsx @@ -66,14 +66,13 @@ export const Divider = styled.div` display: none; `; -export const WriteBtn = styled.button<{ isAdmin: boolean }>` - display: ${props => (props.isAdmin ? 'inline-flex' : 'none')}; +export const WriteBtn = styled.button` margin-left: 20px; padding: 8px 20px 8px 14px; justify-content: center; align-items: center; gap: 6px; - + display: inline-flex; border-radius: 6px; border: none; background: var(--Orange-600, #ff7710);