강사님과 똑같이 코드를 쳤는데 레이아웃의 버튼 배치나 사이즈가 똑같이 안됩니다.
node-scss node-loadr 도 다 설치되었는데 무엇이 문제일까요..
haeder.js 부분도 이상하게 보입니다.
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/core": "7.12.3",
"@babel/plugin-transform-react-jsx": "^7.14.9",
"@babel/plugin-transform-react-jsx-self": "^7.14.9",
"@ckeditor/ckeditor5-adapter-ckfinder": "^31.0.0",
"@ckeditor/ckeditor5-alignment": "^31.0.0",
"@ckeditor/ckeditor5-autoformat": "^31.0.0",
"@ckeditor/ckeditor5-basic-styles": "^31.0.0",
"@ckeditor/ckeditor5-block-quote": "^31.0.0",
"@ckeditor/ckeditor5-build-balloon": "^31.0.0",
"@ckeditor/ckeditor5-build-classic": "^31.0.0",
"@ckeditor/ckeditor5-build-inline": "^31.0.0",
"@ckeditor/ckeditor5-dev-utils": "^25.4.5",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^25.4.5",
"@ckeditor/ckeditor5-easy-image": "^31.0.0",
"@ckeditor/ckeditor5-editor-balloon": "^31.0.0",
"@ckeditor/ckeditor5-editor-classic": "^31.0.0",
"@ckeditor/ckeditor5-essentials": "^31.0.0",
"@ckeditor/ckeditor5-font": "^31.0.0",
"@ckeditor/ckeditor5-heading": "^31.0.0",
"@ckeditor/ckeditor5-image": "^31.0.0",
"@ckeditor/ckeditor5-indent": "^31.0.0",
"@ckeditor/ckeditor5-link": "^31.0.0",
"@ckeditor/ckeditor5-list": "^31.0.0",
"@ckeditor/ckeditor5-media-embed": "^31.0.0",
"@ckeditor/ckeditor5-paragraph": "^31.0.0",
"@ckeditor/ckeditor5-paste-from-office": "^31.0.0",
"@ckeditor/ckeditor5-react": "^3.0.3",
"@ckeditor/ckeditor5-table": "^31.0.0",
"@ckeditor/ckeditor5-theme-lark": "^31.0.0",
"@ckeditor/ckeditor5-typing": "^31.0.0",
"@ckeditor/ckeditor5-upload": "^31.0.0",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.16",
"@pmmmwh/react-refresh-webpack-plugin": "0.4.3",
"@svgr/webpack": "5.5.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.5.0",
"axios": "^0.23.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.0",
"babel-loader": "8.1.0",
"babel-plugin-named-asset-import": "^0.3.7",
"babel-preset-react-app": "^10.0.0",
"bfj": "^7.0.2",
"bootstrap": "^5.1.3",
"camelcase": "^6.1.0",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"connected-react-router": "^6.9.1",
"css-loader": "4.3.0",
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
"eslint": "^7.11.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-testing-library": "^3.9.2",
"eslint-webpack-plugin": "^2.5.2",
"file-loader": "6.1.1",
"fs-extra": "^9.0.1",
"history": "^4.7.2",
"html-webpack-plugin": "4.5.0",
"identity-obj-proxy": "3.0.0",
"jest": "26.6.0",
"jest-circus": "26.6.0",
"jest-resolve": "26.6.0",
"jest-watch-typeahead": "0.6.1",
"mini-css-extract-plugin": "0.11.3",
"node-sass": "^4.14.1",
"optimize-css-assets-webpack-plugin": "5.0.4",
"pnp-webpack-plugin": "1.6.4",
"postcss-flexbugs-fixes": "4.2.1",
"postcss-loader": "3.0.0",
"postcss-normalize": "8.0.1",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "5.0.2",
"prompts": "2.4.0",
"raw-loader": "^3.1.0",
"react": "^17.0.2",
"react-app-polyfill": "^2.0.0",
"react-bootstrap": "^2.0.1",
"react-dev-utils": "^11.0.3",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-redux": "^7.2.5",
"react-refresh": "^0.8.3",
"react-router-dom": "^5.3.0",
"reactstrap": "^8.10.0",
"redux": "^4.1.1",
"redux-saga": "^1.1.3",
"resolve": "1.18.1",
"resolve-url-loader": "^3.1.2",
"sass-loader": "^10.0.5",
"semver": "7.3.2",
"style-loader": "1.3.0",
"terser-webpack-plugin": "4.2.3",
"ts-pnp": "1.2.0",
"url-loader": "4.1.1",
"web-vitals": "^1.0.1",
"webpack": "4.44.2",
"webpack-dev-server": "3.11.1",
"webpack-manifest-plugin": "2.2.0",
"workbox-webpack-plugin": "5.1.4"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"proxy": "http://localhost:700",
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"jest": {
"roots": [
"<rootDir>/src"
],
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"setupFiles": [
"react-app-polyfill/jsdom"
],
"setupFilesAfterEnv": [],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
],
"testEnvironment": "jsdom",
"testRunner": "C:\\Users\\skylm\\vscode\\blog\\client\\node_modules\\jest-circus\\runner.js",
"transform": {
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
],
"modulePaths": [],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"web.js",
"js",
"web.ts",
"ts",
"web.tsx",
"tsx",
"json",
"web.jsx",
"jsx",
"node"
],
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
"resetMocks": true
},
"babel": {
"presets": [
"react-app"
]
}
}
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Helmet } from 'react-helmet';
import {
POST_DETAIL_LOADING_REQUEST,
POST_DELETE_REQUEST,
USER_LOADING_REQUEST
} from '../../redux/types';
import { Col, Row, Button } from 'reactstrap';
// import {Col, Row, Button} from 'react-bootstrap';
import { CKEditor } from "@ckeditor/ckeditor5-react";
import { Link } from 'react-router-dom';
import { GrowingSpinner } from '../../components/spinner/Spinner';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {
faPencilAlt,
faCommentDots,
faMouse,
} from "@fortawesome/free-solid-svg-icons";
import BalloonEditor from "@ckeditor/ckeditor5-editor-balloon/src/ballooneditor";
import { editorConfiguration } from '../../components/editor/EditorConfig';
const PostDetail = (req) => {
const dispatch = useDispatch();
const { postDetail, creatorId, title, loading} = useSelector((state) => state.post);
const { userId, userName } = useSelector((state) => state.auth);
console.log(req, "postDetail REQ");
useEffect(() => {
dispatch({
type : POST_DETAIL_LOADING_REQUEST,
payload : req.match.params.id,
});
//작성자만 삭제 버튼 보이게
dispatch({
type : USER_LOADING_REQUEST,
payload : localStorage.getItem("token")
});
}, []);
const onDeleteClick = () => {
dispatch({
//작성자만 게시글 삭제
type : POST_DELETE_REQUEST,
payload : {
id : req.match.params.id,
toekn : localStorage.getItem("token")
}
});
};
const EditButton = (
<>
<Row className="d-flex justify-content-center pb-3">
<Col className="col-md3 mr-md-3">
<Link to="/" className="btn btn-primary btn-block">
홈
</Link>
</Col>
<Col className="col-md3 mr-md-3">
<Link to={`/post/${req.match.params.id}/edit`} className="btn btn-success btn-block">
수정
</Link>
</Col>
<Col className="col-md3">
<Button className="btn-block btn-danger" onClick={onDeleteClick}>
삭제
</Button>
</Col>
</Row>
</>
)
const HomeButton = (
<>
<Row className="d-flex justify-content-center pb-3">
<Col className="col-sm-12 com-md-3">
<Link to="/" className="btn btn-primary btn-block">
홈
</Link>
</Col>
</Row>
</>
);
const Body = (
<>
{userId === creatorId ? EditButton : HomeButton}
<Row className="border-bottom border-top border-primary p-3 mb-3 d-flex justify-content-between">
{(() => {
if (postDetail && postDetail.creator) {
return (
<>
<div className="font-weight-bold text-big">
<span className="mr-3">
<Button color="info">
{postDetail.category.categoryName}
</Button>
</span>
{postDetail.title}
</div>
<div className="align-self-end">{postDetail.creator.name}</div>
</>
);
}
})()}
</Row>
{postDetail && postDetail.comments ? (
<>
<div className="d-flex justify-content-end align-items-baseline small">
<FontAwesomeIcon icon={faPencilAlt} />
<span> {postDetail.date}</span>
<FontAwesomeIcon icon={faCommentDots} />
<span>{postDetail.comments.length}</span>
<FontAwesomeIcon icon={faMouse} />
<span>{postDetail.views}</span>
</div>
<Row className="mb-3">
<CKEditor
editor={BalloonEditor}
data={postDetail.contents}
config={editorConfiguration}
disabled="true"
/>
</Row>
</>
) : (
<h1>hi</h1>
)}
</>
);;
return (
<div>
<Helmet title={`Post | ${title}`} />
{loading === true ? GrowingSpinner : Body }
</div>
);
};
export default PostDetail;