Skip to content

Commit

Permalink
Merge pull request #28 from team-pofo/feature/#25/projectDetailPage
Browse files Browse the repository at this point in the history
Feature/#25/project detail page
  • Loading branch information
ji-hunc authored Dec 20, 2024
2 parents f1bfcf3 + 2073abb commit 6910403
Show file tree
Hide file tree
Showing 14 changed files with 526 additions and 71 deletions.
6 changes: 6 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const nextConfig = {
hostname: "velog.velcdn.com", // 도메인 설정
pathname: "/**", // 경로 설정, 모든 경로 허용
},

{
// 외부 이미지 테스트를 위한 경로 등록(국민대)
protocol: "https",
hostname: "www.kookmin.ac.kr",
},
],
},
output: "standalone",
Expand Down
63 changes: 14 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"react": "^18",
"react-dom": "^18",
"react-icons": "^5.3.0",
"react-redux": "^9.1.2",
"react-spinners": "^0.14.1",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
Expand Down
3 changes: 1 addition & 2 deletions src/components/Newpost/ImageUpload/ImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ export default function UploadBox() {
openImagePreview(img);
}}
alt=""
width={196}
height={196}
layout="fill"
/>
<Style.CloseButton
className="close-button"
Expand Down
13 changes: 2 additions & 11 deletions src/components/Newpost/ImageUpload/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const lightgrey = "#d7e2eb";
const grey = "#b2c0cc";

export const ImageUploadContainer = styled.div`
display: flex;
white-space: nowrap;
display: fixed;
gap: 20px;
justify-content: start;
align-items: center;
Expand Down Expand Up @@ -38,16 +37,8 @@ export const ImagePreview = styled.div`
width: 200px;
height: 200px;
position: relative;
display: inline-block;
border-radius: 5px;
img {
object-fit: contain;
}
&:hover .close-button {
display: flex;
object-fit: cover;
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as Style from "./styles";

const MDEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false });

function MdEditor() {
function MDEditorWriter() {
const [value, setValue] = useState<string>("**프로젝트 소개를 입력하세요**");
const [loading, setLoading] = useState<boolean>(false);
const [isActive, setIsActive] = useState<boolean>(false);
Expand Down Expand Up @@ -45,7 +45,7 @@ function MdEditor() {
(prev) =>
prev.substring(0, cursorPosition) +
`\n![image](https://www.kookmin.ac.kr/content/05sub/style0005/images/sub/ui_5_col_image_3.jpg)\n` +
prev.substring(cursorPosition)
prev.substring(cursorPosition),
);
}
setLoading(false);
Expand Down Expand Up @@ -77,7 +77,7 @@ function MdEditor() {
(prev) =>
prev.substring(0, cursorPosition) +
`\n![image](https://www.kookmin.ac.kr/content/05sub/style0005/images/sub/ui_5_col_image_2.jpg)\n` +
prev.substring(cursorPosition)
prev.substring(cursorPosition),
);
}
setLoading(false);
Expand Down Expand Up @@ -154,4 +154,4 @@ function MdEditor() {
);
}

export default MdEditor;
export default MDEditorWriter;
2 changes: 1 addition & 1 deletion src/components/Newpost/Newpost.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Style from "./styles";
import SelectStackType from "../SelectStackType/SelectStackType";
import NewpostEditor from "./MDEditor/mdeditor";
import NewpostEditor from "./MDEditor/MdeditorWriter";
import { useEffect, useRef, useState } from "react";
import NewpostImages from "./ImageUpload/ImageUpload";
import { useSelectStacks } from "@/stores/selectStackType/selectStacksStore";
Expand Down
24 changes: 24 additions & 0 deletions src/components/Project/MDEditor/MdeditorViewer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import "@uiw/react-md-editor/markdown-editor.css";
import "@uiw/react-markdown-preview/markdown.css";
import styles from "./styles.module.css";
import dynamic from "next/dynamic";
import { testReadme } from "./TestReadme";

const MDEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false });

function MDEditorViewer() {
return (
<div style={{ marginTop: "20px" }}>
<MDEditor
className={styles.editor}
preview={"preview"}
hideToolbar={true}
visiableDragbar={false}
tabSize={2}
value={testReadme}
/>
</div>
);
}

export default MDEditorViewer;
Loading

0 comments on commit 6910403

Please sign in to comment.