diff --git a/frontend-manager-cms/package-lock.json b/frontend-manager-cms/package-lock.json index b2ff637..0a6ac3f 100644 --- a/frontend-manager-cms/package-lock.json +++ b/frontend-manager-cms/package-lock.json @@ -16,15 +16,19 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", + "autoprefixer": "^10.4.13", "axios": "^0.25.0", "framer-motion": "^6.2.8", + "jwt-decode": "^3.1.2", "moment": "^2.29.1", "nanoid": "^4.0.1", + "postcss": "^8.4.21", "react": "^17.0.2", "react-bootstrap": "^2.7.2", "react-countup": "^6.1.1", "react-detect-offline": "^2.4.5", "react-dom": "^17.0.2", + "react-dropdown-date": "^2.2.7", "react-google-recaptcha": "^2.1.0", "react-icons": "^4.3.1", "react-lazy-load-image-component": "^1.5.5", @@ -42,6 +46,7 @@ "slick-carousel": "^1.8.1", "sweetalert": "^2.1.2", "sweetalert2": "^11.4.8", + "tailwindcss": "^3.2.7", "toast": "^0.3.47", "uuid": "^8.3.2", "web-vitals": "^1.0.1" @@ -12792,6 +12797,11 @@ "node": ">=4.0" } }, + "node_modules/jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -14133,9 +14143,9 @@ } }, "node_modules/postcss": { - "version": "8.4.20", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz", - "integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==", + "version": "8.4.21", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", + "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", "funding": [ { "type": "opencollective", @@ -15828,6 +15838,15 @@ "react": "17.0.2" } }, + "node_modules/react-dropdown-date": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/react-dropdown-date/-/react-dropdown-date-2.2.7.tgz", + "integrity": "sha512-THYL/9tTeBPtvUlyhvu69G627ta/RZWkN8K5Ew+w2XWPM3VNlOi++4UI2YeIyPrOIDmq3shB2REm//+LxcA7rQ==", + "peerDependencies": { + "react": "^16.8.0", + "react-dom": "^16.8.0" + } + }, "node_modules/react-error-overlay": { "version": "6.0.11", "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz", @@ -17560,9 +17579,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "node_modules/tailwindcss": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz", - "integrity": "sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.7.tgz", + "integrity": "sha512-B6DLqJzc21x7wntlH/GsZwEXTBttVSl1FtCzC8WP4oBc/NKef7kaax5jeihkkCEWc831/5NDJ9gRNDK6NEioQQ==", "dependencies": { "arg": "^5.0.2", "chokidar": "^3.5.3", @@ -17578,12 +17597,12 @@ "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.18", + "postcss": "^8.0.9", "postcss-import": "^14.1.0", "postcss-js": "^4.0.0", "postcss-load-config": "^3.1.4", "postcss-nested": "6.0.0", - "postcss-selector-parser": "^6.0.10", + "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0", "quick-lru": "^5.1.1", "resolve": "^1.22.1" @@ -28410,6 +28429,11 @@ "object.assign": "^4.1.3" } }, + "jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -29382,9 +29406,9 @@ } }, "postcss": { - "version": "8.4.20", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz", - "integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==", + "version": "8.4.21", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", + "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", "requires": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -30411,6 +30435,11 @@ "scheduler": "^0.20.2" } }, + "react-dropdown-date": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/react-dropdown-date/-/react-dropdown-date-2.2.7.tgz", + "integrity": "sha512-THYL/9tTeBPtvUlyhvu69G627ta/RZWkN8K5Ew+w2XWPM3VNlOi++4UI2YeIyPrOIDmq3shB2REm//+LxcA7rQ==" + }, "react-error-overlay": { "version": "6.0.11", "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz", @@ -31681,9 +31710,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "tailwindcss": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz", - "integrity": "sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.7.tgz", + "integrity": "sha512-B6DLqJzc21x7wntlH/GsZwEXTBttVSl1FtCzC8WP4oBc/NKef7kaax5jeihkkCEWc831/5NDJ9gRNDK6NEioQQ==", "requires": { "arg": "^5.0.2", "chokidar": "^3.5.3", @@ -31699,12 +31728,12 @@ "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.4.18", + "postcss": "^8.0.9", "postcss-import": "^14.1.0", "postcss-js": "^4.0.0", "postcss-load-config": "^3.1.4", "postcss-nested": "6.0.0", - "postcss-selector-parser": "^6.0.10", + "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0", "quick-lru": "^5.1.1", "resolve": "^1.22.1" diff --git a/frontend-manager-cms/package.json b/frontend-manager-cms/package.json index f170ce2..f5f6281 100644 --- a/frontend-manager-cms/package.json +++ b/frontend-manager-cms/package.json @@ -13,15 +13,19 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", + "autoprefixer": "^10.4.13", "axios": "^0.25.0", "framer-motion": "^6.2.8", + "jwt-decode": "^3.1.2", "moment": "^2.29.1", "nanoid": "^4.0.1", + "postcss": "^8.4.21", "react": "^17.0.2", "react-bootstrap": "^2.7.2", "react-countup": "^6.1.1", "react-detect-offline": "^2.4.5", "react-dom": "^17.0.2", + "react-dropdown-date": "^2.2.7", "react-google-recaptcha": "^2.1.0", "react-icons": "^4.3.1", "react-lazy-load-image-component": "^1.5.5", @@ -39,6 +43,7 @@ "slick-carousel": "^1.8.1", "sweetalert": "^2.1.2", "sweetalert2": "^11.4.8", + "tailwindcss": "^3.2.7", "toast": "^0.3.47", "uuid": "^8.3.2", "web-vitals": "^1.0.1" diff --git a/frontend-manager-cms/postcss.config.js b/frontend-manager-cms/postcss.config.js new file mode 100644 index 0000000..12a703d --- /dev/null +++ b/frontend-manager-cms/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/frontend-manager-cms/public/index.html b/frontend-manager-cms/public/index.html index 3e5bda1..5c55551 100644 --- a/frontend-manager-cms/public/index.html +++ b/frontend-manager-cms/public/index.html @@ -22,32 +22,11 @@ crossorigin="anonymous" referrerpolicy="no-referrer" /> - CMS Shool Library
- - - diff --git a/frontend-manager-cms/src/api/api_user.js b/frontend-manager-cms/src/api/api_user.js index 62f3a32..ddf9502 100644 --- a/frontend-manager-cms/src/api/api_user.js +++ b/frontend-manager-cms/src/api/api_user.js @@ -5,5 +5,10 @@ const API_ADMIN = { * @descriptionKey API login admin */ LOGIN_ADMIN_CMS: '/manager/v1/admin/login', + GET_ALL_BOOK_CMS: '/manager/v1/admin/private/book/all', + GET_DETAIL_BOOK_CMS: '/manager/v1/admin/private/book/detail', + GET_ALL_AUTHOR_CMS: '/manager/v1/admin/private/author/all', + GET_DETAIL_AUTHOR_CMS: '/manager/v1/admin/private/author/detail', + RENEW_TOKEN_CMS: '/manager/v1/admin/renew-token', }; export default API_ADMIN; diff --git a/frontend-manager-cms/src/assets/icons/Calendar.png b/frontend-manager-cms/src/assets/icons/Calendar.png new file mode 100644 index 0000000..738b465 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Calendar.png differ diff --git a/frontend-manager-cms/src/assets/icons/Chart.png b/frontend-manager-cms/src/assets/icons/Chart.png new file mode 100644 index 0000000..b5f7f43 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Chart.png differ diff --git a/frontend-manager-cms/src/assets/icons/Chart_fill.png b/frontend-manager-cms/src/assets/icons/Chart_fill.png new file mode 100644 index 0000000..9dc6a27 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Chart_fill.png differ diff --git a/frontend-manager-cms/src/assets/icons/Chat.png b/frontend-manager-cms/src/assets/icons/Chat.png new file mode 100644 index 0000000..0d4c1ca Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Chat.png differ diff --git a/frontend-manager-cms/src/assets/icons/Folder.png b/frontend-manager-cms/src/assets/icons/Folder.png new file mode 100644 index 0000000..2171b13 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Folder.png differ diff --git a/frontend-manager-cms/src/assets/icons/Search.png b/frontend-manager-cms/src/assets/icons/Search.png new file mode 100644 index 0000000..fdea823 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Search.png differ diff --git a/frontend-manager-cms/src/assets/icons/Setting.png b/frontend-manager-cms/src/assets/icons/Setting.png new file mode 100644 index 0000000..f5c0170 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/Setting.png differ diff --git a/frontend-manager-cms/src/assets/icons/User.png b/frontend-manager-cms/src/assets/icons/User.png new file mode 100644 index 0000000..53d6996 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/User.png differ diff --git a/frontend-manager-cms/src/assets/icons/control.png b/frontend-manager-cms/src/assets/icons/control.png new file mode 100644 index 0000000..6b31e8d Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/control.png differ diff --git a/frontend-manager-cms/src/assets/icons/logo.png b/frontend-manager-cms/src/assets/icons/logo.png new file mode 100644 index 0000000..b76e890 Binary files /dev/null and b/frontend-manager-cms/src/assets/icons/logo.png differ diff --git a/frontend-manager-cms/src/components/BookCard.jsx b/frontend-manager-cms/src/components/BookCard.jsx deleted file mode 100644 index 55652fd..0000000 --- a/frontend-manager-cms/src/components/BookCard.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import Button from './Button'; - -const BookCard = (props) => { - return ( -
- -
- -
-

{props.name}

-

{props.author}

- -
- -
-
- ); -}; - -export default BookCard; diff --git a/frontend-manager-cms/src/components/Button.jsx b/frontend-manager-cms/src/components/Button.jsx deleted file mode 100644 index e456aa3..0000000 --- a/frontend-manager-cms/src/components/Button.jsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -const Button = (props) => { - const bg = props.backgroundColor ? 'bg-' + props.backgroundColor : 'bg-main'; - const size = props.size && 'btn-' + props.size; - return ( - - ); -}; - -Button.propTypes = { - backgroundColor: PropTypes.string, - size: PropTypes.string, - onClick: PropTypes.func, -}; - -export default Button; diff --git a/frontend-manager-cms/src/components/CategoryCard.jsx b/frontend-manager-cms/src/components/CategoryCard.jsx deleted file mode 100644 index c8579aa..0000000 --- a/frontend-manager-cms/src/components/CategoryCard.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -const CategoryCard = (props) => { - return ( -
-
- -
-
-
{props.name}
-
Xem thêm
-
-
- ); -}; - -CategoryCard.propTypes = { - name: PropTypes.string.isRequired, - icon: PropTypes.string.isRequired, -}; - -export default CategoryCard; diff --git a/frontend-manager-cms/src/components/Dropdown.jsx b/frontend-manager-cms/src/components/Dropdown.jsx deleted file mode 100644 index 200e3f3..0000000 --- a/frontend-manager-cms/src/components/Dropdown.jsx +++ /dev/null @@ -1,59 +0,0 @@ -import React, { useState } from 'react'; -import { Form } from 'react-bootstrap'; - -const Dropdown = () => { - const CustomToggle = React.forwardRef(({ children, onClick }, ref) => ( - { - e.preventDefault(); - onClick(e); - }} - > - {children} - ▼ - - )); - - // forwardRef again here! - // Dropdown needs access to the DOM of the Menu to measure it - const CustomMenu = React.forwardRef(({ children, style, className, 'aria-labelledby': labeledBy }, ref) => { - const [value, setValue] = useState(''); - - return ( -
- setValue(e.target.value)} - value={value} - /> - -
- ); - }); - return ( - - - Custom toggle - - - - Red - Blue - - Orange - - Red-Orange - - - ); -}; - -export default Dropdown; diff --git a/frontend-manager-cms/src/components/Filter.jsx b/frontend-manager-cms/src/components/Filter.jsx deleted file mode 100644 index aeeceb5..0000000 --- a/frontend-manager-cms/src/components/Filter.jsx +++ /dev/null @@ -1,111 +0,0 @@ -import React from 'react'; - -const Filter = () => { - return ( -
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
- -
-
-
-
-
- ); -}; - -export default Filter; diff --git a/frontend-manager-cms/src/components/Footer.jsx b/frontend-manager-cms/src/components/Footer.jsx deleted file mode 100644 index a698c5c..0000000 --- a/frontend-manager-cms/src/components/Footer.jsx +++ /dev/null @@ -1,116 +0,0 @@ -import React from 'react'; -import { FB_LOGO, SCHOOL_LOGO, YTB_LOGO, ZL_LOGO } from '../imports/home_import/index'; -import { Link } from 'react-router-dom'; -import Grid from './Grid'; - -const Footer = () => { - const footerAboutLinks = [ - { - display: 'Giới thiệu', - path: '/about', - }, - { - display: 'Liên hệ', - path: '/about', - }, - { - display: 'Tuyển dụng', - path: '/about', - }, - { - display: 'Tin tức', - path: '/about', - }, - { - display: 'Hệ thống cửa hàng', - path: '/about', - }, - ]; - - const footerCustomerLinks = [ - { - display: 'Chính sách đổi trả', - path: '/about', - }, - { - display: 'Chính sách bảo hành', - path: '/about', - }, - { - display: 'Chính sách hoàn tiền', - path: '/about', - }, - ]; - - return ( - - ); -}; - -export default Footer; diff --git a/frontend-manager-cms/src/components/Header.jsx b/frontend-manager-cms/src/components/Header.jsx deleted file mode 100644 index 22c63c8..0000000 --- a/frontend-manager-cms/src/components/Header.jsx +++ /dev/null @@ -1,150 +0,0 @@ -import { useRef } from 'react'; -import { Link, useLocation } from 'react-router-dom'; -import { SCHOOL_LOGO } from '../imports/home_import/index'; -import Button from './Button'; - -const navInfo = [ - { - displayText: 'Giới thiệu', - path: '/', - submenu: [ - { - displayText: 'Submenu 1', - path: '/sub', - }, - { - displayText: 'Submenu 1', - path: '/sub', - }, - { - displayText: 'Submenu 1', - path: '/sub', - }, - ], - }, - { - displayText: 'Tra cứu', - path: '/book', - submenu: [ - { - displayText: 'Thể loại', - path: '/category', - }, - { - displayText: 'Tất cả tài liệu', - path: '/book', - }, - { - displayText: 'Submenu 1', - path: '/sub', - }, - ], - }, - { - displayText: 'Phụ kiện', - path: '/accessories', - }, - { - displayText: 'Liên hệ', - path: '/contact', - }, -]; - -const Header = (props) => { - const { pathname } = useLocation(); - const headerRef = useRef(null); - const menuLeftRef = useRef(null); - const activeNavIdx = navInfo.findIndex((e) => e.path === pathname); - - const menuToggle = () => { - menuLeftRef.current.classList.toggle('active'); - }; - - return ( - <> -
-
-
- - logo - -
-
-
- -
-
-
- -
- {navInfo.map((item, index) => ( -
- {item?.submenu?.length > 0 ? ( - <> - - {item.displayText} - - -
- {item.submenu.map((subItem, idx) => ( -
- - {subItem.displayText} - -
- ))} -
- - ) : ( - - {item.displayText} - - )} -
- ))} -
-
-
- - - - Hotline / ZALO: 093 886 1080 - - -
-
- -
-
- - - -
-
- {/* - - */} - -
props.setShowLogin(true)}> - -
-
-
-
-
-
- - ); -}; - -export default Header; diff --git a/frontend-manager-cms/src/components/Layout.jsx b/frontend-manager-cms/src/components/Layout.jsx deleted file mode 100644 index ea07b95..0000000 --- a/frontend-manager-cms/src/components/Layout.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import Header from 'components/Header'; -import Login from 'pages/Customer/Auth/Login'; -import React, { useState } from 'react'; -import Footer from './Footer'; - -const Layout = (props) => { - const [showLogin, setShowLogin] = useState(false); - - return ( - <> -
- - {props.content} -