Skip to content

Commit

Permalink
Merge pull request #107 from Ureca-Dangdang-salon/develop
Browse files Browse the repository at this point in the history
알림 테스트 배포
  • Loading branch information
skang9810 authored Dec 11, 2024
2 parents e31959a + e7529b2 commit f062882
Show file tree
Hide file tree
Showing 28 changed files with 299 additions and 175 deletions.
3 changes: 0 additions & 3 deletions public/_redirects

This file was deleted.

1 change: 0 additions & 1 deletion src/api/dogProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const dogProfile = async (id) => {
try {
const url = `${ProfileController.dogProfile}/${id}`;
const { data } = await apiClient.get(url);
console.log(data);
return data.response;
} catch (e) {
console.log(e);
Expand Down
3 changes: 2 additions & 1 deletion src/api/socialProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export const socialProfile = async () => {
}
};

export const updateSocialProfile = async (district_id) => {
export const updateSocialProfile = async (image_key, district_id) => {
try {
const { data } = await apiClient.put(ProfileController.socialProfile, {
imageKey: image_key,
districtId: district_id,
});
if (data.response === '유저 정보가 변경되었습니다.') return true;
Expand Down
7 changes: 2 additions & 5 deletions src/components/Features/ImageSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import { useRef } from 'react';
import { Box, IconButton } from '@mui/material';
import AddRoundedIcon from '@mui/icons-material/AddRounded';
import HighlightOffRoundedIcon from '@mui/icons-material/HighlightOffRounded';
import toast from 'react-hot-toast';
import SubTitle from '@components/NewRequest/atoms/SubTitle';
import { uploadImage } from '@/api/image';
import { maxImagesReached } from '@/utils/toastUtils';

const ImageSelector = ({ maxImages, images, onChange }) => {
const fileInputRef = useRef(null);

const maxImagesReached = () =>
toast.error(`최대 ${maxImages}장까지 업로드 할 수 있습니다`);

const handleOpenFileInput = () => {
if (fileInputRef.current) {
fileInputRef.current.click();
Expand All @@ -24,7 +21,7 @@ const ImageSelector = ({ maxImages, images, onChange }) => {
const fileArray = Array.from(files);

if (images.length + fileArray.length > maxImages) {
maxImagesReached();
maxImagesReached(3);
return;
}

Expand Down
16 changes: 6 additions & 10 deletions src/components/Features/ProfileSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ const ProfileSelector = ({ defaultImage, image, onChange }) => {
width="150px"
height="150px"
alt={selectedImage}
style={
image
? {
borderRadius: '50%',
objectFit: 'cover',
border: '2px solid',
borderColor: '#9747FF',
}
: { borderRadius: '50%' }
}
style={{
borderRadius: '50%',
objectFit: 'cover',
border: '5px solid',
borderColor: '#FDD94E',
}}
/>

<img
Expand Down
19 changes: 11 additions & 8 deletions src/components/Survey/GroomerSteps/Step1.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import SurveySection from '@/components/Survey/Common/SurveySection';
import InputText from '@/components/Common/InputText/InputText';
import useSurveyGroomerStore from '@/store/useSurveyGroomerStore';
import { Box } from '@mui/material';

const Step1 = () => {
const { groomerInfo, setGroomerInfo } = useSurveyGroomerStore();

return (
<SurveySection title="서비스 이름을 적어주세요">
<InputText
size="large"
placeholder="서비스 이름을 입력해주세요"
value={groomerInfo.name}
onChange={(e) => setGroomerInfo({ name: e.target.value })}
/>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="서비스 이름을 적어주세요">
<InputText
size="large"
placeholder="서비스 이름을 입력해주세요"
value={groomerInfo.name}
onChange={(e) => setGroomerInfo({ name: e.target.value })}
/>
</SurveySection>
</Box>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/Survey/GroomerSteps/Step2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Step2 = () => {

return (
<SurveySection title="어떤 서비스를 제공하시나요?">
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5 }}>
{Object.entries(serviceList).map(([service, checked]) => (
<RadioButton
key={service}
Expand Down
20 changes: 11 additions & 9 deletions src/components/Survey/GroomerSteps/Step3.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import SurveySection from '@/components/Survey/Common/SurveySection';
import InputText from '@/components/Common/InputText/InputText';
import useSurveyGroomerStore from '@/store/useSurveyGroomerStore';
import { Box } from '@mui/material';

const Step3 = () => {
const { groomerInfo, setGroomerInfo } = useSurveyGroomerStore();

return (
<SurveySection title="전화번호를 입력해주세요">
<InputText
size="large"
placeholder="전화번호를 입력해주세요 ( - 포함)"
value={groomerInfo.phone}
onChange={(e) => setGroomerInfo({ phone: e.target.value })}
type="tel"
/>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="전화번호를 입력해주세요">
<InputText
size="large"
placeholder="000-0000-0000 ( - 포함)"
value={groomerInfo.phone}
onChange={(e) => setGroomerInfo({ phone: e.target.value })}
/>
</SurveySection>
</Box>
);
};

Expand Down
17 changes: 10 additions & 7 deletions src/components/Survey/GroomerSteps/Step4.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import SurveySection from '@/components/Survey/Common/SurveySection';
import useSurveyGroomerStore from '@/store/useSurveyGroomerStore';
import InputText from '@components/Common/InputText/InputText';
import { Box } from '@mui/material';

const Step4 = () => {
const { groomerInfo, setGroomerInfo } = useSurveyGroomerStore();

return (
<SurveySection title="연락 가능한 시간을 알려 주세요">
<InputText
placeholder="평일 오전 9시 ~ 오후 6시"
value={groomerInfo.contactHours}
onChange={(e) => setGroomerInfo({ contactHours: e.target.value })}
/>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="연락 가능한 시간을 알려 주세요">
<InputText
placeholder="평일 오전 9시 ~ 오후 6시"
value={groomerInfo.contactHours}
onChange={(e) => setGroomerInfo({ contactHours: e.target.value })}
/>
</SurveySection>
</Box>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/Survey/GroomerSteps/Step5.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Step5 = () => {
return (
<SurveySection title="서비스 지역을 알려주세요.">
<Box>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2, mb: 1 }}>
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2, mb: 2 }}>
{serviceAreas.map((area, index) => (
<Box
key={index}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Survey/GroomerSteps/Step7.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Step7 = () => {
</Typography>
<InputText
size="large"
placeholder="사업자 번호를 입력해주세요"
placeholder="123-45-67890"
value={businessInfo.businessNumber}
onChange={(e) =>
setBusinessInfo({ businessNumber: e.target.value })
Expand All @@ -55,7 +55,7 @@ const Step7 = () => {
</Typography>
<InputText
size="large"
placeholder="가게 위치 정보를 입력해주세요"
placeholder="댕댕로 000-00"
value={businessInfo.address}
onChange={(e) => setBusinessInfo({ address: e.target.value })}
/>
Expand Down
19 changes: 11 additions & 8 deletions src/components/Survey/UserSteps/Step1.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import InputText from '@/components/Common/InputText/InputText';
import SurveySection from '@/components/Survey/Common/SurveySection';
import useSurveyUserStore from '@/store/useSurveyUserStore';
import { Box } from '@mui/material';

const Step1 = () => {
const { petInfo, setPetInfo } = useSurveyUserStore();

return (
<SurveySection title="반려견의 이름을 입력해주세요">
<InputText
size="large"
placeholder="이름을 입력해주세요"
value={petInfo.name}
onChange={(e) => setPetInfo({ name: e.target.value })}
/>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="반려견의 이름을 입력해주세요">
<InputText
size="large"
placeholder="이름을 입력해주세요"
value={petInfo.name}
onChange={(e) => setPetInfo({ name: e.target.value })}
/>
</SurveySection>
</Box>
);
};

Expand Down
48 changes: 25 additions & 23 deletions src/components/Survey/UserSteps/Step2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@ const Step2 = () => {
const { petInfo, setPetInfo } = useSurveyUserStore();

return (
<SurveySection title="반려견의 나이를 입력해주세요">
<Box
sx={{
display: 'flex',
gap: 2,
alignItems: 'center',
justifyContent: 'center',
}}
>
<NumberPicker
value={petInfo.ageYear}
onChange={(e) => setPetInfo({ ageYear: e })}
label="년"
max={20}
/>
<NumberPicker
value={petInfo.ageMonth}
onChange={(e) => setPetInfo({ ageMonth: e })}
label="개월"
max={11}
/>
</Box>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="반려견의 나이를 입력해주세요">
<Box
sx={{
display: 'flex',
gap: 2,
alignItems: 'center',
justifyContent: 'center',
}}
>
<NumberPicker
value={petInfo.ageYear}
onChange={(e) => setPetInfo({ ageYear: e })}
label="년"
max={20}
/>
<NumberPicker
value={petInfo.ageMonth}
onChange={(e) => setPetInfo({ ageMonth: e })}
label="개월"
max={11}
/>
</Box>
</SurveySection>
</Box>
);
};

Expand Down
22 changes: 12 additions & 10 deletions src/components/Survey/UserSteps/Step3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ const Step3 = () => {
const { petInfo, setPetInfo } = useSurveyUserStore();

return (
<SurveySection title="반려견의 몸무게를 선택해주세요">
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
<NumberPicker
value={petInfo.weight}
onChange={(value) => setPetInfo({ weight: value })}
label="kg"
max={100}
/>
</Box>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="반려견의 몸무게를 선택해주세요">
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
<NumberPicker
value={petInfo.weight}
onChange={(value) => setPetInfo({ weight: value })}
label="kg"
max={100}
/>
</Box>
</SurveySection>
</Box>
);
};

Expand Down
21 changes: 12 additions & 9 deletions src/components/Survey/UserSteps/Step4.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import SurveySection from '@/components/Survey/Common/SurveySection';
import useSurveyUserStore from '@/store/useSurveyUserStore';
import { Selector } from '@components/Common/Selector/Selector';
import { breeds } from '@/constants/breeds';
import { Box } from '@mui/material';

const Step4 = () => {
const { petInfo, setPetInfo } = useSurveyUserStore();
Expand All @@ -11,15 +12,17 @@ const Step4 = () => {
};

return (
<SurveySection title="반려견의 견종을 입력해주세요">
<Selector
label="견종을 선택해주세요"
value={petInfo.species}
choices={breeds}
onChange={handleChange}
field="species"
/>
</SurveySection>
<Box mt={15} mb={15}>
<SurveySection title="반려견의 견종을 입력해주세요">
<Selector
label="견종을 선택해주세요"
value={petInfo.species}
choices={breeds}
onChange={handleChange}
field="species"
/>
</SurveySection>
</Box>
);
};

Expand Down
1 change: 1 addition & 0 deletions src/constants/breeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const breeds = [
'골든 리트리버',
'저먼 셰퍼드',
'비글',
'말티푸',
'시베리안 허스키',
'불독',
'요크셔 테리어',
Expand Down
1 change: 0 additions & 1 deletion src/pages/NewReview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const NewReview = () => {

return (
<Box>
<Toaster />
<DetailHeader label="리뷰 작성" />
<Box p={4}>
<Box display="flex">
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Survey/Survey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ function Survey() {
>
<Button
size="large"
disabled={location ? false : true}
backgroundColor={location ? 'primary' : 'n3'}
onClick={handleHairstylistSignup}
label="미용사로 가입하기"
/>
<Button
size="large"
disabled={location ? false : true}
backgroundColor={location ? 'secondary' : 'n3'}
onClick={handleUserSignup}
label="사용자로 가입하기"
Expand Down
Loading

0 comments on commit f062882

Please sign in to comment.