-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: adjust dialog list position and disconnect button event #4
- Loading branch information
1 parent
b470f17
commit f5972ac
Showing
5 changed files
with
86 additions
and
21 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import styled from "styled-components"; | ||
import * as React from "react"; | ||
import PropTypes from "prop-types"; | ||
import List from "@mui/material/List"; | ||
|
@@ -7,32 +8,33 @@ import ListItemText from "@mui/material/ListItemText"; | |
import Dialog from "@mui/material/Dialog"; | ||
import { useRecoilState } from "recoil"; | ||
import { dialog, dialogState } from "../../recoil/commonState"; | ||
|
||
const emails = ["[email protected]", "[email protected]"]; | ||
import People from "../../assets/icons/people.svg"; | ||
import Person from "../../assets/icons/person.svg"; | ||
|
||
export default function AddTripDialog(props) { | ||
const { onClose, open } = props; | ||
const [dialog, setDialog] = useRecoilState(dialogState); | ||
|
||
const handleClose = () => { | ||
onClose(); | ||
setDialog(false); | ||
}; | ||
|
||
return ( | ||
<Dialog onClose={handleClose} open={dialog}> | ||
<List sx={{ pt: 0 }}> | ||
<ListItem disableGutters> | ||
<ListItemButton> | ||
<ListItemText>직접 추가</ListItemText> | ||
</ListItemButton> | ||
</ListItem> | ||
<ListItem disableGutters> | ||
<ListItemButton> | ||
<ListItemText>친구 여행</ListItemText> | ||
</ListItemButton> | ||
</ListItem> | ||
</List> | ||
</Dialog> | ||
<StDialog onClose={handleClose} open={dialog}> | ||
<AddList> | ||
<AddlstItm disableGutters> | ||
<AddItemBtn onClick={handleClose}> | ||
<IconImg src={Person} /> | ||
<ListItemText>여행 추가하기</ListItemText> | ||
</AddItemBtn> | ||
</AddlstItm> | ||
<AddlstItm disableGutters> | ||
<AddItemBtn onClick={handleClose}> | ||
<IconImg src={People} /> | ||
<ListItemText>친구 여행 참여하기</ListItemText> | ||
</AddItemBtn> | ||
</AddlstItm> | ||
</AddList> | ||
</StDialog> | ||
); | ||
} | ||
|
||
|
@@ -41,3 +43,41 @@ AddTripDialog.propTypes = { | |
open: PropTypes.bool.isRequired, | ||
selectedValue: PropTypes.string.isRequired, | ||
}; | ||
|
||
const StDialog = styled(Dialog)` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
padding-left: 20rem; | ||
padding-bottom: 31.6rem; | ||
border: 1px solid red; | ||
`; | ||
|
||
const AddList = styled(List)` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: fit-content; | ||
height: fit-content; | ||
padding-top: 0.2rem; | ||
padding-bottom: 0.2rem; | ||
`; | ||
|
||
const AddlstItm = styled(ListItem)` | ||
width: 13rem; | ||
height: fit-content; | ||
padding: 0rem; | ||
`; | ||
const AddItemBtn = styled(ListItemButton)` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: fit-content; | ||
height: fit-content; | ||
padding: 0.1rem 0rem 0.1rem 0.8rem; | ||
`; | ||
const IconImg = styled.img` | ||
margin-right: 0.7rem; | ||
`; |
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