From 408ec7072061b6b2e89e2fcbec94a97b180bc1ff Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 30 May 2022 15:06:53 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=99=94=EB=A9=B4=20=EC=A0=95=EB=A6=AC?= =?UTF-8?q?=20=20=20=20=20=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20=EC=86=8C?= =?UTF-8?q?=EC=8A=A4=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 4 +- .../MainLayout/Header/ProfileSection/index.js | 140 +--- src/layout/MainLayout/Header/index.js | 29 +- .../MainLayout/Sidebar/MenuList/index.js | 26 +- src/layout/MainLayout/index.js | 3 +- src/menu-items/dashboard.js | 78 +- src/store/reducer.js | 13 +- src/store/slices/calendar.js | 93 --- src/store/slices/cart.js | 242 ------ src/store/slices/chat.js | 89 --- src/store/slices/user.js | 724 +++++++++--------- src/ui-component/cards/AnalyticsChartCard.js | 127 --- src/ui-component/cards/AttachmentCard.js | 43 -- src/ui-component/cards/AuthSlider.js | 40 - src/ui-component/cards/ContactCard.js | 132 ---- src/ui-component/cards/ContactList.js | 83 -- src/ui-component/cards/FloatingCart.js | 59 -- src/ui-component/cards/FollowerCard.js | 141 ---- src/ui-component/cards/FriendRequestCard.js | 141 ---- src/ui-component/cards/FriendsCard.js | 151 ---- src/ui-component/cards/GalleryCard.js | 119 --- src/ui-component/cards/HoverDataCard.js | 47 -- src/ui-component/cards/HoverSocialCard.js | 66 -- src/ui-component/cards/IconNumberCard.js | 45 -- src/ui-component/cards/ProductCard.js | 133 ---- src/ui-component/cards/ProductReview.js | 123 --- src/ui-component/cards/ReportCard.js | 41 - src/ui-component/cards/RevenueCard.js | 65 -- src/ui-component/cards/SalesLineChartCard.js | 102 --- src/ui-component/cards/SeoChartCard.js | 63 -- src/ui-component/cards/SideIconCard.js | 63 -- .../cards/Skeleton/EarningCard.js | 32 - .../cards/Skeleton/ImagePlaceholder.js | 8 - .../cards/Skeleton/PopularCard.js | 155 ---- .../cards/Skeleton/ProductPlaceholder.js | 44 -- .../cards/Skeleton/TotalGrowthBarChart.js | 39 - .../cards/Skeleton/TotalIncomeCard.js | 19 - src/ui-component/cards/TotalLineChartCard.js | 59 -- src/ui-component/cards/UserCountCard.js | 55 -- src/ui-component/cards/UserDetailsCard.js | 139 ---- src/ui-component/extended/Snackbar.js | 0 src/utils/route-guard/GuestGuard.js | 3 +- src/views/biz/admin/judge/JudgeReview.jsx | 1 - .../biz/admin/judge/ModalJudgeResult.jsx | 2 +- src/views/dashboard/Analytics/index.js | 332 ++++---- src/views/dashboard/Default/index.js | 118 +-- 46 files changed, 666 insertions(+), 3565 deletions(-) delete mode 100755 src/store/slices/calendar.js delete mode 100755 src/store/slices/cart.js delete mode 100755 src/store/slices/chat.js delete mode 100755 src/ui-component/cards/AnalyticsChartCard.js delete mode 100755 src/ui-component/cards/AttachmentCard.js delete mode 100755 src/ui-component/cards/AuthSlider.js delete mode 100755 src/ui-component/cards/ContactCard.js delete mode 100755 src/ui-component/cards/ContactList.js delete mode 100755 src/ui-component/cards/FloatingCart.js delete mode 100755 src/ui-component/cards/FollowerCard.js delete mode 100755 src/ui-component/cards/FriendRequestCard.js delete mode 100755 src/ui-component/cards/FriendsCard.js delete mode 100755 src/ui-component/cards/GalleryCard.js delete mode 100755 src/ui-component/cards/HoverDataCard.js delete mode 100755 src/ui-component/cards/HoverSocialCard.js delete mode 100755 src/ui-component/cards/IconNumberCard.js delete mode 100755 src/ui-component/cards/ProductCard.js delete mode 100755 src/ui-component/cards/ProductReview.js delete mode 100755 src/ui-component/cards/ReportCard.js delete mode 100755 src/ui-component/cards/RevenueCard.js delete mode 100755 src/ui-component/cards/SalesLineChartCard.js delete mode 100755 src/ui-component/cards/SeoChartCard.js delete mode 100755 src/ui-component/cards/SideIconCard.js delete mode 100755 src/ui-component/cards/Skeleton/EarningCard.js delete mode 100755 src/ui-component/cards/Skeleton/ImagePlaceholder.js delete mode 100755 src/ui-component/cards/Skeleton/PopularCard.js delete mode 100755 src/ui-component/cards/Skeleton/ProductPlaceholder.js delete mode 100755 src/ui-component/cards/Skeleton/TotalGrowthBarChart.js delete mode 100755 src/ui-component/cards/Skeleton/TotalIncomeCard.js delete mode 100755 src/ui-component/cards/TotalLineChartCard.js delete mode 100755 src/ui-component/cards/UserCountCard.js delete mode 100755 src/ui-component/cards/UserDetailsCard.js mode change 100755 => 100644 src/ui-component/extended/Snackbar.js diff --git a/src/App.js b/src/App.js index e0c0295..0746d50 100755 --- a/src/App.js +++ b/src/App.js @@ -5,7 +5,7 @@ import Routes from 'routes'; import Locales from 'ui-component/Locales'; import NavigationScroll from 'layout/NavigationScroll'; import RTLLayout from 'ui-component/RTLLayout'; -import Snackbar from 'ui-component/extended/Snackbar'; +// import Snackbar from 'ui-component/extended/Snackbar'; import ThemeCustomization from 'themes'; // auth provider @@ -21,7 +21,7 @@ const App = () => ( <> - + {/* */} diff --git a/src/layout/MainLayout/Header/ProfileSection/index.js b/src/layout/MainLayout/Header/ProfileSection/index.js index 8f31bec..5fe6270 100755 --- a/src/layout/MainLayout/Header/ProfileSection/index.js +++ b/src/layout/MainLayout/Header/ProfileSection/index.js @@ -4,24 +4,17 @@ import { useNavigate } from 'react-router-dom'; // material-ui import { useTheme } from '@mui/material/styles'; import { - Avatar, Box, - Card, - CardContent, Chip, ClickAwayListener, Divider, - Grid, - InputAdornment, List, ListItemButton, ListItemIcon, ListItemText, - OutlinedInput, Paper, Popper, Stack, - Switch, Typography } from '@mui/material'; @@ -31,12 +24,10 @@ import PerfectScrollbar from 'react-perfect-scrollbar'; // project imports import MainCard from 'ui-component/cards/MainCard'; import Transitions from 'ui-component/extended/Transitions'; -import UpgradePlanCard from './UpgradePlanCard'; import useAuth from 'hooks/useAuth'; -import User1 from 'assets/images/users/user-round.svg'; // assets -import { IconLogout, IconSearch, IconSettings, IconUser } from '@tabler/icons'; +import { IconLogout, IconSettings } from '@tabler/icons'; import useConfig from 'hooks/useConfig'; // ==============================|| PROFILE MENU ||============================== // @@ -46,9 +37,6 @@ const ProfileSection = () => { const { borderRadius } = useConfig(); const navigate = useNavigate(); - const [sdm, setSdm] = useState(true); - const [value, setValue] = useState(''); - const [notification, setNotification] = useState(false); const [selectedIndex, setSelectedIndex] = useState(-1); const { logout, user } = useAuth(); const [open, setOpen] = useState(false); @@ -70,14 +58,7 @@ const ProfileSection = () => { } setOpen(false); }; - const handleListItemClick = (event, index, route = '') => { - setSelectedIndex(index); - handleClose(event); - if (route && route !== '') { - navigate(route); - } - }; const handleToggle = () => { setOpen((prevOpen) => !prevOpen); }; @@ -113,20 +94,6 @@ const ProfileSection = () => { lineHeight: 0 } }} - icon={ - - } label={} variant="outlined" ref={anchorRef} @@ -162,79 +129,18 @@ const ProfileSection = () => { - - Good Morning, + + [{user?.accesstype === '001' ? '관리자' : '심사자'}] {user?.name} - Project Admin + {user?.team} - setValue(e.target.value)} - placeholder="Search profile options" - startAdornment={ - - - - } - aria-describedby="search-helper-text" - inputProps={{ - 'aria-label': 'weight' - }} - /> - - - - - - - - - Start DND Mode - - - setSdm(e.target.checked)} - name="sdm" - size="small" - /> - - - - - - - Allow Notifications - - - setNotification(e.target.checked)} - name="sdm" - size="small" - /> - - - - - - - { } }} > - handleListItemClick(event, 0, '/user/account-profile/profile1')} - > - - - - Account Settings} /> - - handleListItemClick(event, 1, '/user/social-profile/posts')} - > - - - - - - Social Profile - - - - - - } - /> - diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index a51f74f..79e097d 100755 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -4,14 +4,10 @@ import { Avatar, Box } from '@mui/material'; // project imports import LogoSection from '../LogoSection'; -import SearchSection from './SearchSection'; -import MobileSection from './MobileSection'; import ProfileSection from './ProfileSection'; -import LocalizationSection from './LocalizationSection'; -import MegaMenuSection from './MegaMenuSection'; -import NotificationSection from './NotificationSection'; import { useDispatch, useSelector } from 'store'; import { openDrawer } from 'store/slices/menu'; +import useAuth from 'hooks/useAuth'; // assets import { IconMenu2 } from '@tabler/icons'; @@ -60,29 +56,14 @@ const Header = () => { - {/* header search */} - - - {/* mega-menu */} - - - - - {/* live customization & localization */} - - - - - {/* notification & profile */} - - {/* mobile header */} - - - + {/* /!* mobile header *!/ */} + {/* */} + {/* */} + {/* */} ); }; diff --git a/src/layout/MainLayout/Sidebar/MenuList/index.js b/src/layout/MainLayout/Sidebar/MenuList/index.js index e62dbcb..101c2ea 100755 --- a/src/layout/MainLayout/Sidebar/MenuList/index.js +++ b/src/layout/MainLayout/Sidebar/MenuList/index.js @@ -1,7 +1,7 @@ -import { memo } from 'react'; +import { memo, useState } from 'react'; // material-ui -import { Typography } from '@mui/material'; +import { Box, Divider, Stack, Typography } from '@mui/material'; // project imports import NavGroup from './NavGroup'; @@ -9,14 +9,13 @@ import useAuth from 'hooks/useAuth'; import admin from 'menu-items/admin'; import judge from 'menu-items/judge'; -import dashboard from 'menu-items/dashboard'; // ==============================|| SIDEBAR MENU LIST ||============================== // const MenuList = () => { - const { accesstype } = useAuth(); + const { user, accesstype } = useAuth(); - const menuItem = accesstype === '001' ? { items: [dashboard, admin] } : { items: [judge] }; + const menuItem = accesstype === '001' ? { items: [admin] } : { items: [judge] }; const navItems = menuItem.items.map((item) => { switch (item.type) { @@ -31,7 +30,22 @@ const MenuList = () => { } }); - return <>{navItems}; + return ( + <> + + + + [{accesstype === '001' ? '관리자' : '심사자'}] + + {user?.name} + + + + + + {navItems} + + ); }; export default memo(MenuList); diff --git a/src/layout/MainLayout/index.js b/src/layout/MainLayout/index.js index 1d1e110..3f02f77 100755 --- a/src/layout/MainLayout/index.js +++ b/src/layout/MainLayout/index.js @@ -119,7 +119,8 @@ const MainLayout = () => { , - type: 'group', - children: [ - { - id: 'default', - title: , - type: 'item', - url: '/dashboard/default', - icon: icons.IconDashboard, - breadcrumbs: false - }, - { - id: 'analytics', - title: , - type: 'item', - url: '/dashboard/analytics', - icon: icons.IconDeviceAnalytics, - breadcrumbs: false - } - ] -}; - -export default dashboard; +// // third-party +// import { FormattedMessage } from 'react-intl'; +// +// // assets +// import { IconDashboard, IconDeviceAnalytics } from '@tabler/icons'; +// +// // constant +// const icons = { +// IconDashboard, +// IconDeviceAnalytics +// }; +// +// // ==============================|| DASHBOARD MENU ITEMS ||============================== // +// +// const dashboard = { +// id: 'dashboard', +// title: , +// type: 'group', +// children: [ +// { +// id: 'default', +// title: , +// type: 'item', +// url: '/dashboard/default', +// icon: icons.IconDashboard, +// breadcrumbs: false +// }, +// { +// id: 'analytics', +// title: , +// type: 'item', +// url: '/dashboard/analytics', +// icon: icons.IconDeviceAnalytics, +// breadcrumbs: false +// } +// ] +// }; +// +// export default dashboard; diff --git a/src/store/reducer.js b/src/store/reducer.js index 43b63eb..0c8ac2b 100755 --- a/src/store/reducer.js +++ b/src/store/reducer.js @@ -4,12 +4,9 @@ import { persistReducer } from 'redux-persist'; import storage from 'redux-persist/lib/storage'; // project imports -import pboardReducer from './slices/pboard'; import snackbarReducer from './slices/snackbar'; -import chatReducer from './slices/chat'; -import calendarReducer from './slices/calendar'; +import pboardReducer from './slices/pboard'; import userReducer from './slices/user'; -import cartReducer from './slices/cart'; import menuReducer from './slices/menu'; // ==============================|| COMBINE REDUCER ||============================== // @@ -19,14 +16,12 @@ const reducer = combineReducers({ snackbar: snackbarReducer, cart: persistReducer( { - key: 'cart', + key: 'user', storage, - keyPrefix: 'berry-' + keyPrefix: 'xit-' }, - cartReducer + userReducer ), - chat: chatReducer, - calendar: calendarReducer, user: userReducer, menu: menuReducer }); diff --git a/src/store/slices/calendar.js b/src/store/slices/calendar.js deleted file mode 100755 index 911926d..0000000 --- a/src/store/slices/calendar.js +++ /dev/null @@ -1,93 +0,0 @@ -// third-party -import { createSlice } from '@reduxjs/toolkit'; - -// project imports -import axios from 'utils/axios'; -import { dispatch } from '../index'; - -// ---------------------------------------------------------------------- - -const initialState = { - error: null, - events: [] -}; - -const slice = createSlice({ - name: 'calendar', - initialState, - reducers: { - // HAS ERROR - hasError(state, action) { - state.error = action.payload; - }, - - // GET EVENTS - getEventsSuccess(state, action) { - state.events = action.payload; - }, - - // ADD EVENT - addEventSuccess(state, action) { - state.events = action.payload; - }, - - // UPDATE EVENT - updateEventSuccess(state, action) { - state.events = action.payload; - }, - - // REMOVE EVENT - removeEventSuccess(state, action) { - state.events = action.payload; - } - } -}); - -// Reducer -export default slice.reducer; - -// ---------------------------------------------------------------------- - -export function getEvents() { - return async () => { - try { - const response = await axios.get('/api/calendar/events'); - dispatch(slice.actions.getEventsSuccess(response.data.events)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function addEvent(event) { - return async () => { - try { - const response = await axios.post('/api/calendar/events/new', event); - dispatch(slice.actions.addEventSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function updateEvent(event) { - return async () => { - try { - const response = await axios.post('/api/calendar/events/update', event); - dispatch(slice.actions.updateEventSuccess(response.data.events)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function removeEvent(eventId) { - return async () => { - try { - const response = await axios.post('/api/calendar/events/remove', { eventId }); - dispatch(slice.actions.removeEventSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} diff --git a/src/store/slices/cart.js b/src/store/slices/cart.js deleted file mode 100755 index bb1dc2a..0000000 --- a/src/store/slices/cart.js +++ /dev/null @@ -1,242 +0,0 @@ -// third-party -import { createSlice } from '@reduxjs/toolkit'; - -// project imports -import axios from 'utils/axios'; -import { dispatch } from '../index'; - -// ---------------------------------------------------------------------- - -const initialState = { - error: null, - checkout: { - step: 0, - products: [], - subtotal: 0, - total: 0, - discount: 0, - shipping: 0, - billing: null, - payment: { - type: 'free', - method: 'cod', - card: '' - } - } -}; - -const slice = createSlice({ - name: 'cart', - initialState, - reducers: { - // HAS ERROR - hasError(state, action) { - state.error = action.payload; - }, - - // ADD PRODUCT - addProductSuccess(state, action) { - state.checkout.products = action.payload.products; - state.checkout.subtotal += action.payload.subtotal; - state.checkout.total += action.payload.subtotal; - }, - - // REMOVE PRODUCT - removeProductSuccess(state, action) { - state.checkout.products = action.payload.products; - state.checkout.subtotal += -action.payload.subtotal; - state.checkout.total += -action.payload.subtotal; - }, - - // UPDATE PRODUCT - updateProductSuccess(state, action) { - state.checkout.products = action.payload.products; - state.checkout.subtotal = state.checkout.subtotal - action.payload.oldSubTotal + action.payload.subtotal; - state.checkout.total = state.checkout.total - action.payload.oldSubTotal + action.payload.subtotal; - }, - - // SET STEP - setStepSuccess(state, action) { - state.checkout.step = action.payload; - }, - - // SET NEXT STEP - setNextStepSuccess(state) { - state.checkout.step += 1; - }, - - // SET BACK STEP - setBackStepSuccess(state) { - state.checkout.step -= 1; - }, - - // SET BILLING ADDRESS - setBillingAddressSuccess(state, action) { - state.checkout.billing = action.payload.billing; - }, - - // SET DISCOUNT - setDiscountSuccess(state, action) { - let difference = 0; - if (state.checkout.discount > 0) { - difference = state.checkout.discount; - } - - state.checkout.discount = action.payload.amount; - state.checkout.total = state.checkout.total + difference - action.payload.amount; - }, - - // SET SHIPPING CHARGE - setShippingChargeSuccess(state, action) { - state.checkout.shipping = action.payload.shipping; - state.checkout.total += action.payload.newShipping; - state.checkout.payment = { - ...state.checkout.payment, - type: action.payload.type - }; - }, - - // SET PAYMENT METHOD - setPaymentMethodSuccess(state, action) { - state.checkout.payment = { - ...state.checkout.payment, - method: action.payload.method - }; - }, - - // SET PAYMENT CARD - setPaymentCardSuccess(state, action) { - state.checkout.payment = { - ...state.checkout.payment, - card: action.payload.card - }; - }, - - // RESET CART - resetCardSuccess(state) { - state.checkout = initialState.checkout; - } - } -}); - -// Reducer -export default slice.reducer; - -// ---------------------------------------------------------------------- - -export function addProduct(product, products) { - return async () => { - try { - const response = await axios.post('/api/cart/add', { product, products }); - dispatch(slice.actions.addProductSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function removeProduct(id, products) { - return async () => { - try { - const response = await axios.post('/api/cart/remove', { id, products }); - dispatch(slice.actions.removeProductSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function updateProduct(id, quantity, products) { - return async () => { - try { - const response = await axios.post('/api/cart/update', { id, quantity, products }); - dispatch(slice.actions.updateProductSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function setStep(step) { - return () => { - dispatch(slice.actions.setStepSuccess(step)); - }; -} - -export function setNextStep() { - return () => { - dispatch(slice.actions.setNextStepSuccess({})); - }; -} - -export function setBackStep() { - return () => { - dispatch(slice.actions.setBackStepSuccess({})); - }; -} - -export function setBillingAddress(address) { - return async () => { - try { - const response = await axios.post('/api/cart/billing-address', { address }); - dispatch(slice.actions.setBillingAddressSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function setDiscount(code, total) { - return async () => { - try { - const response = await axios.post('/api/cart/discount', { code, total }); - dispatch(slice.actions.setDiscountSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function setShippingCharge(charge, shipping) { - return async () => { - try { - const response = await axios.post('/api/cart/shipping-charge', { charge, shipping }); - dispatch(slice.actions.setShippingChargeSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function setPaymentMethod(method) { - return async () => { - try { - const response = await axios.post('/api/cart/payment-method', { method }); - dispatch(slice.actions.setPaymentMethodSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function setPaymentCard(card) { - return async () => { - try { - const response = await axios.post('/api/cart/payment-card', { card }); - dispatch(slice.actions.setPaymentCardSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function resetCart() { - return async () => { - try { - const response = await axios.post('/api/cart/reset'); - dispatch(slice.actions.resetCardSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} diff --git a/src/store/slices/chat.js b/src/store/slices/chat.js deleted file mode 100755 index 4b1431c..0000000 --- a/src/store/slices/chat.js +++ /dev/null @@ -1,89 +0,0 @@ -// third-party -import { createSlice } from '@reduxjs/toolkit'; - -// project imports -import axios from 'utils/axios'; -import { dispatch } from '../index'; - -// ---------------------------------------------------------------------- - -const initialState = { - error: null, - chats: [], - user: {}, - users: [] -}; - -const slice = createSlice({ - name: 'chat', - initialState, - reducers: { - // HAS ERROR - hasError(state, action) { - state.error = action.payload; - }, - - // GET USER - getUserSuccess(state, action) { - state.user = action.payload; - }, - - // GET USER CHATS - getUserChatsSuccess(state, action) { - state.chats = action.payload; - }, - - // GET USERS - getUsersSuccess(state, action) { - state.users = action.payload; - } - } -}); - -// Reducer -export default slice.reducer; - -// ---------------------------------------------------------------------- - -export function getUser(id) { - return async () => { - try { - const response = await axios.post('/api/chat/users/id', { id }); - dispatch(slice.actions.getUserSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getUserChats(user) { - return async () => { - try { - const response = await axios.post('/api/chat/filter', { user }); - dispatch(slice.actions.getUserChatsSuccess(response.data)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function insertChat(chat) { - return async () => { - try { - await axios.post('/api/chat/insert', chat); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getUsers() { - return async () => { - try { - const response = await axios.get('/api/chat/users'); - dispatch(slice.actions.getUsersSuccess(response.data.users)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} diff --git a/src/store/slices/user.js b/src/store/slices/user.js index 6e0bf85..21533de 100755 --- a/src/store/slices/user.js +++ b/src/store/slices/user.js @@ -8,17 +8,17 @@ import { dispatch } from '../index'; // ---------------------------------------------------------------------- const initialState = { - error: null, - usersS1: [], - usersS2: [], - followers: [], - friendRequests: [], - friends: [], - gallery: [], - posts: [], - detailCards: [], - simpleCards: [], - profileCards: [] + error: null + // usersS1: [], + // usersS2: [], + // followers: [], + // friendRequests: [], + // friends: [], + // gallery: [], + // posts: [], + // detailCards: [], + // simpleCards: [], + // profileCards: [] }; const slice = createSlice({ @@ -28,117 +28,117 @@ const slice = createSlice({ // HAS ERROR hasError(state, action) { state.error = action.payload; - }, - - // GET USERS STYLE 1 - getUsersListStyle1Success(state, action) { - state.usersS1 = action.payload; - }, - - // GET USERS STYLE 2 - getUsersListStyle2Success(state, action) { - state.usersS2 = action.payload; - }, - - // GET FOLLOWERS - getFollowersSuccess(state, action) { - state.followers = action.payload; - }, - - // FILTER FOLLOWERS - filterFollowersSuccess(state, action) { - state.followers = action.payload; - }, - - // GET FRIEND REQUESTS - getFriendRequestsSuccess(state, action) { - state.friendRequests = action.payload; - }, - - // FILTER FRIEND REQUESTS - filterFriendRequestsSuccess(state, action) { - state.friendRequests = action.payload; - }, - - // GET FRIENDS - getFriendsSuccess(state, action) { - state.friends = action.payload; - }, - - // FILTER FRIENDS - filterFriendsSuccess(state, action) { - state.friends = action.payload; - }, - - // GET GALLERY - getGallerySuccess(state, action) { - state.gallery = action.payload; - }, - - // GET POSTS - getPostsSuccess(state, action) { - state.posts = action.payload; - }, - - // EDIT COMMENT - editCommentSuccess(state, action) { - state.posts = action.payload; - }, - - // ADD COMMENT - addCommentSuccess(state, action) { - state.posts = action.payload; - }, - - // ADD REPLY - addReplySuccess(state, action) { - state.posts = action.payload; - }, - - // LIKE POST - likePostSuccess(state, action) { - state.posts = action.payload; - }, - - // LIKE COMMENT - likeCommentSuccess(state, action) { - state.posts = action.payload; - }, - - // LIKE REPLY - likeReplySuccess(state, action) { - state.posts = action.payload; - }, - - // GET DETAIL CARDS - getDetailCardsSuccess(state, action) { - state.detailCards = action.payload; - }, - - // FILTER DETAIL CARDS - filterDetailCardsSuccess(state, action) { - state.detailCards = action.payload; - }, - - // GET SIMPLE CARDS - getSimpleCardsSuccess(state, action) { - state.simpleCards = action.payload; - }, - - // FILTER SIMPLE CARDS - filterSimpleCardsSuccess(state, action) { - state.simpleCards = action.payload; - }, - - // GET PROFILE CARDS - getProfileCardsSuccess(state, action) { - state.profileCards = action.payload; - }, - - // FILTER PROFILE CARDS - filterProfileCardsSuccess(state, action) { - state.profileCards = action.payload; } + + // // GET USERS STYLE 1 + // getUsersListStyle1Success(state, action) { + // state.usersS1 = action.payload; + // }, + // + // // GET USERS STYLE 2 + // getUsersListStyle2Success(state, action) { + // state.usersS2 = action.payload; + // }, + // + // // GET FOLLOWERS + // getFollowersSuccess(state, action) { + // state.followers = action.payload; + // }, + // + // // FILTER FOLLOWERS + // filterFollowersSuccess(state, action) { + // state.followers = action.payload; + // }, + // + // // GET FRIEND REQUESTS + // getFriendRequestsSuccess(state, action) { + // state.friendRequests = action.payload; + // }, + // + // // FILTER FRIEND REQUESTS + // filterFriendRequestsSuccess(state, action) { + // state.friendRequests = action.payload; + // }, + // + // // GET FRIENDS + // getFriendsSuccess(state, action) { + // state.friends = action.payload; + // }, + // + // // FILTER FRIENDS + // filterFriendsSuccess(state, action) { + // state.friends = action.payload; + // }, + // + // // GET GALLERY + // getGallerySuccess(state, action) { + // state.gallery = action.payload; + // }, + // + // // GET POSTS + // getPostsSuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // EDIT COMMENT + // editCommentSuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // ADD COMMENT + // addCommentSuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // ADD REPLY + // addReplySuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // LIKE POST + // likePostSuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // LIKE COMMENT + // likeCommentSuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // LIKE REPLY + // likeReplySuccess(state, action) { + // state.posts = action.payload; + // }, + // + // // GET DETAIL CARDS + // getDetailCardsSuccess(state, action) { + // state.detailCards = action.payload; + // }, + // + // // FILTER DETAIL CARDS + // filterDetailCardsSuccess(state, action) { + // state.detailCards = action.payload; + // }, + // + // // GET SIMPLE CARDS + // getSimpleCardsSuccess(state, action) { + // state.simpleCards = action.payload; + // }, + // + // // FILTER SIMPLE CARDS + // filterSimpleCardsSuccess(state, action) { + // state.simpleCards = action.payload; + // }, + // + // // GET PROFILE CARDS + // getProfileCardsSuccess(state, action) { + // state.profileCards = action.payload; + // }, + // + // // FILTER PROFILE CARDS + // filterProfileCardsSuccess(state, action) { + // state.profileCards = action.payload; + // } } }); @@ -147,244 +147,244 @@ export default slice.reducer; // ---------------------------------------------------------------------- -export function getUsersListStyle1() { - return async () => { - try { - const response = await axios.get('/api/user-list/s1/list'); - dispatch(slice.actions.getUsersListStyle1Success(response.data.users_s1)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getUsersListStyle2() { - return async () => { - try { - const response = await axios.get('/api/user-list/s2/list'); - dispatch(slice.actions.getUsersListStyle2Success(response.data.users_s2)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getFollowers() { - return async () => { - try { - const response = await axios.get('/api/followers/list'); - dispatch(slice.actions.getFollowersSuccess(response.data.followers)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function filterFollowers(key) { - return async () => { - try { - const response = await axios.post('/api/followers/filter', { key }); - dispatch(slice.actions.filterFollowersSuccess(response.data.results)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getFriendRequests() { - return async () => { - try { - const response = await axios.get('/api/friend-request/list'); - dispatch(slice.actions.getFriendRequestsSuccess(response.data.friends)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function filterFriendRequests(key) { - return async () => { - try { - const response = await axios.post('/api/friend-request/filter', { key }); - dispatch(slice.actions.filterFriendRequestsSuccess(response.data.results)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getFriends() { - return async () => { - try { - const response = await axios.get('/api/friends/list'); - dispatch(slice.actions.getFriendsSuccess(response.data.friends)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function filterFriends(key) { - return async () => { - try { - const response = await axios.post('/api/friends/filter', { key }); - dispatch(slice.actions.filterFriendsSuccess(response.data.results)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getGallery() { - return async () => { - try { - const response = await axios.get('/api/gallery/list'); - dispatch(slice.actions.getGallerySuccess(response.data.gallery)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getPosts() { - return async () => { - try { - const response = await axios.get('/api/posts/list'); - dispatch(slice.actions.getPostsSuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function editComment(key, id) { - return async () => { - try { - const response = await axios.post('/api/posts/editComment', { key, id }); - dispatch(slice.actions.editCommentSuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function addComment(postId, comment) { - return async () => { - try { - const response = await axios.post('/api/comments/add', { postId, comment }); - dispatch(slice.actions.addCommentSuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function addReply(postId, commentId, reply) { - return async () => { - try { - const response = await axios.post('/api/replies/add', { postId, commentId, reply }); - dispatch(slice.actions.addReplySuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function likePost(postId) { - return async () => { - try { - const response = await axios.post('/api/posts/list/like', { postId }); - dispatch(slice.actions.likePostSuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function likeComment(postId, commentId) { - return async () => { - try { - const response = await axios.post('/api/comments/list/like', { postId, commentId }); - dispatch(slice.actions.likeCommentSuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function likeReply(postId, commentId, replayId) { - return async () => { - try { - const response = await axios.post('/api/replies/list/like', { postId, commentId, replayId }); - dispatch(slice.actions.likeReplySuccess(response.data.posts)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getDetailCards() { - return async () => { - try { - const response = await axios.get('/api/details-card/list'); - dispatch(slice.actions.getDetailCardsSuccess(response.data.users)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function filterDetailCards(key) { - return async () => { - try { - const response = await axios.post('/api/details-card/filter', { key }); - dispatch(slice.actions.filterDetailCardsSuccess(response.data.results)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getSimpleCards() { - return async () => { - try { - const response = await axios.get('/api/simple-card/list'); - dispatch(slice.actions.getSimpleCardsSuccess(response.data.users)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function filterSimpleCards(key) { - return async () => { - try { - const response = await axios.post('/api/simple-card/filter', { key }); - dispatch(slice.actions.filterSimpleCardsSuccess(response.data.results)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function getProfileCards() { - return async () => { - try { - const response = await axios.get('/api/profile-card/list'); - dispatch(slice.actions.getProfileCardsSuccess(response.data.users)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} - -export function filterProfileCards(key) { - return async () => { - try { - const response = await axios.post('/api/profile-card/filter', { key }); - dispatch(slice.actions.filterProfileCardsSuccess(response.data.results)); - } catch (error) { - dispatch(slice.actions.hasError(error)); - } - }; -} +// export function getUsersListStyle1() { +// return async () => { +// try { +// const response = await axios.get('/api/user-list/s1/list'); +// dispatch(slice.actions.getUsersListStyle1Success(response.data.users_s1)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getUsersListStyle2() { +// return async () => { +// try { +// const response = await axios.get('/api/user-list/s2/list'); +// dispatch(slice.actions.getUsersListStyle2Success(response.data.users_s2)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getFollowers() { +// return async () => { +// try { +// const response = await axios.get('/api/followers/list'); +// dispatch(slice.actions.getFollowersSuccess(response.data.followers)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function filterFollowers(key) { +// return async () => { +// try { +// const response = await axios.post('/api/followers/filter', { key }); +// dispatch(slice.actions.filterFollowersSuccess(response.data.results)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getFriendRequests() { +// return async () => { +// try { +// const response = await axios.get('/api/friend-request/list'); +// dispatch(slice.actions.getFriendRequestsSuccess(response.data.friends)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function filterFriendRequests(key) { +// return async () => { +// try { +// const response = await axios.post('/api/friend-request/filter', { key }); +// dispatch(slice.actions.filterFriendRequestsSuccess(response.data.results)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getFriends() { +// return async () => { +// try { +// const response = await axios.get('/api/friends/list'); +// dispatch(slice.actions.getFriendsSuccess(response.data.friends)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function filterFriends(key) { +// return async () => { +// try { +// const response = await axios.post('/api/friends/filter', { key }); +// dispatch(slice.actions.filterFriendsSuccess(response.data.results)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getGallery() { +// return async () => { +// try { +// const response = await axios.get('/api/gallery/list'); +// dispatch(slice.actions.getGallerySuccess(response.data.gallery)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getPosts() { +// return async () => { +// try { +// const response = await axios.get('/api/posts/list'); +// dispatch(slice.actions.getPostsSuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function editComment(key, id) { +// return async () => { +// try { +// const response = await axios.post('/api/posts/editComment', { key, id }); +// dispatch(slice.actions.editCommentSuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function addComment(postId, comment) { +// return async () => { +// try { +// const response = await axios.post('/api/comments/add', { postId, comment }); +// dispatch(slice.actions.addCommentSuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function addReply(postId, commentId, reply) { +// return async () => { +// try { +// const response = await axios.post('/api/replies/add', { postId, commentId, reply }); +// dispatch(slice.actions.addReplySuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function likePost(postId) { +// return async () => { +// try { +// const response = await axios.post('/api/posts/list/like', { postId }); +// dispatch(slice.actions.likePostSuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function likeComment(postId, commentId) { +// return async () => { +// try { +// const response = await axios.post('/api/comments/list/like', { postId, commentId }); +// dispatch(slice.actions.likeCommentSuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function likeReply(postId, commentId, replayId) { +// return async () => { +// try { +// const response = await axios.post('/api/replies/list/like', { postId, commentId, replayId }); +// dispatch(slice.actions.likeReplySuccess(response.data.posts)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getDetailCards() { +// return async () => { +// try { +// const response = await axios.get('/api/details-card/list'); +// dispatch(slice.actions.getDetailCardsSuccess(response.data.users)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function filterDetailCards(key) { +// return async () => { +// try { +// const response = await axios.post('/api/details-card/filter', { key }); +// dispatch(slice.actions.filterDetailCardsSuccess(response.data.results)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getSimpleCards() { +// return async () => { +// try { +// const response = await axios.get('/api/simple-card/list'); +// dispatch(slice.actions.getSimpleCardsSuccess(response.data.users)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function filterSimpleCards(key) { +// return async () => { +// try { +// const response = await axios.post('/api/simple-card/filter', { key }); +// dispatch(slice.actions.filterSimpleCardsSuccess(response.data.results)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function getProfileCards() { +// return async () => { +// try { +// const response = await axios.get('/api/profile-card/list'); +// dispatch(slice.actions.getProfileCardsSuccess(response.data.users)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } +// +// export function filterProfileCards(key) { +// return async () => { +// try { +// const response = await axios.post('/api/profile-card/filter', { key }); +// dispatch(slice.actions.filterProfileCardsSuccess(response.data.results)); +// } catch (error) { +// dispatch(slice.actions.hasError(error)); +// } +// }; +// } diff --git a/src/ui-component/cards/AnalyticsChartCard.js b/src/ui-component/cards/AnalyticsChartCard.js deleted file mode 100755 index 635c679..0000000 --- a/src/ui-component/cards/AnalyticsChartCard.js +++ /dev/null @@ -1,127 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { Box, Button, Grid, Menu, MenuItem, Typography } from '@mui/material'; - -// third party -import Chart from 'react-apexcharts'; - -// project imports -import MainCard from './MainCard'; - -// assets -import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward'; -import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward'; - -// ==========================|| ANALYTICS CHART CARD ||========================== // - -const AnalyticsChartCard = ({ title, chartData, dropData, listData }) => { - const [anchorEl, setAnchorEl] = useState(null); - - let dropHtml; - if (dropData) { - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - dropHtml = ( - <> - - - {dropData?.options.map((option, index) => ( - - {option.label} - - ))} - - - ); - } - - let listItem; - if (listData) { - listItem = listData.map((item, index) => ( - - - - {item.icon} - - {item.value}% - - - {item.state === 1 && } - {item.state === 0 && } - - - - {item.percentage}% - - - - - - )); - } - - return ( - - - {title && ( - - {title} - - )} - {dropHtml} - - - - - {listItem} - - - - - - - - ); -}; - -AnalyticsChartCard.propTypes = { - title: PropTypes.string, - chartData: PropTypes.object, - dropData: PropTypes.object, - listData: PropTypes.array -}; - -export default AnalyticsChartCard; diff --git a/src/ui-component/cards/AttachmentCard.js b/src/ui-component/cards/AttachmentCard.js deleted file mode 100755 index 8bdf318..0000000 --- a/src/ui-component/cards/AttachmentCard.js +++ /dev/null @@ -1,43 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Card, CardContent, CardMedia, Grid, Typography } from '@mui/material'; -import { gridSpacing } from 'store/constant'; - -// assets -import DownloadForOfflineTwoToneIcon from '@mui/icons-material/DownloadForOfflineTwoTone'; - -const backImage = require.context('assets/images/profile', true); - -// ==============================|| ATTACHMENT CARD ||============================== // - -const AttachmentCard = ({ title, image }) => { - const theme = useTheme(); - const backProfile = image && backImage(`./${image}`).default; - - return ( - - - - - - - {title} - - - - - - - - - ); -}; - -AttachmentCard.propTypes = { - image: PropTypes.string, - title: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]) -}; - -export default AttachmentCard; diff --git a/src/ui-component/cards/AuthSlider.js b/src/ui-component/cards/AuthSlider.js deleted file mode 100755 index 4760ad9..0000000 --- a/src/ui-component/cards/AuthSlider.js +++ /dev/null @@ -1,40 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { Grid, Typography } from '@mui/material'; - -// third-party -import Slider from 'react-slick'; - -const AuthSlider = ({ items }) => { - const settings = { - autoplay: true, - arrows: false, - dots: true, - infinite: true, - speed: 500, - slidesToShow: 1, - slidesToScroll: 1 - }; - - return ( - - {items.map((item, i) => ( - - - {item.title} - - - {item.description} - - - ))} - - ); -}; - -AuthSlider.propTypes = { - items: PropTypes.array.isRequired -}; - -export default AuthSlider; diff --git a/src/ui-component/cards/ContactCard.js b/src/ui-component/cards/ContactCard.js deleted file mode 100755 index 5924583..0000000 --- a/src/ui-component/cards/ContactCard.js +++ /dev/null @@ -1,132 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Button, Card, Grid, Menu, MenuItem, Typography } from '@mui/material'; - -// project imports -import Avatar from '../extended/Avatar'; -import { gridSpacing } from 'store/constant'; - -// assets -import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; -import ChatBubbleTwoToneIcon from '@mui/icons-material/ChatBubbleTwoTone'; -import PhoneTwoToneIcon from '@mui/icons-material/PhoneTwoTone'; - -const avatarImage = require.context('assets/images/users', true); - -// ==============================|| USER CONTACT CARD ||============================== // - -const ContactCard = ({ avatar, contact, email, name, location, onActive, role }) => { - const theme = useTheme(); - - const avatarProfile = avatar && avatarImage(`./${avatar}`).default; - - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - onActive && onActive()} style={{ cursor: 'pointer' }}> - - - - - - Today - This Month - This Year - - - - - - - {name} - - {role} - - - Email - {email} - - - - - Phone - {contact} - - - Location - {location} - - - - - - - - - - - - - - - - ); -}; - -ContactCard.propTypes = { - avatar: PropTypes.string, - contact: PropTypes.string, - email: PropTypes.string, - location: PropTypes.string, - name: PropTypes.string, - onActive: PropTypes.func, - role: PropTypes.string -}; - -export default ContactCard; diff --git a/src/ui-component/cards/ContactList.js b/src/ui-component/cards/ContactList.js deleted file mode 100755 index e6c127d..0000000 --- a/src/ui-component/cards/ContactList.js +++ /dev/null @@ -1,83 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { styled, useTheme } from '@mui/material/styles'; -import { Button, Grid, Tooltip, Typography } from '@mui/material'; - -// project imports -import Avatar from '../extended/Avatar'; -import { gridSpacing } from 'store/constant'; - -// assets -import ChatBubbleTwoToneIcon from '@mui/icons-material/ChatBubbleTwoTone'; -import PhoneTwoToneIcon from '@mui/icons-material/PhoneTwoTone'; - -const avatarImage = require.context('assets/images/users', true); - -// styles -const ListWrapper = styled('div')(({ theme }) => ({ - padding: '15px 0', - borderBottom: theme.palette.mode === 'dark' ? 'none' : '1px solid', - borderTop: theme.palette.mode === 'dark' ? 'none' : '1px solid', - borderColor: `${theme.palette.grey[100]}!important` -})); - -// ==============================|| USER CONTACT LIST ||============================== // - -const ContactList = ({ avatar, name, role, onActive }) => { - const theme = useTheme(); - const avatarProfile = avatar && avatarImage(`./${avatar}`).default; - - return ( - - - onActive && onActive()} style={{ cursor: 'pointer' }}> - - - - - - - - - {name} - - - - {role} - - - - - - - - - - - - - - - - - - - - - - ); -}; - -ContactList.propTypes = { - avatar: PropTypes.string, - name: PropTypes.string, - onActive: PropTypes.func, - role: PropTypes.string -}; - -export default ContactList; diff --git a/src/ui-component/cards/FloatingCart.js b/src/ui-component/cards/FloatingCart.js deleted file mode 100755 index be052ee..0000000 --- a/src/ui-component/cards/FloatingCart.js +++ /dev/null @@ -1,59 +0,0 @@ -import { sum } from 'lodash'; -import { Link } from 'react-router-dom'; -import { useSelector } from 'store'; - -// material-ui -import { useTheme, styled } from '@mui/material/styles'; -import { Fab, Badge, IconButton } from '@mui/material'; - -// assets -import ShoppingCartTwoToneIcon from '@mui/icons-material/ShoppingCartTwoTone'; - -const StyledBadge = styled(Badge)(({ theme }) => ({ - '& .MuiBadge-badge': { - right: 0, - top: 3, - border: `2px solid ${theme.palette.background.paper}`, - padding: '0 4px' - } -})); - -// ==============================|| CART ITEMS - FLOATING BUTTON ||============================== // - -const FloatingCart = () => { - const theme = useTheme(); - const cart = useSelector((state) => state.cart); - const totalQuantity = sum(cart.checkout.products.map((item) => item.quantity)); - - return ( - - - - - - - - ); -}; - -export default FloatingCart; diff --git a/src/ui-component/cards/FollowerCard.js b/src/ui-component/cards/FollowerCard.js deleted file mode 100755 index 38bad90..0000000 --- a/src/ui-component/cards/FollowerCard.js +++ /dev/null @@ -1,141 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Avatar, Button, Card, Grid, ListItemIcon, Menu, MenuItem, Typography } from '@mui/material'; - -// assets -import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; -import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone'; -import PeopleAltTwoToneIcon from '@mui/icons-material/PeopleAltTwoTone'; -import PinDropTwoToneIcon from '@mui/icons-material/PinDropTwoTone'; - -import FavoriteTwoToneIcon from '@mui/icons-material/FavoriteTwoTone'; -import DeleteTwoToneIcon from '@mui/icons-material/DeleteTwoTone'; -import GroupTwoToneIcon from '@mui/icons-material/GroupTwoTone'; - -const avatarImage = require.context('assets/images/profile', true); - -// ==============================|| SOCIAL PROFILE - FOLLOWER CARD ||============================== // - -const FollowerCard = ({ avatar, follow, location, name }) => { - const theme = useTheme(); - const avatarProfile = avatar && avatarImage(`./${avatar}`).default; - - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - - - - - - {name} - - - - {location} - - - - - - - - - - Favorites - - - - - - Edit Friend List - - - - - - Removed - - - - - - - {follow === 2 ? ( - - ) : ( - - )} - - - - ); -}; - -FollowerCard.propTypes = { - avatar: PropTypes.string, - follow: PropTypes.number, - location: PropTypes.string, - name: PropTypes.string -}; - -export default FollowerCard; diff --git a/src/ui-component/cards/FriendRequestCard.js b/src/ui-component/cards/FriendRequestCard.js deleted file mode 100755 index d3c0f51..0000000 --- a/src/ui-component/cards/FriendRequestCard.js +++ /dev/null @@ -1,141 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Avatar, Button, Card, Grid, IconButton, ListItemIcon, Menu, MenuItem, Typography } from '@mui/material'; - -// project import -import { gridSpacing } from 'store/constant'; - -// assets -import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; -import FavoriteTwoToneIcon from '@mui/icons-material/FavoriteTwoTone'; -import DeleteTwoToneIcon from '@mui/icons-material/DeleteTwoTone'; -import GroupTwoToneIcon from '@mui/icons-material/GroupTwoTone'; - -const avatarImage = require.context('assets/images/profile', true); - -// ==============================|| SOCIAL PROFILE - FRIEND REQUEST CARD ||============================== // - -const FriendRequestCard = ({ avatar, name, mutual }) => { - const theme = useTheme(); - const avatarProfile = avatar && avatarImage(`./${avatar}`).default; - - const btnSX = { - borderColor: theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[200], - background: theme.palette.mode === 'dark' ? theme.palette.dark.dark : theme.palette.background.paper - }; - - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - - - - - - {name} - - - {mutual} mutual friends - - - - - - - - - - - - Favorites - - - - - - Edit Friend List - - - - - - Unfriend - - - - - - - - - - - - - - - - - - ); -}; - -FriendRequestCard.propTypes = { - avatar: PropTypes.string, - mutual: PropTypes.number, - name: PropTypes.string -}; - -export default FriendRequestCard; diff --git a/src/ui-component/cards/FriendsCard.js b/src/ui-component/cards/FriendsCard.js deleted file mode 100755 index f09ec64..0000000 --- a/src/ui-component/cards/FriendsCard.js +++ /dev/null @@ -1,151 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Avatar, Button, Card, Grid, IconButton, ListItemIcon, Menu, MenuItem, Typography, Tooltip } from '@mui/material'; - -// project imports -import { gridSpacing } from 'store/constant'; - -// assets -import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; -import PinDropTwoToneIcon from '@mui/icons-material/PinDropTwoTone'; -import VideoCallTwoToneIcon from '@mui/icons-material/VideoCallTwoTone'; -import ChatBubbleTwoToneIcon from '@mui/icons-material/ChatBubbleTwoTone'; - -import FavoriteTwoToneIcon from '@mui/icons-material/FavoriteTwoTone'; -import DeleteTwoToneIcon from '@mui/icons-material/DeleteTwoTone'; -import GroupTwoToneIcon from '@mui/icons-material/GroupTwoTone'; - -const avatarImage = require.context('assets/images/profile', true); - -// ==============================|| SOCIAL PROFILE - FRIENDS CARD ||============================== // - -const FriendsCard = ({ avatar, location, name }) => { - const theme = useTheme(); - - const avatarProfile = avatar && avatarImage(`./${avatar}`).default; - - const btnSX = { - borderColor: theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[200], - background: theme.palette.mode === 'dark' ? theme.palette.dark.dark : theme.palette.background.paper - }; - - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - - - - - - {name} - - - - {location} - - - - - - - - - - - - Favorites - - - - - - Edit Friend List - - - - - - Unfriend - - - - - - - - - - - - - - - - - - - - - - ); -}; - -FriendsCard.propTypes = { - avatar: PropTypes.string, - location: PropTypes.string, - name: PropTypes.string -}; - -export default FriendsCard; diff --git a/src/ui-component/cards/GalleryCard.js b/src/ui-component/cards/GalleryCard.js deleted file mode 100755 index a4be25a..0000000 --- a/src/ui-component/cards/GalleryCard.js +++ /dev/null @@ -1,119 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { ButtonBase, Card, CardContent, CardMedia, Grid, Menu, MenuItem, Typography } from '@mui/material'; - -// project imports -import Avatar from 'ui-component/extended/Avatar'; -import { gridSpacing } from 'store/constant'; - -// assets -import MoreVertTwoToneIcon from '@mui/icons-material/MoreVertTwoTone'; -import EventTwoToneIcon from '@mui/icons-material/EventTwoTone'; - -const backImage = require.context('assets/images/profile', true); - -// ==============================|| SOCIAL PROFILE - GALLERY CARD ||============================== // - -const GalleryCard = ({ dateTime, image, title }) => { - const theme = useTheme(); - const backProfile = image && backImage(`./${image}`).default; - - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - - - {title} - - - - {dateTime} - - - - - - - - - - - Remove Tag - Download - Make Profile Picture - Make Cover Photo - Find Support or Report Photo - - - - - - ); -}; - -GalleryCard.propTypes = { - dateTime: PropTypes.string, - image: PropTypes.string, - title: PropTypes.string -}; - -export default GalleryCard; diff --git a/src/ui-component/cards/HoverDataCard.js b/src/ui-component/cards/HoverDataCard.js deleted file mode 100755 index c1b6437..0000000 --- a/src/ui-component/cards/HoverDataCard.js +++ /dev/null @@ -1,47 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { Grid, Stack, Typography } from '@mui/material'; - -// project imports -import MainCard from './MainCard'; - -// ============================|| HOVER DATA CARD ||============================ // - -const HoverDataCard = ({ title, iconPrimary, primary, secondary, color }) => { - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary !== undefined ? : null; - - return ( - - - - - {title} - - - - - {primaryIcon} - {primary} - - - - - {secondary} - - - - - ); -}; - -HoverDataCard.propTypes = { - title: PropTypes.string, - iconPrimary: PropTypes.object, - primary: PropTypes.number, - secondary: PropTypes.string, - color: PropTypes.string -}; - -export default HoverDataCard; diff --git a/src/ui-component/cards/HoverSocialCard.js b/src/ui-component/cards/HoverSocialCard.js deleted file mode 100755 index 98f6311..0000000 --- a/src/ui-component/cards/HoverSocialCard.js +++ /dev/null @@ -1,66 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { Card, CardContent, Grid, Typography } from '@mui/material'; - -// ===========================|| HOVER SOCIAL CARD ||=========================== // - -const HoverSocialCard = ({ primary, secondary, iconPrimary, color }) => { - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary ? : null; - - return ( - - - svg': { - width: 40, - height: 40, - opacity: '0.4', - transition: 'all .3s ease-in-out' - } - }} - > - {primaryIcon} - - - - - {secondary} - - - - - {primary} - - - - - - ); -}; - -HoverSocialCard.propTypes = { - primary: PropTypes.string, - secondary: PropTypes.string, - iconPrimary: PropTypes.object, - color: PropTypes.string -}; - -export default HoverSocialCard; diff --git a/src/ui-component/cards/IconNumberCard.js b/src/ui-component/cards/IconNumberCard.js deleted file mode 100755 index 186f8a4..0000000 --- a/src/ui-component/cards/IconNumberCard.js +++ /dev/null @@ -1,45 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { Grid, Typography } from '@mui/material'; - -// project imports -import MainCard from './MainCard'; - -// =============================|| ICON NUMBER CARD ||============================= // - -const IconNumberCard = ({ title, primary, color, iconPrimary }) => { - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary ? : null; - - return ( - - - - - - - {primaryIcon} - - - {title} - - - - {primary} - - - - - - ); -}; - -IconNumberCard.propTypes = { - title: PropTypes.string, - primary: PropTypes.string, - color: PropTypes.string, - iconPrimary: PropTypes.object -}; - -export default IconNumberCard; diff --git a/src/ui-component/cards/ProductCard.js b/src/ui-component/cards/ProductCard.js deleted file mode 100755 index 2494ca3..0000000 --- a/src/ui-component/cards/ProductCard.js +++ /dev/null @@ -1,133 +0,0 @@ -import PropTypes from 'prop-types'; -import { useEffect, useState } from 'react'; -import { Link } from 'react-router-dom'; - -// material-ui -import { Button, CardContent, CardMedia, Grid, Rating, Stack, Typography } from '@mui/material'; - -// project import -import MainCard from './MainCard'; -import SkeletonProductPlaceholder from 'ui-component/cards/Skeleton/ProductPlaceholder'; -import { useDispatch, useSelector } from 'store'; -import { addProduct } from 'store/slices/cart'; -import { openSnackbar } from 'store/slices/snackbar'; - -// assets -import ShoppingCartTwoToneIcon from '@mui/icons-material/ShoppingCartTwoTone'; - -const prodImage = require.context('assets/images/e-commerce', true); - -// ==============================|| PRODUCT CARD ||============================== // - -const ProductCard = ({ id, color, name, image, description, offerPrice, salePrice, rating }) => { - const dispatch = useDispatch(); - - const prodProfile = image && prodImage(`./${image}`).default; - const [productRating] = useState(rating); - const cart = useSelector((state) => state.cart); - - const addCart = () => { - dispatch(addProduct({ id, name, image, salePrice, offerPrice, color, size: 8, quantity: 1 }, cart.checkout.products)); - dispatch( - openSnackbar({ - open: true, - message: 'Add To Cart Success', - variant: 'alert', - alert: { - color: 'success' - }, - close: false - }) - ); - }; - - const [isLoading, setLoading] = useState(true); - useEffect(() => { - setLoading(false); - }, []); - - return ( - <> - {isLoading ? ( - - ) : ( - - - - - - - {name} - - - {description && ( - - - {description} - - - )} - - - - ({offerPrice}+) - - - - - - - ${offerPrice} - - - - ${salePrice} - - - - - - - - - - )} - - ); -}; - -ProductCard.propTypes = { - id: PropTypes.number, - color: PropTypes.string, - name: PropTypes.string, - image: PropTypes.string, - description: PropTypes.string, - offerPrice: PropTypes.number, - salePrice: PropTypes.number, - rating: PropTypes.number -}; - -export default ProductCard; diff --git a/src/ui-component/cards/ProductReview.js b/src/ui-component/cards/ProductReview.js deleted file mode 100755 index f4eec53..0000000 --- a/src/ui-component/cards/ProductReview.js +++ /dev/null @@ -1,123 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { Divider, Grid, Menu, MenuItem, Rating, Stack, Tooltip, Typography } from '@mui/material'; - -// third-party -import { format } from 'date-fns'; - -// project imports -import Avatar from '../extended/Avatar'; - -// assets -import StarTwoToneIcon from '@mui/icons-material/StarTwoTone'; -import StarBorderTwoToneIcon from '@mui/icons-material/StarBorderTwoTone'; -import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; -import VerifiedUserIcon from '@mui/icons-material/VerifiedUser'; -import DirectionsRunIcon from '@mui/icons-material/DirectionsRun'; - -const avatarImage = require.context('assets/images/profile', true); - -// ==============================|| PRODUCT DETAILS - REVIEW ||============================== // - -const ProductReview = ({ avatar, date, name, status, rating, review }) => { - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - - - - {name} - - {status && ( - - - - )} - {!status && ( - - - - )} - - {format(new Date(date), 'E, MMM d yyyy')} - - - - - - - - } - emptyIcon={} - precision={0.1} - readOnly - /> - {review} - - - - - - - Edit - Delete - - - - - - - - - - ); -}; - -ProductReview.propTypes = { - avatar: PropTypes.string, - date: PropTypes.string, - name: PropTypes.string, - status: PropTypes.bool, - rating: PropTypes.number, - review: PropTypes.string -}; - -export default ProductReview; diff --git a/src/ui-component/cards/ReportCard.js b/src/ui-component/cards/ReportCard.js deleted file mode 100755 index 7c0214c..0000000 --- a/src/ui-component/cards/ReportCard.js +++ /dev/null @@ -1,41 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { Grid, Stack, Typography } from '@mui/material'; - -// project imports -import MainCard from './MainCard'; - -// ==============================|| REPORT CARD ||============================== // - -const ReportCard = ({ primary, secondary, iconPrimary, color }) => { - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary ? : null; - - return ( - - - - - {primary} - {secondary} - - - - - {primaryIcon} - - - - - ); -}; - -ReportCard.propTypes = { - primary: PropTypes.string, - secondary: PropTypes.string, - iconPrimary: PropTypes.object, - color: PropTypes.string -}; - -export default ReportCard; diff --git a/src/ui-component/cards/RevenueCard.js b/src/ui-component/cards/RevenueCard.js deleted file mode 100755 index 092d717..0000000 --- a/src/ui-component/cards/RevenueCard.js +++ /dev/null @@ -1,65 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Card, CardContent, Grid, Typography, useMediaQuery } from '@mui/material'; - -// =============================|| REVENUE CARD ||============================= // - -const RevenueCard = ({ primary, secondary, content, iconPrimary, color }) => { - const theme = useTheme(); - const matchDownXs = useMediaQuery(theme.breakpoints.down('sm')); - - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary ? : null; - - return ( - - - svg': { width: 100, height: 100, opacity: '0.5' }, - [theme.breakpoints.down('sm')]: { - top: 13, - '&> svg': { width: 80, height: 80 } - } - }} - > - {primaryIcon} - - - - - {primary} - - - - - {secondary} - - - - - {content} - - - - - - ); -}; - -RevenueCard.propTypes = { - primary: PropTypes.string, - secondary: PropTypes.string, - content: PropTypes.string, - iconPrimary: PropTypes.object, - color: PropTypes.string -}; - -export default RevenueCard; diff --git a/src/ui-component/cards/SalesLineChartCard.js b/src/ui-component/cards/SalesLineChartCard.js deleted file mode 100755 index bdd28b7..0000000 --- a/src/ui-component/cards/SalesLineChartCard.js +++ /dev/null @@ -1,102 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Box, Card, Grid, Typography } from '@mui/material'; - -// third party -import Chart from 'react-apexcharts'; - -// ============================|| SALES LINE CARD ||============================ // - -const SalesLineChartCard = ({ bgColor, chartData, footerData, icon, title, percentage }) => { - const theme = useTheme(); - - let footerHtml; - if (footerData) { - footerHtml = footerData.map((item, index) => ( - - - - - {item.value} - - {item.label} - - - - )); - } - - return ( - - - - - {title && ( - - - {title} - - - )} - - - {icon && ( - - {icon} - - )} - {percentage && ( - - {percentage} - - )} - - - - {chartData && ( - - - - )} - - - {footerData && ( - - {footerHtml} - - )} - - ); -}; - -SalesLineChartCard.propTypes = { - title: PropTypes.string, - chartData: PropTypes.object, - footerData: PropTypes.array, - dropData: PropTypes.object, - listData: PropTypes.object, - bgColor: PropTypes.string, - icon: PropTypes.element, - percentage: PropTypes.string -}; - -export default SalesLineChartCard; diff --git a/src/ui-component/cards/SeoChartCard.js b/src/ui-component/cards/SeoChartCard.js deleted file mode 100755 index d87ecdf..0000000 --- a/src/ui-component/cards/SeoChartCard.js +++ /dev/null @@ -1,63 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Box, Grid, Typography, useMediaQuery } from '@mui/material'; - -// third party -import Chart from 'react-apexcharts'; - -// project imports -import MainCard from './MainCard'; - -// =============================|| SEO CHART CARD ||============================= // - -const SeoChartCard = ({ chartData, value, title, icon, type }) => { - const theme = useTheme(); - const matchDownMd = useMediaQuery(theme.breakpoints.down('lg')); - - return ( - - - - - {value && ( - - {value} - - )} - {(title || icon) && ( - - {title && {title}} - {icon && ( - - {icon} - - )} - - )} - - - {chartData && ( - - - - )} - - - ); -}; - -SeoChartCard.propTypes = { - chartData: PropTypes.object, - title: PropTypes.string, - icon: PropTypes.element, - value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - type: PropTypes.number -}; - -export default SeoChartCard; diff --git a/src/ui-component/cards/SideIconCard.js b/src/ui-component/cards/SideIconCard.js deleted file mode 100755 index 9ca38e3..0000000 --- a/src/ui-component/cards/SideIconCard.js +++ /dev/null @@ -1,63 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Card, Grid, Typography, useMediaQuery } from '@mui/material'; - -// =============================|| SIDE ICON CARD ||============================= // - -const SideIconCard = ({ iconPrimary, primary, secondary, secondarySub, color, bgcolor }) => { - const theme = useTheme(); - const matchDownXs = useMediaQuery(theme.breakpoints.down('sm')); - - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary !== undefined ? : null; - - return ( - - - - svg': { - width: 32, - height: 32 - } - }} - align="center" - > - {primaryIcon} - - - - - - - {primary} - - - - - {secondary} {secondarySub}{' '} - - - - - - - ); -}; - -SideIconCard.propTypes = { - iconPrimary: PropTypes.object, - primary: PropTypes.string, - secondary: PropTypes.string, - secondarySub: PropTypes.string, - color: PropTypes.string, - bgcolor: PropTypes.string -}; - -export default SideIconCard; diff --git a/src/ui-component/cards/Skeleton/EarningCard.js b/src/ui-component/cards/Skeleton/EarningCard.js deleted file mode 100755 index ef751de..0000000 --- a/src/ui-component/cards/Skeleton/EarningCard.js +++ /dev/null @@ -1,32 +0,0 @@ -// material-ui -import { Card, CardContent, Grid } from '@mui/material'; -import Skeleton from '@mui/material/Skeleton'; - -// ==============================|| SKELETON - EARNING CARD ||============================== // - -const EarningCard = () => ( - - - - - - - - - - - - - - - - - - - - - - -); - -export default EarningCard; diff --git a/src/ui-component/cards/Skeleton/ImagePlaceholder.js b/src/ui-component/cards/Skeleton/ImagePlaceholder.js deleted file mode 100755 index 3295b1f..0000000 --- a/src/ui-component/cards/Skeleton/ImagePlaceholder.js +++ /dev/null @@ -1,8 +0,0 @@ -// material-ui -import Skeleton from '@mui/material/Skeleton'; - -// ==============================|| SKELETON IMAGE CARD ||============================== // - -const ImagePlaceholder = ({ ...others }) => ; - -export default ImagePlaceholder; diff --git a/src/ui-component/cards/Skeleton/PopularCard.js b/src/ui-component/cards/Skeleton/PopularCard.js deleted file mode 100755 index 626526e..0000000 --- a/src/ui-component/cards/Skeleton/PopularCard.js +++ /dev/null @@ -1,155 +0,0 @@ -// material-ui -import { Card, CardContent, Grid } from '@mui/material'; -import Skeleton from '@mui/material/Skeleton'; - -// project imports -import { gridSpacing } from 'store/constant'; - -// ==============================|| SKELETON - POPULAR CARD ||============================== // - -const PopularCard = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default PopularCard; diff --git a/src/ui-component/cards/Skeleton/ProductPlaceholder.js b/src/ui-component/cards/Skeleton/ProductPlaceholder.js deleted file mode 100755 index 50d7d14..0000000 --- a/src/ui-component/cards/Skeleton/ProductPlaceholder.js +++ /dev/null @@ -1,44 +0,0 @@ -// material-ui -import { CardContent, Grid, Skeleton, Stack } from '@mui/material'; - -// project import -import MainCard from '../MainCard'; - -// ===========================|| SKELETON TOTAL GROWTH BAR CHART ||=========================== // - -const ProductPlaceholder = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default ProductPlaceholder; diff --git a/src/ui-component/cards/Skeleton/TotalGrowthBarChart.js b/src/ui-component/cards/Skeleton/TotalGrowthBarChart.js deleted file mode 100755 index 60710d6..0000000 --- a/src/ui-component/cards/Skeleton/TotalGrowthBarChart.js +++ /dev/null @@ -1,39 +0,0 @@ -// material-ui -import { Card, CardContent, Grid } from '@mui/material'; -import Skeleton from '@mui/material/Skeleton'; - -// project imports -import { gridSpacing } from 'store/constant'; - -// ==============================|| SKELETON TOTAL GROWTH BAR CHART ||============================== // - -const TotalGrowthBarChart = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default TotalGrowthBarChart; diff --git a/src/ui-component/cards/Skeleton/TotalIncomeCard.js b/src/ui-component/cards/Skeleton/TotalIncomeCard.js deleted file mode 100755 index 454083d..0000000 --- a/src/ui-component/cards/Skeleton/TotalIncomeCard.js +++ /dev/null @@ -1,19 +0,0 @@ -// material-ui -import { Card, List, ListItem, ListItemAvatar, ListItemText, Skeleton } from '@mui/material'; - -// ==============================|| SKELETON - TOTAL INCOME DARK/LIGHT CARD ||============================== // - -const TotalIncomeCard = () => ( - - - - - - - } secondary={} /> - - - -); - -export default TotalIncomeCard; diff --git a/src/ui-component/cards/TotalLineChartCard.js b/src/ui-component/cards/TotalLineChartCard.js deleted file mode 100755 index 6602ddb..0000000 --- a/src/ui-component/cards/TotalLineChartCard.js +++ /dev/null @@ -1,59 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Box, Card, Grid, Typography } from '@mui/material'; - -// third party -import Chart from 'react-apexcharts'; - -// ============================|| TOTAL LINE CHART CARD ||============================ // - -const TotalLineChartCard = ({ bgColor, chartData, title, percentage, value }) => { - const theme = useTheme(); - - return ( - - - - - - {value && ( - - - {value} - - - )} - {percentage && ( - - - {percentage} - - - )} - - {title && ( - - - {title} - - - )} - - - {chartData && } - - - ); -}; - -TotalLineChartCard.propTypes = { - bgColor: PropTypes.string, - chartData: PropTypes.object, - title: PropTypes.string, - percentage: PropTypes.string, - value: PropTypes.number -}; - -export default TotalLineChartCard; diff --git a/src/ui-component/cards/UserCountCard.js b/src/ui-component/cards/UserCountCard.js deleted file mode 100755 index f281b43..0000000 --- a/src/ui-component/cards/UserCountCard.js +++ /dev/null @@ -1,55 +0,0 @@ -import PropTypes from 'prop-types'; - -// material-ui -import { styled } from '@mui/material/styles'; -import { Card, CardContent, Grid, Typography } from '@mui/material'; - -// styles -const IconWrapper = styled('div')({ - position: 'absolute', - left: '-17px', - bottom: '-27px', - color: '#fff', - transform: 'rotate(25deg)', - '&> svg': { - width: '100px', - height: '100px', - opacity: '0.35' - } -}); - -// =============================|| USER NUM CARD ||============================= // - -const UserCountCard = ({ primary, secondary, iconPrimary, color }) => { - const IconPrimary = iconPrimary; - const primaryIcon = iconPrimary ? : null; - - return ( - - - {primaryIcon} - - - - {secondary} - - - - - {primary} - - - - - - ); -}; - -UserCountCard.propTypes = { - primary: PropTypes.string, - secondary: PropTypes.string, - iconPrimary: PropTypes.object, - color: PropTypes.string -}; - -export default UserCountCard; diff --git a/src/ui-component/cards/UserDetailsCard.js b/src/ui-component/cards/UserDetailsCard.js deleted file mode 100755 index a651018..0000000 --- a/src/ui-component/cards/UserDetailsCard.js +++ /dev/null @@ -1,139 +0,0 @@ -import PropTypes from 'prop-types'; -import { useState } from 'react'; - -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Button, Card, Grid, IconButton, Menu, MenuItem, Typography } from '@mui/material'; - -// project imports -import { gridSpacing } from 'store/constant'; -import Avatar from '../extended/Avatar'; - -// assets -import MoreHorizOutlinedIcon from '@mui/icons-material/MoreHorizOutlined'; -import NotInterestedTwoToneIcon from '@mui/icons-material/NotInterestedTwoTone'; -import ChatBubbleTwoToneIcon from '@mui/icons-material/ChatBubbleTwoTone'; - -const avatarImage = require.context('assets/images/profile', true); - -// ==============================|| USER DETAILS CARD ||============================== // - -const UserDetailsCard = ({ about, avatar, contact, email, location, name, role }) => { - const theme = useTheme(); - const avatarProfile = avatar && avatarImage(`./${avatar}`).default; - - const [anchorEl, setAnchorEl] = useState(null); - const handleClick = (event) => { - setAnchorEl(event?.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - - - - - - - - - - Edit - Delete - - - - - - - {name} - - {role} - - - - {about} - - - - Email - {email} - - - - - Phone - {contact} - - - Location - {location} - - - - - - - - - - - - - - - - ); -}; - -UserDetailsCard.propTypes = { - about: PropTypes.string, - avatar: PropTypes.string, - contact: PropTypes.string, - email: PropTypes.string, - location: PropTypes.string, - name: PropTypes.string, - role: PropTypes.string -}; - -export default UserDetailsCard; diff --git a/src/ui-component/extended/Snackbar.js b/src/ui-component/extended/Snackbar.js old mode 100755 new mode 100644 diff --git a/src/utils/route-guard/GuestGuard.js b/src/utils/route-guard/GuestGuard.js index a82cfa2..71cd686 100755 --- a/src/utils/route-guard/GuestGuard.js +++ b/src/utils/route-guard/GuestGuard.js @@ -19,7 +19,8 @@ const GuestGuard = ({ children }) => { useEffect(() => { if (isLoggedIn) { - navigate(DASHBOARD_PATH, { replace: true }); + navigate('/publicBoard', { replace: true }); + // navigate(DASHBOARD_PATH, { replace: true }); } }, [isLoggedIn, navigate]); diff --git a/src/views/biz/admin/judge/JudgeReview.jsx b/src/views/biz/admin/judge/JudgeReview.jsx index 866e8c3..5f2fc0b 100644 --- a/src/views/biz/admin/judge/JudgeReview.jsx +++ b/src/views/biz/admin/judge/JudgeReview.jsx @@ -27,7 +27,6 @@ const years = _.range(year, year - 14, -1); const JudgeReview = ({ msDatagb, menuName }) => { const showAlert = useAlert(); - const isInit = useRef(true); const [open, setOpen] = useState(false); const [title, setTitle] = useState(); diff --git a/src/views/biz/admin/judge/ModalJudgeResult.jsx b/src/views/biz/admin/judge/ModalJudgeResult.jsx index 5398ba5..3cca48f 100644 --- a/src/views/biz/admin/judge/ModalJudgeResult.jsx +++ b/src/views/biz/admin/judge/ModalJudgeResult.jsx @@ -6,7 +6,7 @@ import TableContainer from '@mui/material/TableContainer'; import TableHead from '@mui/material/TableHead'; import TableRow from '@mui/material/TableRow'; import { styled } from '@mui/material/styles'; -import { Card, Divider, FormControl, Grid, InputLabel, MenuItem, Select, Stack, TableFooter, Typography } from '@mui/material'; +import { FormControl, Grid, InputLabel, MenuItem, Select, TableFooter, Typography } from '@mui/material'; import PropTypes from 'prop-types'; import Box from '@mui/material/Box'; import combo from 'commons/combo_data'; diff --git a/src/views/dashboard/Analytics/index.js b/src/views/dashboard/Analytics/index.js index 222d169..b3c4507 100755 --- a/src/views/dashboard/Analytics/index.js +++ b/src/views/dashboard/Analytics/index.js @@ -1,166 +1,166 @@ -// material-ui -import { useTheme } from '@mui/material/styles'; -import { Grid, Typography, useMediaQuery } from '@mui/material'; - -// project imports -import MarketShareAreaChartCard from './MarketShareAreaChartCard'; -import TotalRevenueCard from './TotalRevenueCard'; -import LatestCustomerTableCard from './LatestCustomerTableCard'; -import MainCard from 'ui-component/cards/MainCard'; -import RevenueCard from 'ui-component/cards/RevenueCard'; -import UserCountCard from 'ui-component/cards/UserCountCard'; -import { gridSpacing } from 'store/constant'; - -// assets -import { IconShare, IconAccessPoint, IconCircles, IconCreditCard } from '@tabler/icons'; -import MonetizationOnTwoToneIcon from '@mui/icons-material/MonetizationOnTwoTone'; -import AccountCircleTwoTone from '@mui/icons-material/AccountCircleTwoTone'; -import DescriptionTwoToneIcon from '@mui/icons-material/DescriptionTwoTone'; - -// ==============================|| ANALYTICS DASHBOARD ||============================== // - -const Analytics = () => { - const theme = useTheme(); - const matchDownXs = useMediaQuery(theme.breakpoints.down('sm')); - - const blockSX = { - p: 2.5, - borderLeft: '1px solid ', - borderBottom: '1px solid ', - borderLeftColor: theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[200], - borderBottomColor: theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[200] - }; - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1000 - - - SHARES - - - - - - - - - - - - 600 - - - NETWORK - - - - - - - - - - - - - - 3550 - - - RETURNS - - - - - - - - - - - - 100% - - - ORDER - - - - - - - - - - - - - - - - - - - - ); -}; - -export default Analytics; +// // material-ui +// import { useTheme } from '@mui/material/styles'; +// import { Grid, Typography, useMediaQuery } from '@mui/material'; +// +// // project imports +// import MarketShareAreaChartCard from './MarketShareAreaChartCard'; +// import TotalRevenueCard from './TotalRevenueCard'; +// import LatestCustomerTableCard from './LatestCustomerTableCard'; +// import MainCard from 'ui-component/cards/MainCard'; +// import RevenueCard from 'ui-component/cards/RevenueCard'; +// import UserCountCard from 'ui-component/cards/UserCountCard'; +// import { gridSpacing } from 'store/constant'; +// +// // assets +// import { IconShare, IconAccessPoint, IconCircles, IconCreditCard } from '@tabler/icons'; +// import MonetizationOnTwoToneIcon from '@mui/icons-material/MonetizationOnTwoTone'; +// import AccountCircleTwoTone from '@mui/icons-material/AccountCircleTwoTone'; +// import DescriptionTwoToneIcon from '@mui/icons-material/DescriptionTwoTone'; +// +// // ==============================|| ANALYTICS DASHBOARD ||============================== // +// +// const Analytics = () => { +// const theme = useTheme(); +// const matchDownXs = useMediaQuery(theme.breakpoints.down('sm')); +// +// const blockSX = { +// p: 2.5, +// borderLeft: '1px solid ', +// borderBottom: '1px solid ', +// borderLeftColor: theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[200], +// borderBottomColor: theme.palette.mode === 'dark' ? theme.palette.dark.main : theme.palette.grey[200] +// }; +// +// return ( +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// 1000 +// +// +// SHARES +// +// +// +// +// +// +// +// +// +// +// +// 600 +// +// +// NETWORK +// +// +// +// +// +// +// +// +// +// +// +// +// +// 3550 +// +// +// RETURNS +// +// +// +// +// +// +// +// +// +// +// +// 100% +// +// +// ORDER +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// ); +// }; +// +// export default Analytics; diff --git a/src/views/dashboard/Default/index.js b/src/views/dashboard/Default/index.js index a62026d..bf6c9c1 100755 --- a/src/views/dashboard/Default/index.js +++ b/src/views/dashboard/Default/index.js @@ -1,59 +1,59 @@ -import { useEffect, useState } from 'react'; - -// material-ui -import { Grid } from '@mui/material'; - -// project imports -import EarningCard from './EarningCard'; -import PopularCard from './PopularCard'; -import TotalOrderLineChartCard from './TotalOrderLineChartCard'; -import TotalIncomeDarkCard from './TotalIncomeDarkCard'; -import TotalIncomeLightCard from './TotalIncomeLightCard'; -import TotalGrowthBarChart from './TotalGrowthBarChart'; -import { gridSpacing } from 'store/constant'; - -// ==============================|| DEFAULT DASHBOARD ||============================== // - -const Dashboard = () => { - const [isLoading, setLoading] = useState(true); - useEffect(() => { - setLoading(false); - }, []); - - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -export default Dashboard; +// import { useEffect, useState } from 'react'; +// +// // material-ui +// import { Grid } from '@mui/material'; +// +// // project imports +// import EarningCard from './EarningCard'; +// import PopularCard from './PopularCard'; +// import TotalOrderLineChartCard from './TotalOrderLineChartCard'; +// import TotalIncomeDarkCard from './TotalIncomeDarkCard'; +// import TotalIncomeLightCard from './TotalIncomeLightCard'; +// import TotalGrowthBarChart from './TotalGrowthBarChart'; +// import { gridSpacing } from 'store/constant'; +// +// // ==============================|| DEFAULT DASHBOARD ||============================== // +// +// const Dashboard = () => { +// const [isLoading, setLoading] = useState(true); +// useEffect(() => { +// setLoading(false); +// }, []); +// +// return ( +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// ); +// }; +// +// export default Dashboard;