diff --git a/webui/public/images/auth.jpg b/webui/public/images/auth.jpg deleted file mode 100644 index 6228b3b..0000000 Binary files a/webui/public/images/auth.jpg and /dev/null differ diff --git a/webui/public/images/avatars/avatar_1.png b/webui/public/images/avatars/avatar_1.png deleted file mode 100644 index c80c89c..0000000 Binary files a/webui/public/images/avatars/avatar_1.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_10.png b/webui/public/images/avatars/avatar_10.png deleted file mode 100644 index c6be181..0000000 Binary files a/webui/public/images/avatars/avatar_10.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_11.png b/webui/public/images/avatars/avatar_11.png deleted file mode 100644 index 9d46560..0000000 Binary files a/webui/public/images/avatars/avatar_11.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_2.png b/webui/public/images/avatars/avatar_2.png deleted file mode 100644 index 4edae21..0000000 Binary files a/webui/public/images/avatars/avatar_2.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_3.png b/webui/public/images/avatars/avatar_3.png deleted file mode 100644 index 72a678d..0000000 Binary files a/webui/public/images/avatars/avatar_3.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_4.png b/webui/public/images/avatars/avatar_4.png deleted file mode 100644 index cca2f61..0000000 Binary files a/webui/public/images/avatars/avatar_4.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_5.png b/webui/public/images/avatars/avatar_5.png deleted file mode 100644 index 4eedc23..0000000 Binary files a/webui/public/images/avatars/avatar_5.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_6.png b/webui/public/images/avatars/avatar_6.png deleted file mode 100644 index 67ebc46..0000000 Binary files a/webui/public/images/avatars/avatar_6.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_7.png b/webui/public/images/avatars/avatar_7.png deleted file mode 100644 index b20692b..0000000 Binary files a/webui/public/images/avatars/avatar_7.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_8.png b/webui/public/images/avatars/avatar_8.png deleted file mode 100644 index b9cd86e..0000000 Binary files a/webui/public/images/avatars/avatar_8.png and /dev/null differ diff --git a/webui/public/images/avatars/avatar_9.png b/webui/public/images/avatars/avatar_9.png deleted file mode 100644 index a1d00ff..0000000 Binary files a/webui/public/images/avatars/avatar_9.png and /dev/null differ diff --git a/webui/public/images/logos/logo--white.svg b/webui/public/images/logos/logo--white.svg deleted file mode 100755 index 1ab550f..0000000 --- a/webui/public/images/logos/logo--white.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/webui/public/images/not_found.png b/webui/public/images/not_found.png deleted file mode 100644 index a7160e8..0000000 Binary files a/webui/public/images/not_found.png and /dev/null differ diff --git a/webui/public/images/products/product_1.png b/webui/public/images/products/product_1.png deleted file mode 100644 index 27b5031..0000000 Binary files a/webui/public/images/products/product_1.png and /dev/null differ diff --git a/webui/public/images/products/product_2.png b/webui/public/images/products/product_2.png deleted file mode 100644 index b4b103b..0000000 Binary files a/webui/public/images/products/product_2.png and /dev/null differ diff --git a/webui/public/images/products/product_3.png b/webui/public/images/products/product_3.png deleted file mode 100644 index 5bfd2d9..0000000 Binary files a/webui/public/images/products/product_3.png and /dev/null differ diff --git a/webui/public/images/products/product_4.png b/webui/public/images/products/product_4.png deleted file mode 100644 index 142ec74..0000000 Binary files a/webui/public/images/products/product_4.png and /dev/null differ diff --git a/webui/public/images/products/product_5.png b/webui/public/images/products/product_5.png deleted file mode 100644 index cf13db0..0000000 Binary files a/webui/public/images/products/product_5.png and /dev/null differ diff --git a/webui/public/images/products/product_6.png b/webui/public/images/products/product_6.png deleted file mode 100644 index bd98092..0000000 Binary files a/webui/public/images/products/product_6.png and /dev/null differ diff --git a/webui/public/images/undraw_page_not_found_su7k.svg b/webui/public/images/undraw_page_not_found_su7k.svg deleted file mode 100644 index 9628680..0000000 --- a/webui/public/images/undraw_page_not_found_su7k.svg +++ /dev/null @@ -1 +0,0 @@ -page not found \ No newline at end of file diff --git a/webui/public/images/undraw_resume_folder_2_arse.svg b/webui/public/images/undraw_resume_folder_2_arse.svg deleted file mode 100644 index 389af57..0000000 --- a/webui/public/images/undraw_resume_folder_2_arse.svg +++ /dev/null @@ -1 +0,0 @@ -resume folder_2 \ No newline at end of file diff --git a/webui/src/App.js b/webui/src/App.jsx similarity index 77% rename from webui/src/App.js rename to webui/src/App.jsx index e9849d1..a2b426c 100644 --- a/webui/src/App.js +++ b/webui/src/App.jsx @@ -3,13 +3,10 @@ import { Router } from 'react-router-dom'; import { createBrowserHistory } from 'history'; import { Chart } from 'react-chartjs-2'; import { ThemeProvider } from '@material-ui/styles'; -import validate from 'validate.js'; import { chartjs } from './helpers'; import theme from './theme'; -import 'react-perfect-scrollbar/dist/css/styles.css'; import './assets/scss/index.scss'; -import validators from './common/validators'; import Routes from './Routes'; const browserHistory = createBrowserHistory(); @@ -18,10 +15,6 @@ Chart.helpers.extend(Chart.elements.Rectangle.prototype, { draw: chartjs.draw }); -validate.validators = { - ...validate.validators, - ...validators -}; export default class App extends Component { render() { diff --git a/webui/src/Routes.js b/webui/src/Routes.js deleted file mode 100644 index 5f723f4..0000000 --- a/webui/src/Routes.js +++ /dev/null @@ -1,93 +0,0 @@ -import React from 'react'; -import { Switch, Redirect } from 'react-router-dom'; - -import { RouteWithLayout } from './components'; -import { Main as MainLayout, Minimal as MinimalLayout } from './layouts'; - -import { - Dashboard as DashboardView, - ProductList as ProductListView, - UserList as UserListView, - Typography as TypographyView, - Icons as IconsView, - Account as AccountView, - Settings as SettingsView, - SignUp as SignUpView, - SignIn as SignInView, - NotFound as NotFoundView -} from './views'; - -const Routes = () => { - return ( - - - - - - - - - - - - - - - ); -}; - -export default Routes; diff --git a/webui/src/Routes.jsx b/webui/src/Routes.jsx new file mode 100644 index 0000000..59ace6a --- /dev/null +++ b/webui/src/Routes.jsx @@ -0,0 +1,38 @@ +import React from 'react'; +import {Switch, Redirect} from 'react-router-dom'; + +import {RouteWithLayout} from './components'; +import {Main as MainLayout, Minimal as MinimalLayout} from './layouts'; + +import { + Dashboard as DashboardView, + SignIn as SignInView, + NotFound as NotFoundView +} from './views'; + +function loggedIn() { + return false +} + +function requireAuth(nextState, replace) { + console.log("holaa") + if (!loggedIn()) { + replace({ + pathname: '/signin' + }) + } +} + +const Routes = () => { + return ( + + + + + + + + ); +}; + +export default Routes; diff --git a/webui/src/common/validators.js b/webui/src/common/validators.js deleted file mode 100644 index 128841b..0000000 --- a/webui/src/common/validators.js +++ /dev/null @@ -1,9 +0,0 @@ -const checked = (value, options) => { - if (value !== true) { - return options.message || 'must be checked'; - } -}; - -export default { - checked -}; diff --git a/webui/src/components/RouteWithLayout/RouteWithLayout.js b/webui/src/components/RouteWithLayout/RouteWithLayout.jsx similarity index 89% rename from webui/src/components/RouteWithLayout/RouteWithLayout.js rename to webui/src/components/RouteWithLayout/RouteWithLayout.jsx index ea4f369..7a488e9 100644 --- a/webui/src/components/RouteWithLayout/RouteWithLayout.js +++ b/webui/src/components/RouteWithLayout/RouteWithLayout.jsx @@ -6,9 +6,7 @@ const RouteWithLayout = props => { const { layout: Layout, component: Component, ...rest } = props; return ( - ( + ( diff --git a/webui/src/components/RouteWithLayout/index.js b/webui/src/components/RouteWithLayout/index.jsx similarity index 100% rename from webui/src/components/RouteWithLayout/index.js rename to webui/src/components/RouteWithLayout/index.jsx diff --git a/webui/src/components/SearchInput/SearchInput.js b/webui/src/components/SearchInput/SearchInput.js deleted file mode 100644 index bc16cdd..0000000 --- a/webui/src/components/SearchInput/SearchInput.js +++ /dev/null @@ -1,56 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import clsx from 'clsx'; -import { makeStyles } from '@material-ui/styles'; -import { Paper, Input } from '@material-ui/core'; -import SearchIcon from '@material-ui/icons/Search'; - -const useStyles = makeStyles(theme => ({ - root: { - borderRadius: '4px', - alignItems: 'center', - padding: theme.spacing(1), - display: 'flex', - flexBasis: 420 - }, - icon: { - marginRight: theme.spacing(1), - color: theme.palette.text.secondary - }, - input: { - flexGrow: 1, - fontSize: '14px', - lineHeight: '16px', - letterSpacing: '-0.05px' - } -})); - -const SearchInput = props => { - const { className, onChange, style, ...rest } = props; - - const classes = useStyles(); - - return ( - - - - - ); -}; - -SearchInput.propTypes = { - className: PropTypes.string, - onChange: PropTypes.func, - style: PropTypes.object -}; - -export default SearchInput; diff --git a/webui/src/components/SearchInput/index.js b/webui/src/components/SearchInput/index.js deleted file mode 100644 index 7e9c713..0000000 --- a/webui/src/components/SearchInput/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './SearchInput'; diff --git a/webui/src/components/StatusBullet/StatusBullet.js b/webui/src/components/StatusBullet/StatusBullet.jsx similarity index 100% rename from webui/src/components/StatusBullet/StatusBullet.js rename to webui/src/components/StatusBullet/StatusBullet.jsx diff --git a/webui/src/components/StatusBullet/index.js b/webui/src/components/StatusBullet/index.jsx similarity index 100% rename from webui/src/components/StatusBullet/index.js rename to webui/src/components/StatusBullet/index.jsx diff --git a/webui/src/components/index.js b/webui/src/components/index.jsx similarity index 68% rename from webui/src/components/index.js rename to webui/src/components/index.jsx index ccb77f4..029a17b 100644 --- a/webui/src/components/index.js +++ b/webui/src/components/index.jsx @@ -1,3 +1,2 @@ -export { default as SearchInput } from './SearchInput'; export { default as StatusBullet } from './StatusBullet'; export { default as RouteWithLayout } from './RouteWithLayout'; diff --git a/webui/src/helpers/chartjs.js b/webui/src/helpers/chartjs.js deleted file mode 100644 index 55e5a64..0000000 --- a/webui/src/helpers/chartjs.js +++ /dev/null @@ -1,192 +0,0 @@ -// ChartJS extension rounded bar chart -// https://codepen.io/jedtrow/full/ygRYgo -function draw() { - const { ctx } = this._chart; - const vm = this._view; - let { borderWidth } = vm; - - let left; - let right; - let top; - let bottom; - let signX; - let signY; - let borderSkipped; - let radius; - - // If radius is less than 0 or is large enough to cause drawing errors a max - // radius is imposed. If cornerRadius is not defined set it to 0. - let { cornerRadius } = this._chart.config.options; - if (cornerRadius < 0) { - cornerRadius = 0; - } - - if (typeof cornerRadius === 'undefined') { - cornerRadius = 0; - } - - if (!vm.horizontal) { - // bar - left = vm.x - vm.width / 2; - right = vm.x + vm.width / 2; - top = vm.y; - bottom = vm.base; - signX = 1; - signY = bottom > top ? 1 : -1; - borderSkipped = vm.borderSkipped || 'bottom'; - } else { - // horizontal bar - left = vm.base; - right = vm.x; - top = vm.y - vm.height / 2; - bottom = vm.y + vm.height / 2; - signX = right > left ? 1 : -1; - signY = 1; - borderSkipped = vm.borderSkipped || 'left'; - } - - // Canvas doesn't allow us to stroke inside the width so we can - // adjust the sizes to fit if we're setting a stroke on the line - if (borderWidth) { - // borderWidth shold be less than bar width and bar height. - const barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom)); - borderWidth = borderWidth > barSize ? barSize : borderWidth; - const halfStroke = borderWidth / 2; - // Adjust borderWidth when bar top position is near vm.base(zero). - const borderLeft = - left + (borderSkipped !== 'left' ? halfStroke * signX : 0); - const borderRight = - right + (borderSkipped !== 'right' ? -halfStroke * signX : 0); - const borderTop = top + (borderSkipped !== 'top' ? halfStroke * signY : 0); - const borderBottom = - bottom + (borderSkipped !== 'bottom' ? -halfStroke * signY : 0); - // not become a vertical line? - if (borderLeft !== borderRight) { - top = borderTop; - bottom = borderBottom; - } - // not become a horizontal line? - if (borderTop !== borderBottom) { - left = borderLeft; - right = borderRight; - } - } - - ctx.beginPath(); - ctx.fillStyle = vm.backgroundColor; - ctx.strokeStyle = vm.borderColor; - ctx.lineWidth = borderWidth; - - // Corner points, from bottom-left to bottom-right clockwise - // | 1 2 | - // | 0 3 | - const corners = [[left, bottom], [left, top], [right, top], [right, bottom]]; - - // Find first (starting) corner with fallback to 'bottom' - const borders = ['bottom', 'left', 'top', 'right']; - let startCorner = borders.indexOf(borderSkipped, 0); - if (startCorner === -1) { - startCorner = 0; - } - - function cornerAt(index) { - return corners[(startCorner + index) % 4]; - } - - // Draw rectangle from 'startCorner' - let corner = cornerAt(0); - ctx.moveTo(corner[0], corner[1]); - - for (let i = 1; i < 4; i += 1) { - corner = cornerAt(i); - let nextCornerId = i + 1; - if (nextCornerId === 4) { - nextCornerId = 0; - } - - const width = corners[2][0] - corners[1][0]; - const height = corners[0][1] - corners[1][1]; - const x = corners[1][0]; - const y = corners[1][1]; - - radius = cornerRadius; - // Fix radius being too large - if (radius > Math.abs(height) / 2) { - radius = Math.floor(Math.abs(height) / 2); - } - if (radius > Math.abs(width) / 2) { - radius = Math.floor(Math.abs(width) / 2); - } - - if (height < 0) { - // Negative values in a standard bar chart - const xTl = x; - const xTr = x + width; - const yTl = y + height; - const yTr = y + height; - - const xBl = x; - const xBr = x + width; - const yBl = y; - const yBr = y; - - // Draw - ctx.moveTo(xBl + radius, yBl); - ctx.lineTo(xBr - radius, yBr); - ctx.quadraticCurveTo(xBr, yBr, xBr, yBr - radius); - ctx.lineTo(xTr, yTr + radius); - ctx.quadraticCurveTo(xTr, yTr, xTr - radius, yTr); - ctx.lineTo(xTl + radius, yTl); - ctx.quadraticCurveTo(xTl, yTl, xTl, yTl + radius); - ctx.lineTo(xBl, yBl - radius); - ctx.quadraticCurveTo(xBl, yBl, xBl + radius, yBl); - } else if (width < 0) { - // Negative values in a horizontal bar chart - const xTl = x + width; - const xTr = x; - const yTl = y; - const yTr = y; - - const xBl = x + width; - const xBr = x; - const yBl = y + height; - const yBr = y + height; - - // Draw - ctx.moveTo(xBl + radius, yBl); - ctx.lineTo(xBr - radius, yBr); - ctx.quadraticCurveTo(xBr, yBr, xBr, yBr - radius); - ctx.lineTo(xTr, yTr + radius); - ctx.quadraticCurveTo(xTr, yTr, xTr - radius, yTr); - ctx.lineTo(xTl + radius, yTl); - ctx.quadraticCurveTo(xTl, yTl, xTl, yTl + radius); - ctx.lineTo(xBl, yBl - radius); - ctx.quadraticCurveTo(xBl, yBl, xBl + radius, yBl); - } else { - // Positive Value - ctx.moveTo(x + radius, y); - ctx.lineTo(x + width - radius, y); - ctx.quadraticCurveTo(x + width, y, x + width, y + radius); - ctx.lineTo(x + width, y + height - radius); - ctx.quadraticCurveTo( - x + width, - y + height, - x + width - radius, - y + height - ); - ctx.lineTo(x + radius, y + height); - ctx.quadraticCurveTo(x, y + height, x, y + height - radius); - ctx.lineTo(x, y + radius); - ctx.quadraticCurveTo(x, y, x + radius, y); - } - } - - ctx.fill(); - if (borderWidth) { - ctx.stroke(); - } -} - -export default { - draw -}; diff --git a/webui/src/helpers/chartjs.jsx b/webui/src/helpers/chartjs.jsx new file mode 100644 index 0000000..5938768 --- /dev/null +++ b/webui/src/helpers/chartjs.jsx @@ -0,0 +1,192 @@ +// ChartJS extension rounded bar chart +// https://codepen.io/jedtrow/full/ygRYgo +function draw() { + const {ctx} = this._chart; + const vm = this._view; + let {borderWidth} = vm; + + let left; + let right; + let top; + let bottom; + let signX; + let signY; + let borderSkipped; + let radius; + + // If radius is less than 0 or is large enough to cause drawing errors a max + // radius is imposed. If cornerRadius is not defined set it to 0. + let {cornerRadius} = this._chart.config.options; + if (cornerRadius < 0) { + cornerRadius = 0; + } + + if (typeof cornerRadius === 'undefined') { + cornerRadius = 0; + } + + if (!vm.horizontal) { + // bar + left = vm.x - vm.width / 2; + right = vm.x + vm.width / 2; + top = vm.y; + bottom = vm.base; + signX = 1; + signY = bottom > top ? 1 : -1; + borderSkipped = vm.borderSkipped || 'bottom'; + } else { + // horizontal bar + left = vm.base; + right = vm.x; + top = vm.y - vm.height / 2; + bottom = vm.y + vm.height / 2; + signX = right > left ? 1 : -1; + signY = 1; + borderSkipped = vm.borderSkipped || 'left'; + } + + // Canvas doesn't allow us to stroke inside the width so we can + // adjust the sizes to fit if we're setting a stroke on the line + if (borderWidth) { + // borderWidth shold be less than bar width and bar height. + const barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom)); + borderWidth = borderWidth > barSize ? barSize : borderWidth; + const halfStroke = borderWidth / 2; + // Adjust borderWidth when bar top position is near vm.base(zero). + const borderLeft = + left + (borderSkipped !== 'left' ? halfStroke * signX : 0); + const borderRight = + right + (borderSkipped !== 'right' ? -halfStroke * signX : 0); + const borderTop = top + (borderSkipped !== 'top' ? halfStroke * signY : 0); + const borderBottom = + bottom + (borderSkipped !== 'bottom' ? -halfStroke * signY : 0); + // not become a vertical line? + if (borderLeft !== borderRight) { + top = borderTop; + bottom = borderBottom; + } + // not become a horizontal line? + if (borderTop !== borderBottom) { + left = borderLeft; + right = borderRight; + } + } + + ctx.beginPath(); + ctx.fillStyle = vm.backgroundColor; + ctx.strokeStyle = vm.borderColor; + ctx.lineWidth = borderWidth; + + // Corner points, from bottom-left to bottom-right clockwise + // | 1 2 | + // | 0 3 | + const corners = [[left, bottom], [left, top], [right, top], [right, bottom]]; + + // Find first (starting) corner with fallback to 'bottom' + const borders = ['bottom', 'left', 'top', 'right']; + let startCorner = borders.indexOf(borderSkipped, 0); + if (startCorner === -1) { + startCorner = 0; + } + + function cornerAt(index) { + return corners[(startCorner + index) % 4]; + } + + // Draw rectangle from 'startCorner' + let corner = cornerAt(0); + ctx.moveTo(corner[0], corner[1]); + + for (let i = 1; i < 4; i += 1) { + corner = cornerAt(i); + let nextCornerId = i + 1; + if (nextCornerId === 4) { + nextCornerId = 0; + } + + const width = corners[2][0] - corners[1][0]; + const height = corners[0][1] - corners[1][1]; + const x = corners[1][0]; + const y = corners[1][1]; + + radius = cornerRadius; + // Fix radius being too large + if (radius > Math.abs(height) / 2) { + radius = Math.floor(Math.abs(height) / 2); + } + if (radius > Math.abs(width) / 2) { + radius = Math.floor(Math.abs(width) / 2); + } + + if (height < 0) { + // Negative values in a standard bar chart + const xTl = x; + const xTr = x + width; + const yTl = y + height; + const yTr = y + height; + + const xBl = x; + const xBr = x + width; + const yBl = y; + const yBr = y; + + // Draw + ctx.moveTo(xBl + radius, yBl); + ctx.lineTo(xBr - radius, yBr); + ctx.quadraticCurveTo(xBr, yBr, xBr, yBr - radius); + ctx.lineTo(xTr, yTr + radius); + ctx.quadraticCurveTo(xTr, yTr, xTr - radius, yTr); + ctx.lineTo(xTl + radius, yTl); + ctx.quadraticCurveTo(xTl, yTl, xTl, yTl + radius); + ctx.lineTo(xBl, yBl - radius); + ctx.quadraticCurveTo(xBl, yBl, xBl + radius, yBl); + } else if (width < 0) { + // Negative values in a horizontal bar chart + const xTl = x + width; + const xTr = x; + const yTl = y; + const yTr = y; + + const xBl = x + width; + const xBr = x; + const yBl = y + height; + const yBr = y + height; + + // Draw + ctx.moveTo(xBl + radius, yBl); + ctx.lineTo(xBr - radius, yBr); + ctx.quadraticCurveTo(xBr, yBr, xBr, yBr - radius); + ctx.lineTo(xTr, yTr + radius); + ctx.quadraticCurveTo(xTr, yTr, xTr - radius, yTr); + ctx.lineTo(xTl + radius, yTl); + ctx.quadraticCurveTo(xTl, yTl, xTl, yTl + radius); + ctx.lineTo(xBl, yBl - radius); + ctx.quadraticCurveTo(xBl, yBl, xBl + radius, yBl); + } else { + // Positive Value + ctx.moveTo(x + radius, y); + ctx.lineTo(x + width - radius, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + radius); + ctx.lineTo(x + width, y + height - radius); + ctx.quadraticCurveTo( + x + width, + y + height, + x + width - radius, + y + height + ); + ctx.lineTo(x + radius, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - radius); + ctx.lineTo(x, y + radius); + ctx.quadraticCurveTo(x, y, x + radius, y); + } + } + + ctx.fill(); + if (borderWidth) { + ctx.stroke(); + } +} + +export default { + draw +}; diff --git a/webui/src/helpers/getInitials.js b/webui/src/helpers/getInitials.js deleted file mode 100644 index beba787..0000000 --- a/webui/src/helpers/getInitials.js +++ /dev/null @@ -1,7 +0,0 @@ -export default (name = '') => - name - .replace(/\s+/, ' ') - .split(' ') - .slice(0, 2) - .map(v => v && v[0].toUpperCase()) - .join(''); diff --git a/webui/src/helpers/index.js b/webui/src/helpers/index.js deleted file mode 100644 index f28708c..0000000 --- a/webui/src/helpers/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as chartjs } from './chartjs'; -export { default as getInitials } from './getInitials'; diff --git a/webui/src/helpers/index.jsx b/webui/src/helpers/index.jsx new file mode 100644 index 0000000..720bf08 --- /dev/null +++ b/webui/src/helpers/index.jsx @@ -0,0 +1 @@ +export {default as chartjs} from './chartjs'; diff --git a/webui/src/icons/Facebook/index.js b/webui/src/icons/Facebook/index.js deleted file mode 100644 index d28f39c..0000000 --- a/webui/src/icons/Facebook/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -// Material components -import { SvgIcon } from '@material-ui/core'; - -export default function Facebook(props) { - return ( - - - - ); -} diff --git a/webui/src/icons/Google/index.js b/webui/src/icons/Google/index.js deleted file mode 100644 index 6ada903..0000000 --- a/webui/src/icons/Google/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -// Material components -import { SvgIcon } from '@material-ui/core'; - -export default function Google(props) { - return ( - - - - ); -} diff --git a/webui/src/icons/index.js b/webui/src/icons/index.js deleted file mode 100644 index 9442fd1..0000000 --- a/webui/src/icons/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Facebook } from './Facebook'; -export { default as Google } from './Google'; diff --git a/webui/src/index.js b/webui/src/index.jsx similarity index 100% rename from webui/src/index.js rename to webui/src/index.jsx diff --git a/webui/src/layouts/Main/Main.js b/webui/src/layouts/Main/Main.js deleted file mode 100644 index 6d41314..0000000 --- a/webui/src/layouts/Main/Main.js +++ /dev/null @@ -1,71 +0,0 @@ -import React, { useState } from 'react'; -import PropTypes from 'prop-types'; -import clsx from 'clsx'; -import { makeStyles, useTheme } from '@material-ui/styles'; -import { useMediaQuery } from '@material-ui/core'; - -import { Sidebar, Topbar, Footer } from './components'; - -const useStyles = makeStyles(theme => ({ - root: { - paddingTop: 56, - height: '100%', - [theme.breakpoints.up('sm')]: { - paddingTop: 64 - } - }, - shiftContent: { - paddingLeft: 240 - }, - content: { - height: '100%' - } -})); - -const Main = props => { - const { children } = props; - - const classes = useStyles(); - const theme = useTheme(); - const isDesktop = useMediaQuery(theme.breakpoints.up('lg'), { - defaultMatches: true - }); - - const [openSidebar, setOpenSidebar] = useState(false); - - const handleSidebarOpen = () => { - setOpenSidebar(true); - }; - - const handleSidebarClose = () => { - setOpenSidebar(false); - }; - - const shouldOpenSidebar = isDesktop ? true : openSidebar; - - return ( -
- - -
- {children} -
-
-
- ); -}; - -Main.propTypes = { - children: PropTypes.node -}; - -export default Main; diff --git a/webui/src/layouts/Main/Main.jsx b/webui/src/layouts/Main/Main.jsx new file mode 100644 index 0000000..8717d2a --- /dev/null +++ b/webui/src/layouts/Main/Main.jsx @@ -0,0 +1,71 @@ +import React, {useState} from 'react'; +import PropTypes from 'prop-types'; +import clsx from 'clsx'; +import {makeStyles, useTheme} from '@material-ui/styles'; +import {useMediaQuery} from '@material-ui/core'; + +import {Sidebar, Topbar, Footer} from './components'; + +const useStyles = makeStyles(theme => ({ + root: { + paddingTop: 56, + height: '100%', + [theme.breakpoints.up('sm')]: { + paddingTop: 64 + } + }, + shiftContent: { + paddingLeft: 240 + }, + content: { + height: '100%' + } +})); + +const Main = props => { + const {children} = props; + + const classes = useStyles(); + const theme = useTheme(); + const isDesktop = useMediaQuery(theme.breakpoints.up('lg'), { + defaultMatches: true + }); + + const [openSidebar, setOpenSidebar] = useState(false); + + const handleSidebarOpen = () => { + setOpenSidebar(true); + }; + + const handleSidebarClose = () => { + setOpenSidebar(false); + }; + + const shouldOpenSidebar = isDesktop ? true : openSidebar; + + return ( +
+ + +
+ {children} +
+
+
+ ); +}; + +Main.propTypes = { + children: PropTypes.node +}; + +export default Main; diff --git a/webui/src/layouts/Main/components/Footer/Footer.js b/webui/src/layouts/Main/components/Footer/Footer.js deleted file mode 100644 index e872edc..0000000 --- a/webui/src/layouts/Main/components/Footer/Footer.js +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import clsx from 'clsx'; -import { makeStyles } from '@material-ui/styles'; -import { Typography, Link } from '@material-ui/core'; - -const useStyles = makeStyles(theme => ({ - root: { - padding: theme.spacing(4) - } -})); - -const Footer = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - return ( -
- - ©{' '} - - Devias IO - - . 2019 - - - Created with love for the environment. By designers and developers who - love to work together in offices! - -
- ); -}; - -Footer.propTypes = { - className: PropTypes.string -}; - -export default Footer; diff --git a/webui/src/layouts/Main/components/Footer/Footer.jsx b/webui/src/layouts/Main/components/Footer/Footer.jsx new file mode 100644 index 0000000..faed4a8 --- /dev/null +++ b/webui/src/layouts/Main/components/Footer/Footer.jsx @@ -0,0 +1,42 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import clsx from 'clsx'; +import {makeStyles} from '@material-ui/styles'; +import {Typography, Link} from '@material-ui/core'; + +const useStyles = makeStyles(theme => ({ + root: { + padding: theme.spacing(4) + } +})); + +const Footer = props => { + const {className, ...rest} = props; + + const classes = useStyles(); + + return ( +
+ + ©{' '} + + Devias IO + + . 2019 + +
+ ); +}; + +Footer.propTypes = { + className: PropTypes.string +}; + +export default Footer; diff --git a/webui/src/layouts/Main/components/Footer/index.js b/webui/src/layouts/Main/components/Footer/index.js deleted file mode 100644 index be92134..0000000 --- a/webui/src/layouts/Main/components/Footer/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Footer'; diff --git a/webui/src/layouts/Main/components/Footer/index.jsx b/webui/src/layouts/Main/components/Footer/index.jsx new file mode 100644 index 0000000..52f9f96 --- /dev/null +++ b/webui/src/layouts/Main/components/Footer/index.jsx @@ -0,0 +1 @@ +export {default} from './Footer'; diff --git a/webui/src/layouts/Main/components/Sidebar/Sidebar.js b/webui/src/layouts/Main/components/Sidebar/Sidebar.js deleted file mode 100644 index c2394b5..0000000 --- a/webui/src/layouts/Main/components/Sidebar/Sidebar.js +++ /dev/null @@ -1,119 +0,0 @@ -import React from 'react'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { Divider, Drawer } from '@material-ui/core'; -import DashboardIcon from '@material-ui/icons/Dashboard'; -import PeopleIcon from '@material-ui/icons/People'; -import ShoppingBasketIcon from '@material-ui/icons/ShoppingBasket'; -import TextFieldsIcon from '@material-ui/icons/TextFields'; -import ImageIcon from '@material-ui/icons/Image'; -import AccountBoxIcon from '@material-ui/icons/AccountBox'; -import SettingsIcon from '@material-ui/icons/Settings'; -import LockOpenIcon from '@material-ui/icons/LockOpen'; - -import { Profile, SidebarNav, UpgradePlan } from './components'; - -const useStyles = makeStyles(theme => ({ - drawer: { - width: 240, - [theme.breakpoints.up('lg')]: { - marginTop: 64, - height: 'calc(100% - 64px)' - } - }, - root: { - backgroundColor: theme.palette.white, - display: 'flex', - flexDirection: 'column', - height: '100%', - padding: theme.spacing(2) - }, - divider: { - margin: theme.spacing(2, 0) - }, - nav: { - marginBottom: theme.spacing(2) - } -})); - -const Sidebar = props => { - const { open, variant, onClose, className, ...rest } = props; - - const classes = useStyles(); - - const pages = [ - { - title: 'Dashboard', - href: '/dashboard', - icon: - }, - { - title: 'Users', - href: '/users', - icon: - }, - { - title: 'Products', - href: '/products', - icon: - }, - { - title: 'Authentication', - href: '/sign-in', - icon: - }, - { - title: 'Typography', - href: '/typography', - icon: - }, - { - title: 'Icons', - href: '/icons', - icon: - }, - { - title: 'Account', - href: '/account', - icon: - }, - { - title: 'Settings', - href: '/settings', - icon: - } - ]; - - return ( - -
- - - - -
-
- ); -}; - -Sidebar.propTypes = { - className: PropTypes.string, - onClose: PropTypes.func, - open: PropTypes.bool.isRequired, - variant: PropTypes.string.isRequired -}; - -export default Sidebar; diff --git a/webui/src/layouts/Main/components/Sidebar/Sidebar.jsx b/webui/src/layouts/Main/components/Sidebar/Sidebar.jsx new file mode 100644 index 0000000..da55cc1 --- /dev/null +++ b/webui/src/layouts/Main/components/Sidebar/Sidebar.jsx @@ -0,0 +1,68 @@ +import React from 'react'; +import clsx from 'clsx'; +import PropTypes from 'prop-types'; +import {makeStyles} from '@material-ui/styles'; +import {Drawer} from '@material-ui/core'; +import DashboardIcon from '@material-ui/icons/Dashboard'; + +import {SidebarNav} from './components'; + +const useStyles = makeStyles(theme => ({ + drawer: { + width: 240, + [theme.breakpoints.up('lg')]: { + marginTop: 64, + height: 'calc(100% - 64px)' + } + }, + root: { + backgroundColor: theme.palette.white, + display: 'flex', + flexDirection: 'column', + height: '100%', + padding: theme.spacing(2) + }, + nav: { + marginBottom: theme.spacing(2) + } +})); + +const Sidebar = props => { + const {open, variant, onClose, className, ...rest} = props; + + const classes = useStyles(); + + const pages = [ + { + title: 'Dashboard', + href: '/dashboard', + icon: + } + ]; + + return ( + +
+ +
+
+ ); +}; + +Sidebar.propTypes = { + className: PropTypes.string, + onClose: PropTypes.func, + open: PropTypes.bool.isRequired, + variant: PropTypes.string.isRequired +}; + +export default Sidebar; diff --git a/webui/src/layouts/Main/components/Sidebar/components/Profile/Profile.js b/webui/src/layouts/Main/components/Sidebar/components/Profile/Profile.js deleted file mode 100644 index c1de16e..0000000 --- a/webui/src/layouts/Main/components/Sidebar/components/Profile/Profile.js +++ /dev/null @@ -1,62 +0,0 @@ -import React from 'react'; -import { Link as RouterLink } from 'react-router-dom'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { Avatar, Typography } from '@material-ui/core'; - -const useStyles = makeStyles(theme => ({ - root: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - minHeight: 'fit-content' - }, - avatar: { - width: 60, - height: 60 - }, - name: { - marginTop: theme.spacing(1) - } -})); - -const Profile = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - const user = { - name: 'Shen Zhi', - avatar: '/images/avatars/avatar_11.png', - bio: 'Brain Director' - }; - - return ( -
- - - {user.name} - - {user.bio} -
- ); -}; - -Profile.propTypes = { - className: PropTypes.string -}; - -export default Profile; diff --git a/webui/src/layouts/Main/components/Sidebar/components/Profile/index.js b/webui/src/layouts/Main/components/Sidebar/components/Profile/index.js deleted file mode 100644 index 23358a2..0000000 --- a/webui/src/layouts/Main/components/Sidebar/components/Profile/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Profile'; diff --git a/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/SidebarNav.js b/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/SidebarNav.js deleted file mode 100644 index e33703f..0000000 --- a/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/SidebarNav.js +++ /dev/null @@ -1,88 +0,0 @@ -/* eslint-disable react/no-multi-comp */ -/* eslint-disable react/display-name */ -import React, { forwardRef } from 'react'; -import { NavLink as RouterLink } from 'react-router-dom'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { List, ListItem, Button, colors } from '@material-ui/core'; - -const useStyles = makeStyles(theme => ({ - root: {}, - item: { - display: 'flex', - paddingTop: 0, - paddingBottom: 0 - }, - button: { - color: colors.blueGrey[800], - padding: '10px 8px', - justifyContent: 'flex-start', - textTransform: 'none', - letterSpacing: 0, - width: '100%', - fontWeight: theme.typography.fontWeightMedium - }, - icon: { - color: theme.palette.icon, - width: 24, - height: 24, - display: 'flex', - alignItems: 'center', - marginRight: theme.spacing(1) - }, - active: { - color: theme.palette.primary.main, - fontWeight: theme.typography.fontWeightMedium, - '& $icon': { - color: theme.palette.primary.main - } - } -})); - -const CustomRouterLink = forwardRef((props, ref) => ( -
- -
-)); - -const SidebarNav = props => { - const { pages, className, ...rest } = props; - - const classes = useStyles(); - - return ( - - {pages.map(page => ( - - - - ))} - - ); -}; - -SidebarNav.propTypes = { - className: PropTypes.string, - pages: PropTypes.array.isRequired -}; - -export default SidebarNav; diff --git a/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/SidebarNav.jsx b/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/SidebarNav.jsx new file mode 100644 index 0000000..d7ee5ec --- /dev/null +++ b/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/SidebarNav.jsx @@ -0,0 +1,88 @@ +/* eslint-disable react/no-multi-comp */ +/* eslint-disable react/display-name */ +import React, {forwardRef} from 'react'; +import {NavLink as RouterLink} from 'react-router-dom'; +import clsx from 'clsx'; +import PropTypes from 'prop-types'; +import {makeStyles} from '@material-ui/styles'; +import {List, ListItem, Button, colors} from '@material-ui/core'; + +const useStyles = makeStyles(theme => ({ + root: {}, + item: { + display: 'flex', + paddingTop: 0, + paddingBottom: 0 + }, + button: { + color: colors.blueGrey[800], + padding: '10px 8px', + justifyContent: 'flex-start', + textTransform: 'none', + letterSpacing: 0, + width: '100%', + fontWeight: theme.typography.fontWeightMedium + }, + icon: { + color: theme.palette.icon, + width: 24, + height: 24, + display: 'flex', + alignItems: 'center', + marginRight: theme.spacing(1) + }, + active: { + color: theme.palette.primary.main, + fontWeight: theme.typography.fontWeightMedium, + '& $icon': { + color: theme.palette.primary.main + } + } +})); + +const CustomRouterLink = forwardRef((props, ref) => ( +
+ +
+)); + +const SidebarNav = props => { + const {pages, className, ...rest} = props; + + const classes = useStyles(); + + return ( + + {pages.map(page => ( + + + + ))} + + ); +}; + +SidebarNav.propTypes = { + className: PropTypes.string, + pages: PropTypes.array.isRequired +}; + +export default SidebarNav; diff --git a/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/index.js b/webui/src/layouts/Main/components/Sidebar/components/SidebarNav/index.jsx similarity index 100% rename from webui/src/layouts/Main/components/Sidebar/components/SidebarNav/index.js rename to webui/src/layouts/Main/components/Sidebar/components/SidebarNav/index.jsx diff --git a/webui/src/layouts/Main/components/Sidebar/components/UpgradePlan/UpgradePlan.js b/webui/src/layouts/Main/components/Sidebar/components/UpgradePlan/UpgradePlan.js deleted file mode 100644 index b5c90ea..0000000 --- a/webui/src/layouts/Main/components/Sidebar/components/UpgradePlan/UpgradePlan.js +++ /dev/null @@ -1,79 +0,0 @@ -import React from 'react'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { Typography, Button, colors } from '@material-ui/core'; - -const useStyles = makeStyles(theme => ({ - root: { - backgroundColor: colors.grey[50] - }, - media: { - paddingTop: theme.spacing(2), - height: 80, - textAlign: 'center', - '& > img': { - height: '100%', - width: 'auto' - } - }, - content: { - padding: theme.spacing(1, 2) - }, - actions: { - padding: theme.spacing(1, 2), - display: 'flex', - justifyContent: 'center' - } -})); - -const UpgradePlan = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - return ( -
-
- Upgrade to PRO -
-
- - Upgrade to PRO - - - Upgrade to Devias Kit PRO and get even more components - -
-
- -
-
- ); -}; - -UpgradePlan.propTypes = { - className: PropTypes.string -}; - -export default UpgradePlan; diff --git a/webui/src/layouts/Main/components/Sidebar/components/UpgradePlan/index.js b/webui/src/layouts/Main/components/Sidebar/components/UpgradePlan/index.js deleted file mode 100644 index 91bd301..0000000 --- a/webui/src/layouts/Main/components/Sidebar/components/UpgradePlan/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './UpgradePlan'; diff --git a/webui/src/layouts/Main/components/Sidebar/components/index.js b/webui/src/layouts/Main/components/Sidebar/components/index.js deleted file mode 100644 index 679c17e..0000000 --- a/webui/src/layouts/Main/components/Sidebar/components/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as Profile } from './Profile'; -export { default as SidebarNav } from './SidebarNav'; -export { default as UpgradePlan } from './UpgradePlan'; diff --git a/webui/src/layouts/Main/components/Sidebar/components/index.jsx b/webui/src/layouts/Main/components/Sidebar/components/index.jsx new file mode 100644 index 0000000..3dcee7a --- /dev/null +++ b/webui/src/layouts/Main/components/Sidebar/components/index.jsx @@ -0,0 +1 @@ +export { default as SidebarNav } from './SidebarNav'; diff --git a/webui/src/layouts/Main/components/Sidebar/index.js b/webui/src/layouts/Main/components/Sidebar/index.jsx similarity index 100% rename from webui/src/layouts/Main/components/Sidebar/index.js rename to webui/src/layouts/Main/components/Sidebar/index.jsx diff --git a/webui/src/layouts/Main/components/Topbar/Topbar.js b/webui/src/layouts/Main/components/Topbar/Topbar.js deleted file mode 100644 index dff9168..0000000 --- a/webui/src/layouts/Main/components/Topbar/Topbar.js +++ /dev/null @@ -1,78 +0,0 @@ -import React, { useState } from 'react'; -import { Link as RouterLink } from 'react-router-dom'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { AppBar, Toolbar, Badge, Hidden, IconButton } from '@material-ui/core'; -import MenuIcon from '@material-ui/icons/Menu'; -import NotificationsIcon from '@material-ui/icons/NotificationsOutlined'; -import InputIcon from '@material-ui/icons/Input'; - -const useStyles = makeStyles(theme => ({ - root: { - boxShadow: 'none' - }, - flexGrow: { - flexGrow: 1 - }, - signOutButton: { - marginLeft: theme.spacing(1) - } -})); - -const Topbar = props => { - const { className, onSidebarOpen, ...rest } = props; - - const classes = useStyles(); - - const [notifications] = useState([]); - - return ( - - - - Logo - -
- - - - - - - - - - - - - - - - - - ); -}; - -Topbar.propTypes = { - className: PropTypes.string, - onSidebarOpen: PropTypes.func -}; - -export default Topbar; diff --git a/webui/src/layouts/Main/components/Topbar/Topbar.jsx b/webui/src/layouts/Main/components/Topbar/Topbar.jsx new file mode 100644 index 0000000..8d4ebf2 --- /dev/null +++ b/webui/src/layouts/Main/components/Topbar/Topbar.jsx @@ -0,0 +1,68 @@ +import React from 'react'; +import {Link as RouterLink} from 'react-router-dom'; +import clsx from 'clsx'; +import PropTypes from 'prop-types'; +import {makeStyles} from '@material-ui/styles'; +import {AppBar, Toolbar, Hidden, IconButton, Typography} from '@material-ui/core'; +import MenuIcon from '@material-ui/icons/Menu'; +import InputIcon from '@material-ui/icons/Input'; + +const useStyles = makeStyles(theme => ({ + root: { + boxShadow: 'none' + }, + flexGrow: { + flexGrow: 1 + }, + signOutButton: { + marginLeft: theme.spacing(1) + }, + logo: { + color: 'white' + } +})); + +const Topbar = props => { + const {className, onSidebarOpen, ...rest} = props; + + const classes = useStyles(); + + return ( + + + + + LiveGO + + +
+ + + + + + + + + + + + + ); +}; + +Topbar.propTypes = { + className: PropTypes.string, + onSidebarOpen: PropTypes.func +}; + +export default Topbar; diff --git a/webui/src/layouts/Main/components/Topbar/index.js b/webui/src/layouts/Main/components/Topbar/index.jsx similarity index 100% rename from webui/src/layouts/Main/components/Topbar/index.js rename to webui/src/layouts/Main/components/Topbar/index.jsx diff --git a/webui/src/layouts/Main/components/index.js b/webui/src/layouts/Main/components/index.js deleted file mode 100644 index 17441e4..0000000 --- a/webui/src/layouts/Main/components/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as Footer } from './Footer'; -export { default as Sidebar } from './Sidebar'; -export { default as Topbar } from './Topbar'; diff --git a/webui/src/layouts/Main/components/index.jsx b/webui/src/layouts/Main/components/index.jsx new file mode 100644 index 0000000..b1db755 --- /dev/null +++ b/webui/src/layouts/Main/components/index.jsx @@ -0,0 +1,3 @@ +export {default as Footer} from './Footer'; +export {default as Sidebar} from './Sidebar'; +export {default as Topbar} from './Topbar'; diff --git a/webui/src/layouts/Main/index.js b/webui/src/layouts/Main/index.js deleted file mode 100644 index 47dec62..0000000 --- a/webui/src/layouts/Main/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Main'; diff --git a/webui/src/layouts/Main/index.jsx b/webui/src/layouts/Main/index.jsx new file mode 100644 index 0000000..9015cb0 --- /dev/null +++ b/webui/src/layouts/Main/index.jsx @@ -0,0 +1 @@ +export {default} from './Main'; diff --git a/webui/src/layouts/Minimal/Minimal.js b/webui/src/layouts/Minimal/Minimal.jsx similarity index 100% rename from webui/src/layouts/Minimal/Minimal.js rename to webui/src/layouts/Minimal/Minimal.jsx diff --git a/webui/src/layouts/Minimal/components/Topbar/Topbar.js b/webui/src/layouts/Minimal/components/Topbar/Topbar.jsx similarity index 76% rename from webui/src/layouts/Minimal/components/Topbar/Topbar.js rename to webui/src/layouts/Minimal/components/Topbar/Topbar.jsx index 8757144..f348426 100644 --- a/webui/src/layouts/Minimal/components/Topbar/Topbar.js +++ b/webui/src/layouts/Minimal/components/Topbar/Topbar.jsx @@ -3,11 +3,14 @@ import { Link as RouterLink } from 'react-router-dom'; import clsx from 'clsx'; import PropTypes from 'prop-types'; import { makeStyles } from '@material-ui/styles'; -import { AppBar, Toolbar } from '@material-ui/core'; +import {AppBar, Toolbar, Typography} from '@material-ui/core'; const useStyles = makeStyles(() => ({ root: { boxShadow: 'none' + }, + logo: { + color: 'white' } })); @@ -25,10 +28,9 @@ const Topbar = props => { > - Logo + + LiveGO + diff --git a/webui/src/layouts/Minimal/components/Topbar/index.js b/webui/src/layouts/Minimal/components/Topbar/index.jsx similarity index 100% rename from webui/src/layouts/Minimal/components/Topbar/index.js rename to webui/src/layouts/Minimal/components/Topbar/index.jsx diff --git a/webui/src/layouts/Minimal/components/index.js b/webui/src/layouts/Minimal/components/index.jsx similarity index 100% rename from webui/src/layouts/Minimal/components/index.js rename to webui/src/layouts/Minimal/components/index.jsx diff --git a/webui/src/layouts/Minimal/index.js b/webui/src/layouts/Minimal/index.jsx similarity index 100% rename from webui/src/layouts/Minimal/index.js rename to webui/src/layouts/Minimal/index.jsx diff --git a/webui/src/layouts/index.js b/webui/src/layouts/index.jsx similarity index 100% rename from webui/src/layouts/index.js rename to webui/src/layouts/index.jsx diff --git a/webui/src/theme/index.js b/webui/src/theme/index.js deleted file mode 100644 index c359d09..0000000 --- a/webui/src/theme/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import { createMuiTheme } from '@material-ui/core'; - -import palette from './palette'; -import typography from './typography'; -import overrides from './overrides'; - -const theme = createMuiTheme({ - palette, - typography, - overrides, - zIndex: { - appBar: 1200, - drawer: 1100 - } -}); - -export default theme; diff --git a/webui/src/theme/index.jsx b/webui/src/theme/index.jsx new file mode 100644 index 0000000..5ba3c16 --- /dev/null +++ b/webui/src/theme/index.jsx @@ -0,0 +1,15 @@ +import {createMuiTheme} from '@material-ui/core'; + +import palette from './palette'; +import typography from './typography'; + +const theme = createMuiTheme({ + palette, + typography, + zIndex: { + appBar: 1200, + drawer: 1100 + } +}); + +export default theme; diff --git a/webui/src/theme/overrides/MuiButton.js b/webui/src/theme/overrides/MuiButton.js deleted file mode 100644 index 646f5a4..0000000 --- a/webui/src/theme/overrides/MuiButton.js +++ /dev/null @@ -1,7 +0,0 @@ -export default { - contained: { - boxShadow: - '0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20)', - backgroundColor: '#FFFFFF' - } -}; diff --git a/webui/src/theme/overrides/MuiIconButton.js b/webui/src/theme/overrides/MuiIconButton.js deleted file mode 100644 index 1c1b5e9..0000000 --- a/webui/src/theme/overrides/MuiIconButton.js +++ /dev/null @@ -1,10 +0,0 @@ -import palette from '../palette'; - -export default { - root: { - color: palette.icon, - '&:hover': { - backgroundColor: 'rgba(0, 0, 0, 0.03)' - } - } -}; diff --git a/webui/src/theme/overrides/MuiPaper.js b/webui/src/theme/overrides/MuiPaper.js deleted file mode 100644 index 654b2b0..0000000 --- a/webui/src/theme/overrides/MuiPaper.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - elevation1: { - boxShadow: '0 0 0 1px rgba(63,63,68,0.05), 0 1px 3px 0 rgba(63,63,68,0.15)' - } -}; diff --git a/webui/src/theme/overrides/MuiTableCell.js b/webui/src/theme/overrides/MuiTableCell.js deleted file mode 100644 index 89e36e3..0000000 --- a/webui/src/theme/overrides/MuiTableCell.js +++ /dev/null @@ -1,9 +0,0 @@ -import palette from '../palette'; -import typography from '../typography'; - -export default { - root: { - ...typography.body1, - borderBottom: `1px solid ${palette.divider}` - } -}; diff --git a/webui/src/theme/overrides/MuiTableHead.js b/webui/src/theme/overrides/MuiTableHead.js deleted file mode 100644 index bd5e5ab..0000000 --- a/webui/src/theme/overrides/MuiTableHead.js +++ /dev/null @@ -1,7 +0,0 @@ -import { colors } from '@material-ui/core'; - -export default { - root: { - backgroundColor: colors.grey[50] - } -}; diff --git a/webui/src/theme/overrides/MuiTableRow.js b/webui/src/theme/overrides/MuiTableRow.js deleted file mode 100644 index 02a7db2..0000000 --- a/webui/src/theme/overrides/MuiTableRow.js +++ /dev/null @@ -1,14 +0,0 @@ -import palette from '../palette'; - -export default { - root: { - '&$selected': { - backgroundColor: palette.background.default - }, - '&$hover': { - '&:hover': { - backgroundColor: palette.background.default - } - } - } -}; diff --git a/webui/src/theme/overrides/MuiTypography.js b/webui/src/theme/overrides/MuiTypography.js deleted file mode 100644 index a2e9a98..0000000 --- a/webui/src/theme/overrides/MuiTypography.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - gutterBottom: { - marginBottom: 8 - } -}; diff --git a/webui/src/theme/overrides/index.js b/webui/src/theme/overrides/index.js deleted file mode 100644 index 596e324..0000000 --- a/webui/src/theme/overrides/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import MuiButton from './MuiButton'; -import MuiIconButton from './MuiIconButton'; -import MuiPaper from './MuiPaper'; -import MuiTableCell from './MuiTableCell'; -import MuiTableHead from './MuiTableHead'; -import MuiTypography from './MuiTypography'; - -export default { - MuiButton, - MuiIconButton, - MuiPaper, - MuiTableCell, - MuiTableHead, - MuiTypography -}; diff --git a/webui/src/theme/palette.js b/webui/src/theme/palette.js deleted file mode 100644 index f703f4f..0000000 --- a/webui/src/theme/palette.js +++ /dev/null @@ -1,56 +0,0 @@ -import { colors } from '@material-ui/core'; - -const white = '#FFFFFF'; -const black = '#000000'; - -export default { - black, - white, - primary: { - contrastText: white, - dark: colors.indigo[900], - main: colors.indigo[500], - light: colors.indigo[100] - }, - secondary: { - contrastText: white, - dark: colors.blue[900], - main: colors.blue['A400'], - light: colors.blue['A400'] - }, - success: { - contrastText: white, - dark: colors.green[900], - main: colors.green[600], - light: colors.green[400] - }, - info: { - contrastText: white, - dark: colors.blue[900], - main: colors.blue[600], - light: colors.blue[400] - }, - warning: { - contrastText: white, - dark: colors.orange[900], - main: colors.orange[600], - light: colors.orange[400] - }, - error: { - contrastText: white, - dark: colors.red[900], - main: colors.red[600], - light: colors.red[400] - }, - text: { - primary: colors.blueGrey[900], - secondary: colors.blueGrey[600], - link: colors.blue[600] - }, - background: { - default: '#F4F6F8', - paper: white - }, - icon: colors.blueGrey[600], - divider: colors.grey[200] -}; diff --git a/webui/src/theme/palette.jsx b/webui/src/theme/palette.jsx new file mode 100644 index 0000000..f1c8e94 --- /dev/null +++ b/webui/src/theme/palette.jsx @@ -0,0 +1,56 @@ +import {colors} from '@material-ui/core'; + +const white = '#FFFFFF'; +const black = '#000000'; + +export default { + black, + white, + primary: { + contrastText: white, + dark: colors.indigo[900], + main: colors.indigo[500], + light: colors.indigo[100] + }, + secondary: { + contrastText: white, + dark: colors.blue[900], + main: colors.blue['A400'], + light: colors.blue['A400'] + }, + success: { + contrastText: white, + dark: colors.green[900], + main: colors.green[600], + light: colors.green[400] + }, + info: { + contrastText: white, + dark: colors.blue[900], + main: colors.blue[600], + light: colors.blue[400] + }, + warning: { + contrastText: white, + dark: colors.orange[900], + main: colors.orange[600], + light: colors.orange[400] + }, + error: { + contrastText: white, + dark: colors.red[900], + main: colors.red[600], + light: colors.red[400] + }, + text: { + primary: colors.blueGrey[900], + secondary: colors.blueGrey[600], + link: colors.blue[600] + }, + background: { + default: '#F4F6F8', + paper: white + }, + icon: colors.blueGrey[600], + divider: colors.grey[200] +}; diff --git a/webui/src/theme/typography.js b/webui/src/theme/typography.js deleted file mode 100644 index 3d88dc1..0000000 --- a/webui/src/theme/typography.js +++ /dev/null @@ -1,89 +0,0 @@ -import palette from './palette'; - -export default { - h1: { - color: palette.text.primary, - fontWeight: 500, - fontSize: '35px', - letterSpacing: '-0.24px', - lineHeight: '40px' - }, - h2: { - color: palette.text.primary, - fontWeight: 500, - fontSize: '29px', - letterSpacing: '-0.24px', - lineHeight: '32px' - }, - h3: { - color: palette.text.primary, - fontWeight: 500, - fontSize: '24px', - letterSpacing: '-0.06px', - lineHeight: '28px' - }, - h4: { - color: palette.text.primary, - fontWeight: 500, - fontSize: '20px', - letterSpacing: '-0.06px', - lineHeight: '24px' - }, - h5: { - color: palette.text.primary, - fontWeight: 500, - fontSize: '16px', - letterSpacing: '-0.05px', - lineHeight: '20px' - }, - h6: { - color: palette.text.primary, - fontWeight: 500, - fontSize: '14px', - letterSpacing: '-0.05px', - lineHeight: '20px' - }, - subtitle1: { - color: palette.text.primary, - fontSize: '16px', - letterSpacing: '-0.05px', - lineHeight: '25px' - }, - subtitle2: { - color: palette.text.secondary, - fontWeight: 400, - fontSize: '14px', - letterSpacing: '-0.05px', - lineHeight: '21px' - }, - body1: { - color: palette.text.primary, - fontSize: '14px', - letterSpacing: '-0.05px', - lineHeight: '21px' - }, - body2: { - color: palette.text.secondary, - fontSize: '12px', - letterSpacing: '-0.04px', - lineHeight: '18px' - }, - button: { - color: palette.text.primary, - fontSize: '14px' - }, - caption: { - color: palette.text.secondary, - fontSize: '11px', - letterSpacing: '0.33px', - lineHeight: '13px' - }, - overline: { - color: palette.text.secondary, - fontSize: '11px', - fontWeight: 500, - letterSpacing: '0.33px', - lineHeight: '13px', - textTransform: 'uppercase' - } -}; diff --git a/webui/src/theme/typography.jsx b/webui/src/theme/typography.jsx new file mode 100644 index 0000000..55caaab --- /dev/null +++ b/webui/src/theme/typography.jsx @@ -0,0 +1,89 @@ +import palette from './palette'; + +export default { + h1: { + color: palette.text.primary, + fontWeight: 500, + fontSize: '35px', + letterSpacing: '-0.24px', + lineHeight: '40px' + }, + h2: { + color: palette.text.primary, + fontWeight: 500, + fontSize: '29px', + letterSpacing: '-0.24px', + lineHeight: '32px' + }, + h3: { + color: palette.text.primary, + fontWeight: 500, + fontSize: '24px', + letterSpacing: '-0.06px', + lineHeight: '28px' + }, + h4: { + color: palette.text.primary, + fontWeight: 500, + fontSize: '20px', + letterSpacing: '-0.06px', + lineHeight: '24px' + }, + h5: { + color: palette.text.primary, + fontWeight: 500, + fontSize: '16px', + letterSpacing: '-0.05px', + lineHeight: '20px' + }, + h6: { + color: palette.text.primary, + fontWeight: 500, + fontSize: '14px', + letterSpacing: '-0.05px', + lineHeight: '20px' + }, + subtitle1: { + color: palette.text.primary, + fontSize: '16px', + letterSpacing: '-0.05px', + lineHeight: '25px' + }, + subtitle2: { + color: palette.text.secondary, + fontWeight: 400, + fontSize: '14px', + letterSpacing: '-0.05px', + lineHeight: '21px' + }, + body1: { + color: palette.text.primary, + fontSize: '14px', + letterSpacing: '-0.05px', + lineHeight: '21px' + }, + body2: { + color: palette.text.secondary, + fontSize: '12px', + letterSpacing: '-0.04px', + lineHeight: '18px' + }, + button: { + color: palette.text.primary, + fontSize: '14px' + }, + caption: { + color: palette.text.secondary, + fontSize: '11px', + letterSpacing: '0.33px', + lineHeight: '13px' + }, + overline: { + color: palette.text.secondary, + fontSize: '11px', + fontWeight: 500, + letterSpacing: '0.33px', + lineHeight: '13px', + textTransform: 'uppercase' + } +}; diff --git a/webui/src/views/Account/Account.js b/webui/src/views/Account/Account.js deleted file mode 100644 index d3a07d9..0000000 --- a/webui/src/views/Account/Account.js +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/styles'; -import { Grid } from '@material-ui/core'; - -import { AccountProfile, AccountDetails } from './components'; - -const useStyles = makeStyles(theme => ({ - root: { - padding: theme.spacing(4) - } -})); - -const Account = () => { - const classes = useStyles(); - - return ( -
- - - - - - - - -
- ); -}; - -export default Account; diff --git a/webui/src/views/Account/components/AccountDetails/AccountDetails.js b/webui/src/views/Account/components/AccountDetails/AccountDetails.js deleted file mode 100644 index 2e2c713..0000000 --- a/webui/src/views/Account/components/AccountDetails/AccountDetails.js +++ /dev/null @@ -1,204 +0,0 @@ -import React, { useState } from 'react'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { - Card, - CardHeader, - CardContent, - CardActions, - Divider, - Grid, - Button, - TextField -} from '@material-ui/core'; - -const useStyles = makeStyles(() => ({ - root: {} -})); - -const AccountDetails = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - const [values, setValues] = useState({ - firstName: 'Shen', - lastName: 'Zhi', - email: 'shen.zhi@devias.io', - phone: '', - state: 'Alabama', - country: 'USA' - }); - - const handleChange = event => { - setValues({ - ...values, - [event.target.name]: event.target.value - }); - }; - - const states = [ - { - value: 'alabama', - label: 'Alabama' - }, - { - value: 'new-york', - label: 'New York' - }, - { - value: 'san-francisco', - label: 'San Francisco' - } - ]; - - return ( - -
- - - - - - - - - - - - - - - - - - - {states.map(option => ( - - ))} - - - - - - - - - - - - -
- ); -}; - -AccountDetails.propTypes = { - className: PropTypes.string -}; - -export default AccountDetails; diff --git a/webui/src/views/Account/components/AccountDetails/index.js b/webui/src/views/Account/components/AccountDetails/index.js deleted file mode 100644 index 9d75950..0000000 --- a/webui/src/views/Account/components/AccountDetails/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './AccountDetails'; diff --git a/webui/src/views/Account/components/AccountProfile/AccountProfile.js b/webui/src/views/Account/components/AccountProfile/AccountProfile.js deleted file mode 100644 index 738da9a..0000000 --- a/webui/src/views/Account/components/AccountProfile/AccountProfile.js +++ /dev/null @@ -1,111 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import clsx from 'clsx'; -import moment from 'moment'; -import { makeStyles } from '@material-ui/styles'; -import { - Card, - CardActions, - CardContent, - Avatar, - Typography, - Divider, - Button, - LinearProgress -} from '@material-ui/core'; - -const useStyles = makeStyles(theme => ({ - root: {}, - details: { - display: 'flex' - }, - avatar: { - marginLeft: 'auto', - height: 110, - width: 100, - flexShrink: 0, - flexGrow: 0 - }, - progress: { - marginTop: theme.spacing(2) - }, - uploadButton: { - marginRight: theme.spacing(2) - } -})); - -const AccountProfile = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - const user = { - name: 'Shen Zhi', - city: 'Los Angeles', - country: 'USA', - timezone: 'GTM-7', - avatar: '/images/avatars/avatar_11.png' - }; - - return ( - - -
-
- - John Doe - - - {user.city}, {user.country} - - - {moment().format('hh:mm A')} ({user.timezone}) - -
- -
-
- Profile Completeness: 70% - -
-
- - - - - -
- ); -}; - -AccountProfile.propTypes = { - className: PropTypes.string -}; - -export default AccountProfile; diff --git a/webui/src/views/Account/components/AccountProfile/index.js b/webui/src/views/Account/components/AccountProfile/index.js deleted file mode 100644 index 1b70be5..0000000 --- a/webui/src/views/Account/components/AccountProfile/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './AccountProfile'; diff --git a/webui/src/views/Account/components/index.js b/webui/src/views/Account/components/index.js deleted file mode 100644 index a3bb00a..0000000 --- a/webui/src/views/Account/components/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as AccountDetails } from './AccountDetails'; -export { default as AccountProfile } from './AccountProfile'; diff --git a/webui/src/views/Account/index.js b/webui/src/views/Account/index.js deleted file mode 100644 index ce6b24c..0000000 --- a/webui/src/views/Account/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './Account'; diff --git a/webui/src/views/Dashboard/Dashboard.js b/webui/src/views/Dashboard/Dashboard.js deleted file mode 100644 index 0b705f6..0000000 --- a/webui/src/views/Dashboard/Dashboard.js +++ /dev/null @@ -1,108 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/styles'; -import { Grid } from '@material-ui/core'; - -import { - Budget, - TotalUsers, - TasksProgress, - TotalProfit, - LatestSales, - UsersByDevice, - LatestProducts, - LatestOrders -} from './components'; - -const useStyles = makeStyles(theme => ({ - root: { - padding: theme.spacing(4) - } -})); - -const Dashboard = () => { - const classes = useStyles(); - - return ( -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- ); -}; - -export default Dashboard; diff --git a/webui/src/views/Dashboard/Dashboard.jsx b/webui/src/views/Dashboard/Dashboard.jsx new file mode 100644 index 0000000..654e6d0 --- /dev/null +++ b/webui/src/views/Dashboard/Dashboard.jsx @@ -0,0 +1,49 @@ +import React from 'react'; +import {makeStyles} from '@material-ui/styles'; +import {Grid} from '@material-ui/core'; + +import { + Budget, + TotalUsers, + TasksProgress, + TotalProfit, + LatestSales, + UsersByDevice, +} from './components'; + +const useStyles = makeStyles(theme => ({ + root: { + padding: theme.spacing(4) + } +})); + +const Dashboard = () => { + const classes = useStyles(); + + return ( +
+ + + + + + + + + + + + + + + + + + + + +
+ ); +}; + +export default Dashboard; diff --git a/webui/src/views/Dashboard/components/Budget/Budget.js b/webui/src/views/Dashboard/components/Budget/Budget.jsx similarity index 100% rename from webui/src/views/Dashboard/components/Budget/Budget.js rename to webui/src/views/Dashboard/components/Budget/Budget.jsx diff --git a/webui/src/views/Dashboard/components/Budget/index.js b/webui/src/views/Dashboard/components/Budget/index.jsx similarity index 100% rename from webui/src/views/Dashboard/components/Budget/index.js rename to webui/src/views/Dashboard/components/Budget/index.jsx diff --git a/webui/src/views/Dashboard/components/LatestOrders/LatestOrders.js b/webui/src/views/Dashboard/components/LatestOrders/LatestOrders.js deleted file mode 100644 index 82a61c0..0000000 --- a/webui/src/views/Dashboard/components/LatestOrders/LatestOrders.js +++ /dev/null @@ -1,148 +0,0 @@ -import React, { useState } from 'react'; -import clsx from 'clsx'; -import moment from 'moment'; -import PerfectScrollbar from 'react-perfect-scrollbar'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { - Card, - CardActions, - CardHeader, - CardContent, - Button, - Divider, - Table, - TableBody, - TableCell, - TableHead, - TableRow, - Tooltip, - TableSortLabel -} from '@material-ui/core'; -import ArrowRightIcon from '@material-ui/icons/ArrowRight'; - -import mockData from './data'; -import {StatusBullet} from '../../../../components'; - -const useStyles = makeStyles(theme => ({ - root: {}, - content: { - padding: 0 - }, - inner: { - minWidth: 800 - }, - statusContainer: { - display: 'flex', - alignItems: 'center' - }, - status: { - marginRight: theme.spacing(1) - }, - actions: { - justifyContent: 'flex-end' - } -})); - -const statusColors = { - delivered: 'success', - pending: 'info', - refunded: 'danger' -}; - -const LatestOrders = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - const [orders] = useState(mockData); - - return ( - - - New entry - - } - title="Latest Orders" - /> - - - -
- - - - Order Ref - Customer - - - - Date - - - - Status - - - - {orders.map(order => ( - - {order.ref} - {order.customer.name} - - {moment(order.createdAt).format('DD/MM/YYYY')} - - -
- - {order.status} -
-
-
- ))} -
-
-
-
-
- - - - -
- ); -}; - -LatestOrders.propTypes = { - className: PropTypes.string -}; - -export default LatestOrders; diff --git a/webui/src/views/Dashboard/components/LatestOrders/data.js b/webui/src/views/Dashboard/components/LatestOrders/data.js deleted file mode 100644 index bbf5879..0000000 --- a/webui/src/views/Dashboard/components/LatestOrders/data.js +++ /dev/null @@ -1,64 +0,0 @@ -import uuid from 'uuid/v1'; - -export default [ - { - id: uuid(), - ref: 'CDD1049', - amount: 30.5, - customer: { - name: 'Ekaterina Tankova' - }, - createdAt: 1555016400000, - status: 'pending' - }, - { - id: uuid(), - ref: 'CDD1048', - amount: 25.1, - customer: { - name: 'Cao Yu' - }, - createdAt: 1555016400000, - status: 'delivered' - }, - { - id: uuid(), - ref: 'CDD1047', - amount: 10.99, - customer: { - name: 'Alexa Richardson' - }, - createdAt: 1554930000000, - status: 'refunded' - }, - { - id: uuid(), - ref: 'CDD1046', - amount: 96.43, - customer: { - name: 'Anje Keizer' - }, - createdAt: 1554757200000, - status: 'pending' - }, - { - id: uuid(), - ref: 'CDD1045', - amount: 32.54, - customer: { - name: 'Clarke Gillebert' - }, - createdAt: 1554670800000, - status: 'delivered' - }, - { - id: uuid(), - ref: 'CDD1044', - amount: 16.76, - customer: { - name: 'Adam Denisov' - }, - createdAt: 1554670800000, - status: 'delivered' - } -]; diff --git a/webui/src/views/Dashboard/components/LatestOrders/index.js b/webui/src/views/Dashboard/components/LatestOrders/index.js deleted file mode 100644 index d806aca..0000000 --- a/webui/src/views/Dashboard/components/LatestOrders/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './LatestOrders'; diff --git a/webui/src/views/Dashboard/components/LatestProducts/LatestProducts.js b/webui/src/views/Dashboard/components/LatestProducts/LatestProducts.js deleted file mode 100644 index b3525f0..0000000 --- a/webui/src/views/Dashboard/components/LatestProducts/LatestProducts.js +++ /dev/null @@ -1,102 +0,0 @@ -import React, { useState } from 'react'; -import clsx from 'clsx'; -import PropTypes from 'prop-types'; -import { makeStyles } from '@material-ui/styles'; -import { - Card, - CardHeader, - CardContent, - CardActions, - Button, - Divider, - List, - ListItem, - ListItemAvatar, - ListItemText, - IconButton -} from '@material-ui/core'; -import ArrowRightIcon from '@material-ui/icons/ArrowRight'; -import MoreVertIcon from '@material-ui/icons/MoreVert'; - -import mockData from './data'; - -const useStyles = makeStyles(() => ({ - root: { - height: '100%' - }, - content: { - padding: 0 - }, - image: { - height: 48, - width: 48 - }, - actions: { - justifyContent: 'flex-end' - } -})); - -const LatestProducts = props => { - const { className, ...rest } = props; - - const classes = useStyles(); - - const [products] = useState(mockData); - - return ( - - - - - - {products.map((product, i) => ( - - - Product - - - - - - - ))} - - - - - - - - ); -}; - -LatestProducts.propTypes = { - className: PropTypes.string -}; - -export default LatestProducts; diff --git a/webui/src/views/Dashboard/components/LatestProducts/data.js b/webui/src/views/Dashboard/components/LatestProducts/data.js deleted file mode 100644 index bbe9e09..0000000 --- a/webui/src/views/Dashboard/components/LatestProducts/data.js +++ /dev/null @@ -1,35 +0,0 @@ -import uuid from 'uuid/v1'; -import moment from 'moment'; - -export default [ - { - id: uuid(), - name: 'Dropbox', - imageUrl: '/images/products/product_1.png', - updatedAt: moment().subtract(2, 'hours') - }, - { - id: uuid(), - name: 'Medium Corporation', - imageUrl: '/images/products/product_2.png', - updatedAt: moment().subtract(2, 'hours') - }, - { - id: uuid(), - name: 'Slack', - imageUrl: '/images/products/product_3.png', - updatedAt: moment().subtract(3, 'hours') - }, - { - id: uuid(), - name: 'Lyft', - imageUrl: '/images/products/product_4.png', - updatedAt: moment().subtract(5, 'hours') - }, - { - id: uuid(), - name: 'GitHub', - imageUrl: '/images/products/product_5.png', - updatedAt: moment().subtract(9, 'hours') - } -]; diff --git a/webui/src/views/Dashboard/components/LatestProducts/index.js b/webui/src/views/Dashboard/components/LatestProducts/index.js deleted file mode 100644 index 8d53be3..0000000 --- a/webui/src/views/Dashboard/components/LatestProducts/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './LatestProducts'; diff --git a/webui/src/views/Dashboard/components/LatestSales/LatestSales.js b/webui/src/views/Dashboard/components/LatestSales/LatestSales.jsx similarity index 100% rename from webui/src/views/Dashboard/components/LatestSales/LatestSales.js rename to webui/src/views/Dashboard/components/LatestSales/LatestSales.jsx diff --git a/webui/src/views/Dashboard/components/LatestSales/chart.js b/webui/src/views/Dashboard/components/LatestSales/chart.jsx similarity index 100% rename from webui/src/views/Dashboard/components/LatestSales/chart.js rename to webui/src/views/Dashboard/components/LatestSales/chart.jsx diff --git a/webui/src/views/Dashboard/components/LatestSales/index.js b/webui/src/views/Dashboard/components/LatestSales/index.jsx similarity index 100% rename from webui/src/views/Dashboard/components/LatestSales/index.js rename to webui/src/views/Dashboard/components/LatestSales/index.jsx diff --git a/webui/src/views/Dashboard/components/TasksProgress/TasksProgress.js b/webui/src/views/Dashboard/components/TasksProgress/TasksProgress.jsx similarity index 100% rename from webui/src/views/Dashboard/components/TasksProgress/TasksProgress.js rename to webui/src/views/Dashboard/components/TasksProgress/TasksProgress.jsx diff --git a/webui/src/views/Dashboard/components/TasksProgress/index.js b/webui/src/views/Dashboard/components/TasksProgress/index.jsx similarity index 100% rename from webui/src/views/Dashboard/components/TasksProgress/index.js rename to webui/src/views/Dashboard/components/TasksProgress/index.jsx diff --git a/webui/src/views/Dashboard/components/TotalProfit/TotalProfit.js b/webui/src/views/Dashboard/components/TotalProfit/TotalProfit.jsx similarity index 100% rename from webui/src/views/Dashboard/components/TotalProfit/TotalProfit.js rename to webui/src/views/Dashboard/components/TotalProfit/TotalProfit.jsx diff --git a/webui/src/views/Dashboard/components/TotalProfit/index.js b/webui/src/views/Dashboard/components/TotalProfit/index.jsx similarity index 100% rename from webui/src/views/Dashboard/components/TotalProfit/index.js rename to webui/src/views/Dashboard/components/TotalProfit/index.jsx diff --git a/webui/src/views/Dashboard/components/TotalUsers/TotalUsers.js b/webui/src/views/Dashboard/components/TotalUsers/TotalUsers.jsx similarity index 100% rename from webui/src/views/Dashboard/components/TotalUsers/TotalUsers.js rename to webui/src/views/Dashboard/components/TotalUsers/TotalUsers.jsx diff --git a/webui/src/views/Dashboard/components/TotalUsers/index.js b/webui/src/views/Dashboard/components/TotalUsers/index.jsx similarity index 100% rename from webui/src/views/Dashboard/components/TotalUsers/index.js rename to webui/src/views/Dashboard/components/TotalUsers/index.jsx diff --git a/webui/src/views/Dashboard/components/UsersByDevice/UsersByDevice.js b/webui/src/views/Dashboard/components/UsersByDevice/UsersByDevice.jsx similarity index 100% rename from webui/src/views/Dashboard/components/UsersByDevice/UsersByDevice.js rename to webui/src/views/Dashboard/components/UsersByDevice/UsersByDevice.jsx diff --git a/webui/src/views/Dashboard/components/UsersByDevice/index.js b/webui/src/views/Dashboard/components/UsersByDevice/index.jsx similarity index 100% rename from webui/src/views/Dashboard/components/UsersByDevice/index.js rename to webui/src/views/Dashboard/components/UsersByDevice/index.jsx diff --git a/webui/src/views/Dashboard/components/index.js b/webui/src/views/Dashboard/components/index.jsx similarity index 73% rename from webui/src/views/Dashboard/components/index.js rename to webui/src/views/Dashboard/components/index.jsx index 9efde58..6cc0730 100644 --- a/webui/src/views/Dashboard/components/index.js +++ b/webui/src/views/Dashboard/components/index.jsx @@ -1,6 +1,4 @@ export { default as Budget } from './Budget'; -export { default as LatestOrders } from './LatestOrders'; -export { default as LatestProducts } from './LatestProducts'; export { default as LatestSales } from './LatestSales'; export { default as TasksProgress } from './TasksProgress'; export { default as TotalProfit } from './TotalProfit'; diff --git a/webui/src/views/Dashboard/index.js b/webui/src/views/Dashboard/index.jsx similarity index 100% rename from webui/src/views/Dashboard/index.js rename to webui/src/views/Dashboard/index.jsx diff --git a/webui/src/views/Icons/Icons.js b/webui/src/views/Icons/Icons.js deleted file mode 100644 index b0b1c1c..0000000 --- a/webui/src/views/Icons/Icons.js +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/styles'; - -const useStyles = makeStyles(theme => ({ - root: { - padding: theme.spacing(4) - }, - iframe: { - width: '100%', - minHeight: 640, - border: 0 - } -})); - -const Icons = () => { - const classes = useStyles(); - - return ( -
-