Skip to content

Commit

Permalink
feat : Edit service on service detail page and loading photo on temps…
Browse files Browse the repository at this point in the history
…torage(needs modification)
  • Loading branch information
daisythepotato committed Feb 3, 2025
1 parent 19e87c0 commit c7e9a95
Show file tree
Hide file tree
Showing 15 changed files with 522 additions and 335 deletions.
2 changes: 1 addition & 1 deletion src/assets/common/Pencil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/common/Pencil2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/common/Trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions src/common/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import BottomButton from './BottomButton';
import { View } from 'react-native';
interface FooterProps {
suspended: boolean; // 중단된 서비스인지 여부.
hideButton: boolean;
}

const Footer: React.FC<FooterProps> = ({ suspended }) => {
const Footer: React.FC<FooterProps> = ({ suspended, hideButton }) => {
// API 연결 전, 인터랙션만
const [like, setLike] = useState<boolean>(false);
const [pressed, setPressed] = useState<boolean>(false);
Expand All @@ -16,12 +17,14 @@ const Footer: React.FC<FooterProps> = ({ suspended }) => {
<View>
<FooterContainer style={{ paddingTop: 10 }}>
{/* <HeartButton like={like} onPress={() => { setLike(!like) }} blank /> */}
<BottomButton
value={value}
pressed={pressed}
onPress={() => {}}
style={{ width: '95%' }}
/>
{!hideButton && (
<BottomButton
value={value}
pressed={pressed}
onPress={() => {}}
style={{ width: '95%' }}
/>
)}
</FooterContainer>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion src/common/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function Request() {
// upcy temp api url: http://52.78.43.6:8000/
// upcy domain: http://upcy.co.kr:8000/

const url = 'https://upcy.co.kr' + path;
const url = 'https://api.sullung.site' + path;

let headerValue;

Expand Down
4 changes: 2 additions & 2 deletions src/components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ export async function processLoginResponse( // 통상 로그인시 호출 함수
try {
const response = await request.get(`/api/market`, {}, headers)
if (response.status && response.status === 200) {
setMarketUUID(response.data[0].market_uuid);
console.log('processLogin에서:', response.data[0].market_uuid)
setMarketUUID(response.data.market_uuid);
console.log('processLogin에서:', response.data.market_uuid)
} else {
console.log('processLogin에서 MarketUUID 저장 실패:', response);
}
Expand Down
6 changes: 2 additions & 4 deletions src/components/Auth/Reformer/ReformerMyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,10 @@ export const ReformerMyPageScreen = ({
// 본인 마켓 정보 가져오기: 링크, 자기소개, 닉네임, uuid
const response2 = await request.get(`/api/market`, {}, headers);
if (response2 && response2.status === 200) {
const marketResult: MarketResponseType = response2.data[0];
const marketResult: MarketResponseType = response2.data;
setMarketResponseData(marketResult);
const marketUUID = await getMarketUUID();
fetchMarketData({
//market_thumbnail: marketResult.market_thumbnail || '', // 기본값 유지
market_uuid: marketUUID || marketResult.market_uuid,
market_uuid: marketResult.market_uuid,
});
console.log('마켓 정보 가져오기 성공', response2.data);
try {
Expand Down
9 changes: 6 additions & 3 deletions src/components/Home/Market/Service.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useEffect } from 'react';
import { useFocusEffect } from '@react-navigation/native';
// FIXME: 이거 사용
import {
View,
Expand Down Expand Up @@ -103,6 +104,7 @@ const EntireServiceMarket = ({
region: '',
});


const [modalOpen, setModalOpen] = useState<boolean>(false);
const [loading, setLoading] = useState(true); // 로딩용
const request = Request();
Expand Down Expand Up @@ -173,9 +175,10 @@ const EntireServiceMarket = ({
};

const extractData = (rawData: ServiceResponseType[]) => {
return rawData.map(service => ({
return rawData.map(service => {
//TODO: 밑에 수정
name: service.reformer_nickname,
return {
name: service.reformer_info?.user_info?.nickname || "Reformer",
created: service.created || new Date('2023-12-12'),
basic_price: service.basic_price,
max_price: service.max_price,
Expand Down Expand Up @@ -203,7 +206,7 @@ const EntireServiceMarket = ({
: [],
temporary: service.temporary,
suspended: service.suspended,
})) as ServiceCardProps[];
}}) as ServiceCardProps[];
};

// 컴포넌트가 처음 렌더링될 때 API 호출
Expand Down
Loading

0 comments on commit c7e9a95

Please sign in to comment.