Skip to content

Commit

Permalink
Merge pull request #208 from TUK-DP/develop
Browse files Browse the repository at this point in the history
deploy 1.0
  • Loading branch information
heedong12 authored May 16, 2024
2 parents 3606aad + 173c4e1 commit 0df5523
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 260 deletions.
237 changes: 0 additions & 237 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,20 @@
"chart.js": "^4.4.2",
"d3": "^7.9.0",
"html2canvas": "^1.4.1",
"moveable-helper": "^0.4.0",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.6",
"react-hook-form": "^7.51.0",
"react-icons": "^5.0.1",
"react-kakao-maps-sdk": "^1.1.26",
"react-moveable": "^0.56.0",
"react-redux": "^9.1.0",
"react-resizable": "^3.0.5",
"react-rnd": "^10.4.10",
"react-router-dom": "^6.22.0",
"react-scripts": "5.0.1",
"reacticons": "^0.0.1",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions src/component/Graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Graph = ({
nodeColor = { user: "#FFDFDF", diary: "#FFE3BB", keyword: "#D2E0FB" },

// 노드 간격(노드가 서로 밀려나느힘) 음수일 경우 응집력으로 바뀜
spreadForce = 2000,
spreadForce = 600,
}) => {
const [data, setData] = useState({ nodes: [], relationships: [] });
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -99,7 +99,9 @@ const Graph = ({
let linkText = linkGroup
.append("text")
.text((d) => {
return d.tfidf;
if(d.type === "CONNECTED"){
return parseInt(d.tfidf * 10)/10;
}
})
.style("color", "#000")
.style("fontWeight", "900")
Expand Down
16 changes: 13 additions & 3 deletions src/component/ImageDiary/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const Canvas = ({ isVisible, canvasRef }) => {
const y = touch.clientY - rect.top + window.scrollY;
setPainting(true);
drawFn(x, y);
updateCanvasState();
};

const handleTouchMove = (e) => {
Expand All @@ -109,6 +108,7 @@ const Canvas = ({ isVisible, canvasRef }) => {

const handleTouchEnd = () => {
setPainting(false);
updateCanvasState();
};
// 캔버스 크기를 반응형으로 조절하기 위해 화면의 크기를 받아와서 조정
const [width, setWidth] = useState();
Expand All @@ -131,7 +131,6 @@ const Canvas = ({ isVisible, canvasRef }) => {
const y = e.clientY - rect.top + window.scrollY;
setPainting(true);
drawFn(x, y);
updateCanvasState();
};

const handleMouseMove = (e) => {
Expand All @@ -145,6 +144,7 @@ const Canvas = ({ isVisible, canvasRef }) => {

const handleMouseUp = () => {
setPainting(false);
updateCanvasState();
};

//브러쉬 크기 변경
Expand All @@ -153,6 +153,10 @@ const Canvas = ({ isVisible, canvasRef }) => {
dispatch({ type: BRUSH_SIZE, brushSize: parseInt(event.target.value, 10) });
};

useEffect(() => {
console.log("painting: ", painting, " erasing: ", erasing);
}, [painting, erasing]);

return (
<div
style={{
Expand All @@ -171,6 +175,7 @@ const Canvas = ({ isVisible, canvasRef }) => {
height={width}
style={{
border: "4px solid #D9D9D9",
touchAction: "none",
}}
></canvas>
{/* 전체삭제, 뒤로가기, 브러쉬, 지우개 */}
Expand All @@ -197,8 +202,13 @@ const Canvas = ({ isVisible, canvasRef }) => {
onClick={() => {
setErasing(false);
}}
color={erasing ? "black" : "red"}
/>
<TfiEraser
size={55}
onClick={() => setErasing(true)}
color={erasing ? "red" : "black"}
/>
<TfiEraser size={55} onClick={() => setErasing(true)} />
</div>
{/* 브러쉬 크기 조정 */}
<div className={"flex flex-row justify-start items-center "}>
Expand Down
4 changes: 2 additions & 2 deletions src/component/ImageDiary/InfiniteScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const InfiniteScroll = ({ isVisible, keyword }) => {
}}
ref={containerRef}
>
{data.map((item) => {
return <img src={item} width={160} height={160} />;
{data.map((item, index) => {
return <img src={item} width={160} height={160} key={index} />;
})}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Diary.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const Diary = ({ data }) => {
onClick={updateDiary}
disabled={isSaving}
>
저장
수정
</button>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const Draw = () => {

const renderPhoto = () => {
return keyword.map((cur, i) => (
<InfiniteScroll isVisible={index === i} keyword={keyword[i]} />
<InfiniteScroll isVisible={index === i} keyword={keyword[i]} key={i} />
));
};

Expand Down Expand Up @@ -176,7 +176,6 @@ const Draw = () => {
display: "flex",
flexDirection: "column",
alignItems: "center",
touchAction: "none",
}}
>
{renderCanvas()}
Expand Down
5 changes: 3 additions & 2 deletions src/pages/PhotoEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ const PhotoEdit = ({}) => {
backgroundSize: "cover",
width: width - 8,
height: width - 8,
display: "flex",
flexWrap: "wrap",
alignContent: "flex-start",
position: "relative",
}}
onClick={() => {
changeSelected(-1);
}}
>
{/* 키워드 별 그림들 배치 */}
{images.length > 0 ? (
Expand Down
6 changes: 5 additions & 1 deletion src/pages/gamePages/BeforeGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ const BeforeGame = () => {
}}
/>
<Button width="100%" height="60px" text="랭킹 보기" />
{isModalOpen && <Modal onClose={closeModal} content={gameInfo} />}
<Modal
onClose={closeModal}
content={gameInfo}
isModalOpen={isModalOpen}
/>
</div>
);
};
Expand Down
7 changes: 2 additions & 5 deletions src/redux/config/configStore.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { createStore, applyMiddleware } from "redux";
import { createStore } from "redux";
import { combineReducers } from "redux";
import { createLogger } from "redux-logger";
import ImageDiary from "../modules/ImageDiary.js";
// import urlSave from "../modules/urlSave.js";
import DiaryDate from "../modules/DiaryDate.js";
import DiaryInfo from "../modules/DiaryInfo.js";
import UserInfo from "../modules/UserInfo.js";
Expand All @@ -15,7 +13,6 @@ const rootReducer = combineReducers({
UserInfo,
PageName,
});
const logger = createLogger();
const store = createStore(rootReducer, applyMiddleware(logger));
const store = createStore(rootReducer);

export default store;

0 comments on commit 0df5523

Please sign in to comment.