-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from boostcampwm-2024/Feature/#71_로그인한_사용자는_권…
…한이_있는_워크스페이스에_다른_사용자를_초대_구현 Feature/#71 로그인한 사용자는 권한이 있는 워크스페이스에 다른 사용자를 초대 구현
- Loading branch information
Showing
16 changed files
with
450 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// InviteModal.style.ts | ||
import { css } from "@styled-system/css"; | ||
|
||
export const modalContentContainer = css({ | ||
display: "flex", | ||
gap: "16px", | ||
flexDirection: "column", | ||
width: "400px", | ||
padding: "16px", | ||
}); | ||
|
||
export const titleText = css({ | ||
color: "gray.800", | ||
fontSize: "xl", | ||
fontWeight: "bold", | ||
}); | ||
|
||
export const descriptionText = css({ | ||
color: "gray.600", | ||
fontSize: "sm", | ||
}); | ||
|
||
export const emailInput = css({ | ||
outline: "none", | ||
border: "1px solid", | ||
borderColor: "gray.200", | ||
borderRadius: "md", | ||
// 기본 input 스타일 추가 | ||
width: "100%", | ||
padding: "8px 12px", | ||
fontSize: "sm", | ||
_placeholder: { | ||
color: "gray.400", | ||
}, | ||
_focus: { | ||
borderColor: "blue.500", | ||
boxShadow: "0 0 0 1px blue.500", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// InviteModal.tsx | ||
import { useState } from "react"; | ||
import { modalContentContainer, titleText, descriptionText, emailInput } from "./InviteModal.style"; | ||
import { Modal } from "./modal"; | ||
|
||
interface InviteModalProps { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
onInvite: (email: string) => void; | ||
} | ||
|
||
export const InviteModal = ({ isOpen, onClose, onInvite }: InviteModalProps) => { | ||
const [email, setEmail] = useState(""); | ||
|
||
const handleInvite = () => { | ||
onInvite(email); | ||
setEmail(""); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
isOpen={isOpen} | ||
primaryButtonLabel="초대하기" | ||
primaryButtonOnClick={handleInvite} | ||
secondaryButtonLabel="취소" | ||
secondaryButtonOnClick={onClose} | ||
> | ||
<div className={modalContentContainer}> | ||
<h2 className={titleText}>워크스페이스 초대</h2> | ||
<p className={descriptionText}>초대할 사용자의 이메일을 입력해주세요</p> | ||
<input | ||
className={emailInput} | ||
onChange={(e) => setEmail(e.target.value)} | ||
placeholder="이메일 주소 입력" | ||
type="email" | ||
value={email} | ||
/> | ||
</div> | ||
</Modal> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.../src/components/sidebar/components/menuButton/components/components/InviteButton.style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { css } from "@styled-system/css"; | ||
|
||
export const inviteButtonStyle = css({ | ||
display: "flex", | ||
gap: "32px", | ||
alignItems: "center", | ||
borderTop: "1px solid", | ||
borderColor: "gray.200", | ||
|
||
width: "100%", | ||
padding: "12px 16px", | ||
color: "gray.600", | ||
backgroundColor: "transparent", | ||
transition: "all 0.2s", | ||
cursor: "pointer", | ||
_hover: { | ||
backgroundColor: "gray.200", | ||
}, | ||
}); |
15 changes: 15 additions & 0 deletions
15
client/src/components/sidebar/components/menuButton/components/components/InviteButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Plus from "@assets/icons/plusIcon.svg?react"; | ||
import { inviteButtonStyle } from "./InviteButton.style"; | ||
|
||
interface InviteButtonProps { | ||
onClick: () => void; | ||
} | ||
|
||
export const InviteButton = ({ onClick }: InviteButtonProps) => { | ||
return ( | ||
<button onClick={onClick} className={inviteButtonStyle}> | ||
<Plus /> | ||
<span>워크스페이스 초대하기</span> | ||
</button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.