-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FE] 방 생성 때 방장도 참여 정할수 있게 변경 & 데이터 타입 변경(#798) #799
Changes from 10 commits
3e322cb
3053b7b
ed9e32c
0dca925
788d911
e6eb3e5
8ab60ea
ee382bb
5e93f7f
2f74b26
4a42ef9
4b53294
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,22 @@ import Modal, { ModalProps } from "../Modal"; | |
import Button from "@/components/common/button/Button"; | ||
import * as S from "@/components/common/modal/confirmModal/ConfirmModal.style"; | ||
|
||
type AlertModalProps = Omit<ModalProps, "onCancel" | "onConfirm">; | ||
interface AlertModalProps extends ModalProps { | ||
onConfirm: () => void; | ||
confirmButtonText?: string; | ||
} | ||
|
||
const AlertCustomStyle = { | ||
height: "fit-content", | ||
}; | ||
|
||
const AlertModal = ({ ...rest }: AlertModalProps) => { | ||
const AlertModal = ({ confirmButtonText = "확인", ...rest }: AlertModalProps) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return ( | ||
<Modal style={AlertCustomStyle} {...rest}> | ||
<S.ConfirmModalContainer>{rest.children}</S.ConfirmModalContainer> | ||
<S.ButtonWrapper> | ||
<Button size="small" onClick={rest.onClose}> | ||
확인 | ||
<Button size="small" onClick={rest.onConfirm}> | ||
{confirmButtonText} | ||
</Button> | ||
</S.ButtonWrapper> | ||
</Modal> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,9 +86,8 @@ const ControlButton = ({ roomInfo, participationStatus }: ControlButtonProps) => | |
<FocusTrap onEscapeFocusTrap={() => handleToggleDropdown()}> | ||
<S.DropdownItemWrapper> | ||
{dropdownItems.map((item: DropdownItem, index) => ( | ||
<> | ||
<React.Fragment key={item.name}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. key 를 상위에서 선언해주도록 바꿔준거 좋네요 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 콘솔에 에러 뜨고 있더라구요 ...ㅎ 바로 바꿨습니다😄 |
||
<S.DropdownItem | ||
key={item.name} | ||
onClick={() => handleDropdownItemClick(item.action)} | ||
tabIndex={0} | ||
onKeyDown={(e) => { | ||
|
@@ -98,7 +97,7 @@ const ControlButton = ({ roomInfo, participationStatus }: ControlButtonProps) => | |
{item.name} | ||
</S.DropdownItem> | ||
{index < dropdownItems.length - 1 && <S.Divider />} | ||
</> | ||
</React.Fragment> | ||
))} | ||
</S.DropdownItemWrapper> | ||
</FocusTrap> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타입 정의할 때
~Request
,~Response
이렇게 정의하니 더 명확해지고 좋네요~그래서 주석은 굳이 없어도 될 것 같아요!