Skip to content

Commit

Permalink
Merge pull request #105 from ssu-student-union/fix/#104_base-url-change
Browse files Browse the repository at this point in the history
fix : base url 설정 변경
  • Loading branch information
Kangnets authored Aug 29, 2024
2 parents ad0273d + cbd3389 commit c09c4b9
Show file tree
Hide file tree
Showing 30 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions src/components/Breadcrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ interface BreadcrumbProps {

const Breadcrumb = ({
items = new Map<string, string | null>([
['소개', '/intro?category=president&sub-category=intro'],
['총학생회', '/intro?category=president&sub-category=intro'],
['소개', '/homepage-frontend/intro?category=president&sub-category=intro'],
['총학생회', '/homepage-frontend/intro?category=president&sub-category=intro'],
]),
className = '',
}: BreadcrumbProps) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Comment/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function Comment({ comment, replyComment, className, isReply = false, com
if (!localStorage.getItem('kakaoData')) {
const check = window.confirm('로그인 회원만 사용 가능한 기능입니다!');
if (check) {
navigate('/register');
navigate('/homepage-frontend/register');
} else {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/MainCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const MainCarousel = () => {
<MainHeroSection />
<div className="absolute z-10 size-full overflow-clip bg-black opacity-20" />
<img
src={`/image/${index + 1}.jpeg`}
src={`/homepage-frontend/image/${index + 1}.jpeg`}
draggable={false}
alt="landscape"
className="z-0 h-full w-full object-cover"
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function TextArea({
if (!localStorage.getItem('kakaoData')) {
const check = window.confirm('로그인 회원만 사용 가능한 기능입니다!');
if (check) {
navigate('/');
navigate('/homepage-frontend');
} else {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/common/Header/component/AuthButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function AuthButton({ state = State.Onboarding }: AuthButtonProps) {
return (
<button
className={cn(styles.headerItemStyle, 'w-[120px] text-base xs:hidden sm:hidden md:hidden lg:hidden')}
onClick={() => navigate('/register')}
onClick={() => navigate('/homepage-frontend/register')}
>
로그인
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/common/Header/component/HeaderSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function HeaderSheet({ trigger, state = State.Logout }: HeaderSheetProps)
</a>
<Link
className={`flex h-[64px] cursor-pointer items-center border-b border-[#E5E7EB] pl-10 text-gray-800`}
to={state === State.Login ? `/my` : `/register`}
to={state === State.Login ? `/homepage-frontend/my` : `/homepage-frontend/register`}
onClick={() => window.location.reload()}
>
{state === State.Login ? '내정보' : '로그인'}
Expand Down
30 changes: 15 additions & 15 deletions src/containers/common/Header/const/pathData.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
export const menuItems = {
소개: [
{ name: '총학생회', path: '/intro?category=president&sub-category=intro' },
{ name: '총학생회', path: '/homepage-frontend/intro?category=president&sub-category=intro' },
{
name: '중앙집행위원회',
path: '/intro?category=central_executive_committee&sub-category=intro',
path: '/homepage-frontend/intro?category=central_executive_committee&sub-category=intro',
},
{
name: '중앙운영위원회',
path: '/intro?category=central_operating_committee&sub-category=intro',
path: '/homepage-frontend/intro?category=central_operating_committee&sub-category=intro',
},
],
학교생활: [
{ name: '공지사항', path: '/notice' },
{ name: '일정', path: '/menu7' },
{ name: '제휴안내', path: '/partnership' },
{ name: '공지사항', path: '/homepage-frontend/notice' },
{ name: '일정', path: '/homepage-frontend/menu7' },
{ name: '제휴안내', path: '/homepage-frontend/partnership' },
//{ name: "분실물게시판", path: "/lost-article" }, // 보류
{ name: '캠퍼스맵', path: '/campus' },
{ name: '캠퍼스맵', path: '/homepage-frontend/campus' },
],
학생자치기구: [
{ name: '산하기구', path: '/affiliated_organization' },
{ name: '특별기구', path: '/special_organization' },
{ name: '감사기구', path: '/intro?category=audit&sub-category=intro' },
{ name: '산하기구', path: '/homepage-frontend/affiliated_organization' },
{ name: '특별기구', path: '/homepage-frontend/special_organization' },
{ name: '감사기구', path: '/homepage-frontend/intro?category=audit&sub-category=intro' },
],
소통: [
{ name: '학생청원게시판', path: '/petition-notice' },
{ name: '건의게시판', path: '/sug-notice' },
{ name: '인권신고게시판', path: '/human-notice' },
{ name: '학생청원게시판', path: '/homepage-frontend/petition-notice' },
{ name: '건의게시판', path: '/homepage-frontend/sug-notice' },
{ name: '인권신고게시판', path: '/homepage-frontend/human-notice' },
],
};

export const dataPath = '/data'; // 자료집 라우트 경로
export const dataPath = '/homepage-frontend/data'; // 자료집 라우트 경로

export const myPath = `/my`; // 내정보 라우트 경로
export const myPath = `/homepage-frontend/my`; // 내정보 라우트 경로
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function AuditDetailEditSection({

const handleDelete = async () => {
await deleteHandler({ boardCode, postId, fileUrls, mutFile, mutPost });
navigate(`/audit?category=notice`);
navigate(`/homepage-frontend/audit?category=notice`);
window.location.reload();
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/audit/auditDetail/utils/locationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ interface dataType {
}

export const handleLocation = ({ data }: dataType, navigate: NavigateFunction) => {
navigate(`/audit/patch`, { state: { data } });
navigate(`/homepage-frontend/audit/patch`, { state: { data } });
};
2 changes: 1 addition & 1 deletion src/pages/audit/auditEdit/hook/useAuditEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function useAuditEdit() {
},
});

navigate(`/audit?category=notice`);
navigate(`/homepage-frontend/audit?category=notice`);
window.location.reload();
} catch (e) {
console.error(e);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/audit/const/data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Breadcrumb
export const items = new Map<string, string | null>([
['학교자치기구', null],
['감사기구', '/audit?category=all'],
['감사기구', '/homepage-frontend/audit?category=all'],
]);

export const categoryMap: Record<string, string | null> = {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/audit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function AuditPage() {
onSubcategorySelect={(selectedCategory) => {
const categoryKey = Object.keys(categoryMap).find((key) => categoryMap[key] === selectedCategory);
if (categoryKey) {
navigate(`/audit?category=${categoryKey}`);
navigate(`/homepage-frontend/audit?category=${categoryKey}`);
}
}}
/>
Expand All @@ -48,7 +48,7 @@ export function AuditPage() {
currentPage={currentPage}
onPageChange={handlePageChange}
onWriteClick={() => {
navigate(`/audit/edit`);
navigate(`/homepage-frontend/audit/edit`);
}}
className="pt-[32px]"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/audit/utils/cardHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const handleCardClick = (
thumbnailImage: string | undefined,
navigate: NavigateFunction
) => {
navigate(`/audit/${id}`, { state: { postId, category, thumbnailImage } });
navigate(`/homepage-frontend/audit/${id}`, { state: { postId, category, thumbnailImage } });
};
2 changes: 1 addition & 1 deletion src/pages/audit/utils/categoryHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function handleCategory(
) {
const categoryIndex = categories.indexOf(selectedCategory);
const value = categoryValues[categoryIndex];
navigate(`/audit?category=${value}`);
navigate(`/homepage-frontend/audit?category=${value}`);
}

export function findCategoryKey(selectedCategory: string): string | undefined {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/data/containers/DataTitleSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function DataTitleSection({ userId }: DataTitleSectionProps) {
</div>
)}

{location.pathname === '/data/edit' && (
{location.pathname === '/homepage-frontend/data/edit' && (
<div className="mt-[123px] flex h-auto w-full justify-between px-[25px] md:px-[100px]">
<div className="text-[34px] font-bold text-black sm:ml-0 sm:text-2xl md:ml-0 lg:ml-[109px] xl:ml-[199px] xxl:ml-[199px]">
<div>자료집</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/data/containers/dataEditBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function DataEditBtn({ ...props }) {
const navigate = useNavigate();

const handleClick = () => {
navigate('/data/edit');
navigate('/homepage-frontend/data/edit');
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/data/containers/edit/UploadSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export default function UploadSection({ userId }: { userId: string }) {

if (response.status === 200) {
alert('파일 업로드가 완료되었습니다.');
navigate('/data');
navigate('/homepage-frontend/data');
} else {
alert('오류가 발생했습니다. 다시 시도해주세요.');
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/data/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function Data() {
<Header state={State.Login} />
<DataTitleSection userId={userId} />

{location.pathname === '/data' && (
{location.pathname === '/homepage-frontend/data' && (
<>
<DataNavSection />

Expand All @@ -28,7 +28,7 @@ export function Data() {
</>
)}

{location.pathname === '/data/edit' && userId && (
{location.pathname === '/homepage-frontend/data/edit' && userId && (
<>
<div className="mt-8 grid place-items-center">
<UploadSection userId={userId} />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/general/containers/CertifyApplySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function CertifyApplySection() {

const [isButtonDisabled, setIsButtonDisabled] = useState(true);

const isScouncilPath = location.pathname === '/register/scouncil';
const isScouncilPath = location.pathname === '/homepage-frontend/register/scouncil';
const formValues = watch();

useEffect(() => {
Expand Down Expand Up @@ -51,7 +51,7 @@ export function CertifyApplySection() {
console.log('Response from server:', response);

alert('문의내용이 확인되었습니다.');
navigate('/register/errorcheck');
navigate('/homepage-frontend/register/errorcheck');
} catch (error: any) {
// Added type `any` to handle any error shape
if (error.response) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/general/containers/CertifyErrorSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function CertifyErrorSection() {
const navigate = useNavigate();

const handleToMain = () => {
navigate('/');
navigate('/homepage-frontend');
};
return (
<div className="mt-[260px] grid place-content-center text-center">
Expand Down
8 changes: 4 additions & 4 deletions src/pages/general/containers/GeneralRegisterSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function GeneralRegisterSection({ subSection1, buttonSection }: LoginForm
const location = useLocation();
const { sort } = useParams();

const isScouncilPath = location.pathname === '/register/scouncil';
const isScouncilPath = location.pathname === '/homepage-frontend/register/scouncil';

const {
register,
Expand Down Expand Up @@ -51,7 +51,7 @@ export function GeneralRegisterSection({ subSection1, buttonSection }: LoginForm
if (kakaoData) {
const parsedKakaoData = JSON.parse(kakaoData);
if (parsedKakaoData.data?.name && parsedKakaoData.data?.studentId) {
navigate('/');
navigate('/homepage-frontend');
}
}
}
Expand Down Expand Up @@ -100,7 +100,7 @@ export function GeneralRegisterSection({ subSection1, buttonSection }: LoginForm
if (response.status === 200) {
alert('학생 정보가 확인되었습니다');
localStorage.setItem('userId', formValuesScouncil.accountId);
navigate('/');
navigate('/homepage-frontend');
} else {
alert('오류가 발생했습니다. 다시 시도해주세요.');
setScoucilError(true);
Expand All @@ -121,7 +121,7 @@ export function GeneralRegisterSection({ subSection1, buttonSection }: LoginForm
};

const handleCertifyError = () => {
navigate('/register/errorapply');
navigate('/homepage-frontend/register/errorapply');
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/intro/container/IntroEditButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function IntroEditButton() {
const [searchParams] = useSearchParams();

const handleEditClick = () => {
navigate(`/intro/edit?${searchParams.toString()}`);
navigate(`/homepage-frontend/intro/edit?${searchParams.toString()}`);
};

return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/intro/container/hooks/useQueryMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const useCategoryMap = ({
if (selectedSubcategory) {
onSubSelect(selectedSubcategory);
setSearchParams({ category: selectedCategory, 'sub-category': selectedSubcategory });
navigate(`/intro?category=${selectedCategory}&sub-category=${selectedSubcategory}`);
navigate(`/homepage-frontend/intro?category=${selectedCategory}&sub-category=${selectedSubcategory}`);
} else {
setSearchParams({ category: selectedCategory });
navigate(`/intro?category=${selectedCategory}&sub-category=intro`);
navigate(`/homepage-frontend/intro?category=${selectedCategory}&sub-category=intro`);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/intro/container/hooks/useValidateAndRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function useValidateAndRedirect({ category, subCategory }: ValidateAndRed

useEffect(() => {
if (!isValidCategory || !isValidSubCategory) {
navigate('/intro?category=president&sub-category=intro', { replace: true });
navigate('/homepage-frontend/intro?category=president&sub-category=intro', { replace: true });
}
}, [isValidCategory, isValidSubCategory, navigate]);

Expand Down
4 changes: 2 additions & 2 deletions src/pages/intro/container/utils/switchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export function useAuditSwitch() {

const handleAuditSwitchClick = (index: number) => {
if (index === 0) {
navigate('/intro?category=audit&sub-category=intro');
navigate('/homepage-frontend/intro?category=audit&sub-category=intro');
} else {
navigate('/audit?category=all');
navigate('/homepage-frontend/audit?category=all');
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/pages/kakao/containers/KakaoRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const KakaoRedirect = () => {
if (res) {
// res.data 객체에 name과 studentId가 존재하는지 확인
if (res.data?.name && res.data?.studentId) {
navigate('/'); // 조건을 만족하면 홈으로 이동
navigate('/homepage-frontend'); // 조건을 만족하면 홈으로 이동
} else {
navigate('/register/onboarding'); // 조건을 만족하지 않으면 onboarding 페이지로 이동
navigate('/homepage-frontend/register/onboarding'); // 조건을 만족하지 않으면 onboarding 페이지로 이동
}
}
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function PostPetitionDetailPostSection() {

const breadcrumbItems = new Map<string, string | null>([
['소통', null],
['청원게시판', '/petition-notice'],
['청원게시판', '/homepage-frontend/petition-notice'],
]);
const navigate = useNavigate();
const { width } = useResize();
Expand All @@ -49,19 +49,19 @@ export function PostPetitionDetailPostSection() {
const deleteCheck = window.confirm('게시글을 삭제하시겠습니까?');
if (deleteCheck) {
await delBoardPosts('청원게시판', data?.data.postDetailResDto.postId!);
navigate('/petition-notice');
navigate('/homepage-frontend/petition-notice');
} else {
return;
}
};

const handleEditContent = () => {
localStorage.setItem('edit-post', JSON.stringify(data?.data.postDetailResDto.postId));
navigate('/petition-notice/edit');
navigate('/homepage-frontend/petition-notice/edit');
};

const handleMoveToList = () => {
navigate('/petition-notice');
navigate('/homepage-frontend/petition-notice');
};

const mutation = usePostPostReaction();
Expand All @@ -72,7 +72,7 @@ export function PostPetitionDetailPostSection() {
if (!localStorage.getItem('kakaoData')) {
const check = window.confirm('로그인 회원만 사용 가능한 기능입니다!');
if (check) {
navigate('/register');
navigate('/homepage-frontend/register');
} else {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function PetitionNoticePopularSection() {
);

const handlePostDetail = (id: number) => {
navigate(`/petition-notice/${id}`);
navigate(`/homepage-frontend/petition-notice/${id}`);
};

return (
Expand All @@ -88,7 +88,7 @@ export function PetitionNoticePopularSection() {
) : (
<div className="relative mb-[66px] mt-[70px] pl-[200px] text-[1.75rem] font-bold xs:mb-[33px] xs:pl-10 sm:pl-10 md:pl-10 lg:pl-10">
<p className="mb-[11px]">인기청원</p>
<div className="flex gap-6 overflow-scroll pr-5 scrollbar-hide" ref={ref}>
<div className="scrollbar-hide flex gap-6 overflow-scroll pr-5" ref={ref}>
{data?.data.postListResDto &&
data?.data.postListResDto.map((content) => (
<PostTextPetition data={content} key={content.postId} onClick={handlePostDetail} />
Expand Down
Loading

0 comments on commit c09c4b9

Please sign in to comment.