Skip to content

Commit

Permalink
feat(#5):다시
Browse files Browse the repository at this point in the history
  • Loading branch information
EunSeok-222 committed Nov 5, 2024
1 parent 1cac539 commit ee55e0b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 20 deletions.
9 changes: 6 additions & 3 deletions src/pages/CommunityPage/CommunityList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const CommunityList = () => {
return (
<ItemTitle>
<Col>
<CommunityText>community</CommunityText>
<CommunityText>고양이가 세상을 지배한다</CommunityText>
<WriteBtn
onClick={() => {
navigate('/community/write');
Expand Down Expand Up @@ -180,20 +180,23 @@ const Category = styled.div`
display: flex;
justify-content: space-around;
margin: 10px 0px;
align-items: center;
`;
const CategoryBtn = styled.div`
display: flex;
font-size:13px ;
flex-direction: column;
align-items: center;
cursor: pointer;
opacity: ${({ $active }) => ($active ? '1' : '0.5')};
transition: opacity 0.3s;
&:hover {
opacity: 1;
}
`;
const CategoryImg = styled.img`
width: 40px;
height: 40px;
width: 25px;
height: 30px;
`;

const RowLi = styled.div`
Expand Down
23 changes: 14 additions & 9 deletions src/pages/CommunityPage/CommunityWrite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const CommunityWrite = () => {
{ src: images.categoryAll, name: '전체' },
{ src: images.categoryFreedom, name: '자유' },
{ src: images.categoryDongNea, name: '동네' },
{ src: images.categoryExport, name: '전문가' },
{ src: images.categoryAnonymous, name: '익명' },
{ src: images.categoryExpert, name: '전문가' },
{ src: images.categoryAnonymity, name: '익명' },
{ src: images.categoryEvent, name: '이벤트' },
];

Expand Down Expand Up @@ -134,12 +134,14 @@ const CommunityWrite = () => {
</label>
<br />
</div>
<div style={{display:'flex'}}>
<SubmitBtn>
<Div>욕설 광고등 운영저책 위반 시 제재를 받으실 수 있습니다</Div>
<BuWrite type="submit" disabled={loading}>
{loading ? '등록중...' : '작성 완료'}
</BuWrite>
</SubmitBtn>
</div>
</Form>
</ItemTitle>
);
Expand Down Expand Up @@ -194,7 +196,7 @@ const Category = styled.div`
padding: 10px;
display: flex;
justify-content: space-around;
margin: 10px 0px;
margin: 0px 0px;
`;
const CategoryBtn = styled.div`
display: flex;
Expand All @@ -207,13 +209,13 @@ const CategoryBtn = styled.div`
}
`;
const CategoryImg = styled.img`
width: 40px;
height: 40px;
width: 25px;
height: 30px;
`;
const Textarea = styled.textarea`
margin: 10px 0px 15px 0px;
width: 100%;
height: 15em;
height: 10em;
display: flex;
align-items: center;
padding: 15px;
Expand Down Expand Up @@ -282,11 +284,14 @@ const LableImg = styled.label`
width: 65px;
`;
const Form = styled.form`
height: 100%;
height: 100vh;
display: flex;
position: relative;
flex-direction: column;
`;
const SubmitBtn = styled.div`
margin-top: auto;
margin-bottom: 0px;
position: absolute;
bottom:0px;
width: 100%;
justify-content: flex-end;
`;
9 changes: 6 additions & 3 deletions src/pages/NanumPage/NanumList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const BuWrite = styled.button`
align-items: center;
justify-content: center;
color: white;
cursor: pointer;
`;
const All = styled.div`
font-size: 12px;
Expand All @@ -219,9 +220,10 @@ const ListImg = styled.img`
background-color: #d9d9d9;
border-radius: 8px;
flex-shrink: 0; /* 이미지 크기를 고정 */
background-image: url(${props => props.src}); /* 이미지 URL 설정 */
background-size: cover; /* 이미지를 채우도록 설정 */
background-position: center; /* 이미지 중앙 정렬 */
background-image: url(${props => props.src});
background-size: cover;
background-position: center;
cursor: pointer;
`;
const ListTitlesContainer = styled.div`
display: flex;
Expand Down Expand Up @@ -275,6 +277,7 @@ const Icons = styled.div`
`;
const FcLike1 = styled(FcLike)`
font-size: 16px;
cursor: pointer;
`;
const Comment1 = styled(IoChatbubbleEllipsesOutline)`
font-size: 16px;
Expand Down
27 changes: 22 additions & 5 deletions src/pages/NanumPage/NanumWrite.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import styled from 'styled-components';
import { MdPhotoCamera } from 'react-icons/md';
import axios from '../../apis/AxiosInstance';
import { useState } from 'react';
import { useEffect, useState } from 'react';


const PetItemPage = () => {
const [selectedSaleType, setSelectedSaleType] = useState(''); // 버튼 판매 or 나눔
Expand All @@ -15,6 +16,19 @@ const PetItemPage = () => {
const [sharing, setSharing] = useState(''); // 나눔 . 판매 여부
const [loading, setLoading] = useState(false);



useEffect(() => {
const fetchUserData = async () => {
const userId = localStorage.getItem('userId');

if (!userId) {

console.error('User ID not found in local storage');
return;
}
}
});
const handleSubmit = async e => {
e.preventDefault(); // 새로고침 방지
setLoading(true);
Expand Down Expand Up @@ -85,10 +99,10 @@ const PetItemPage = () => {
<ItemTitle>
<Form onSubmit={handleSubmit}>
<div>
<label htmlFor="user">
{/* <label htmlFor="user">
유저 : <br />
<input id="user" value={user} type="number" onChange={e => setUser(e.target.value)} required />
</label>
</label> */}
<br />
<LableImg htmlFor="imageUrl">
<input type="file" style={{ display: 'none' }} onChange={handleFileChange} accept="image/*" id="imageUrl" />
Expand Down Expand Up @@ -303,9 +317,12 @@ const LableImg = styled.label`
const Form = styled.form`
height: 100%;
display: flex;
position: relative;
flex-direction: column;
`;
const SubmitBtn = styled.div`
margin-top: auto;
margin-bottom: 0px;
position: absolute;
bottom:0px;
width: 100%;
justify-content: flex-end;
`;

0 comments on commit ee55e0b

Please sign in to comment.