Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const ProjectDescription = ({
return (
<>
<TitleWithIcon Icon={AdjustIcon} title="프로젝트 상세" />
<Box marginY={2}>{description}</Box>
<Box marginY={2} whiteSpace="pre-wrap">
{description}
</Box>
</>
);
};
Expand Down
6 changes: 6 additions & 0 deletions src/features/projects/hooks/useApplyForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useCreateProjectApplications } from "@features/projects/queries/useCrea

import { useGetProjectApplicationStatus } from "@entities/projects/queries/useGetProjectApplications";

import { useAuthStore } from "@shared/stores/authStore";
import { useSnackbarStore } from "@shared/stores/snackbarStore";

interface ApplyFormResult {
Expand All @@ -27,6 +28,7 @@ interface ApplyFormResult {

const useApplyForm = (): ApplyFormResult => {
const { id: projectId } = useParams();
const { user } = useAuthStore();
const { showError } = useSnackbarStore();

const { data: isApplied = false, isLoading: dataLoading } =
Expand All @@ -41,6 +43,10 @@ const useApplyForm = (): ApplyFormResult => {

const openForm = (): void => {
if (dataLoading) return;
if (!user) {
showError("로그인을 해주세요");
return;
}
setIsFormOpen(true);
};
const closeForm = (): void => setIsFormOpen(false);
Expand Down
10 changes: 9 additions & 1 deletion src/features/projects/ui/ProjectLike.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
getStatusClassname,
shareProjectUrl,
} from "@shared/libs/utils/projectDetail";
import { useSnackbarStore } from "@shared/stores/snackbarStore";
import type { ProjectListRes } from "@shared/types/project";
import {
FavoriteBorderIcon,
Expand All @@ -22,6 +23,13 @@ interface ProjectLikeProps {

const ProjectLike = ({ values }: ProjectLikeProps): JSX.Element => {
const { isLiked, toggleLike } = useOptimisticProjectLike();
const { showError, showSuccess } = useSnackbarStore();

const sharelink = (): void => {
shareProjectUrl()
.then(() => showSuccess("UPL이 복사되었습니다."))
.catch(() => showError("복사 실패"));
};

return (
<Box display="flex" alignItems="center" justifyContent="space-between">
Expand All @@ -37,7 +45,7 @@ const ProjectLike = ({ values }: ProjectLikeProps): JSX.Element => {
<FavoriteBorderIcon />
)}
</HeadIconBox>
<HeadIconBox onClick={shareProjectUrl}>
<HeadIconBox onClick={sharelink}>
<ShareIcon />
</HeadIconBox>
</Box>
Expand Down
7 changes: 2 additions & 5 deletions src/shared/libs/utils/projectDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export const formatDate = (date?: string | Timestamp): string => {
return date;
};

export const shareProjectUrl = (): void => {
navigator.clipboard
.writeText(window.location.href)
.then(() => alert("URL이 복사되었습니다."))
.catch(() => alert("복사 실패"));
export const shareProjectUrl = async (): Promise<void> => {
navigator.clipboard.writeText(window.location.href);
};
4 changes: 3 additions & 1 deletion src/shared/ui/LogoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { SxProps, Theme } from "@mui/material";
import type { JSX } from "react";
import { useNavigate } from "react-router-dom";

import Logo from "./icons/logo.svg";

interface LogoBoxProps {
size?: "small" | "medium" | "large";
onClick?: () => void;
Expand Down Expand Up @@ -40,7 +42,7 @@ const LogoBox = ({
$disableHover={disableHover}
sx={sx}
>
<LogoImage src="/public/logo.svg" alt="프로젝트 잼" $size={size} />
<LogoImage src={Logo} alt="프로젝트 잼" $size={size} />
{showText && <LogoText $size={size}>{text}</LogoText>}
</StyledLogoBox>
);
Expand Down
File renamed without changes