├── src ├── sass │ ├── _dekstop.scss │ ├── _tablet.scss │ ├── _colors.scss │ ├── _variables.scss │ ├── _mobile.scss │ └── _menu.scss ├── config.js ├── redux │ ├── actions │ │ ├── actionTypes.js │ │ └── authAction.js │ ├── reducers │ │ ├── index.js │ │ └── authReducer.js │ └── store.js ├── components │ ├── styles │ │ ├── ImageCardTitle.js │ │ ├── ImageCardSubTitle.js │ │ ├── ProductCardName.js │ │ ├── ProductCardCategory.js │ │ ├── Breadcrumb.js │ │ ├── ProductCard.js │ │ ├── BreadcrumbItem.js │ │ ├── MenuLink.js │ │ ├── Row.js │ │ ├── FormGroup.js │ │ ├── ProductCardImage.js │ │ ├── Container.js │ │ ├── Form.js │ │ ├── CarouselIndicator.js │ │ ├── H1.js │ │ ├── H2.js │ │ ├── H3.js │ │ ├── H4.js │ │ ├── H5.js │ │ ├── ImageCardDescription.js │ │ ├── ProductCardDescription.js │ │ ├── DropdownItem.js │ │ ├── Collapse.js │ │ ├── ImageCard.js │ │ ├── Avatar.js │ │ ├── Table.js │ │ ├── BoxTitle.js │ │ ├── ProductCardPrice.js │ │ ├── Checkbox.js │ │ ├── Col.js │ │ ├── Badge.js │ │ ├── Box.js │ │ ├── Alert.js │ │ ├── Select.js │ │ ├── Menu.js │ │ ├── Modal.js │ │ ├── IconCard.js │ │ ├── Accordion.js │ │ ├── ProgressBar.js │ │ ├── Carousel.js │ │ ├── UserCard.js │ │ ├── ChartBar.js │ │ ├── ChartLine.js │ │ ├── index.js │ │ ├── ChartPie.js │ │ ├── ChartDonut.js │ │ ├── Textarea.js │ │ ├── Dropdown.js │ │ ├── ChartRadar.js │ │ ├── Input.js │ │ └── Button.js │ ├── layouts │ │ ├── BlankLayout.js │ │ ├── MessagePreview.js │ │ ├── NotificationPreview.js │ │ ├── AdminLayout.js │ │ ├── MessageContainer.js │ │ ├── Navbar.js │ │ └── NotificationContainer.js │ └── pages │ │ ├── Page500.js │ │ ├── Page404.js │ │ ├── components │ │ ├── AvatarPage.js │ │ ├── HeaderPage.js │ │ ├── CarouselPage.js │ │ ├── AlertPage.js │ │ ├── BreadcrumbsPage.js │ │ ├── BoxPage.js │ │ ├── ChartsPage.js │ │ ├── BadgePage.js │ │ ├── ModalPage.js │ │ ├── DropdownsPage.js │ │ ├── CollapsePage.js │ │ ├── ButtonPage.js │ │ └── ProgressBarPage.js │ │ ├── documentation │ │ ├── components │ │ │ ├── Avatar.js │ │ │ ├── Header.js │ │ │ ├── Alerts.js │ │ │ ├── Breadcrumbs.js │ │ │ ├── Carousels.js │ │ │ └── Box.js │ │ ├── DocsExample.js │ │ └── getting_started │ │ │ └── Installation.js │ │ ├── ResetPasswordPage.js │ │ ├── ForgotPasswordPage.js │ │ ├── FAQPage.js │ │ ├── SignupPage.js │ │ └── LoginPage.js ├── helpers │ └── stringHelper.js └── index.js ├── static.json ├── public ├── robots.txt ├── favicon.png ├── iconname.png ├── images │ ├── asus.jpg │ ├── oppo.jpg │ ├── avatar.png │ ├── iphone.jpg │ ├── slider1.jpg │ ├── slider2.jpg │ ├── slider3.jpg │ └── background.png ├── manifest.json └── index.html ├── .gitignore ├── package.json ├── README.md └── readme.html /src/sass/_dekstop.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | USER_KEY : 'refast_user' 3 | } -------------------------------------------------------------------------------- /static.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/static.json -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/favicon.png -------------------------------------------------------------------------------- /public/iconname.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/iconname.png -------------------------------------------------------------------------------- /public/images/asus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/asus.jpg -------------------------------------------------------------------------------- /public/images/oppo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/oppo.jpg -------------------------------------------------------------------------------- /public/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/avatar.png -------------------------------------------------------------------------------- /public/images/iphone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/iphone.jpg -------------------------------------------------------------------------------- /public/images/slider1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/slider1.jpg -------------------------------------------------------------------------------- /public/images/slider2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/slider2.jpg -------------------------------------------------------------------------------- /public/images/slider3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/slider3.jpg -------------------------------------------------------------------------------- /public/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firhan200/refast/HEAD/public/images/background.png -------------------------------------------------------------------------------- /src/redux/actions/actionTypes.js: -------------------------------------------------------------------------------- 1 | /* Auth */ 2 | export const LOGIN = 'LOGIN'; 3 | export const LOGOUT = 'LOGOUT'; 4 | export const IS_AUTHENTICATED = 'IS_AUTHENTICATED'; 5 | /* Auth */ -------------------------------------------------------------------------------- /src/redux/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux'; 2 | import authReducer from './authReducer.js'; 3 | 4 | export default combineReducers({ 5 | authReducer, 6 | }); -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "theme_color": "#000000", 7 | "background_color": "#ffffff" 8 | } 9 | -------------------------------------------------------------------------------- /src/components/styles/ImageCardTitle.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ImageCardTitle = (props) => { 4 | return( 5 |
{ props.children }
6 | ); 7 | } 8 | 9 | export default ImageCardTitle; -------------------------------------------------------------------------------- /src/components/styles/ImageCardSubTitle.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ImageCardSubTitle = (props) => { 4 | return( 5 |
{ props.children }
6 | ); 7 | } 8 | 9 | export default ImageCardSubTitle; -------------------------------------------------------------------------------- /src/sass/_tablet.scss: -------------------------------------------------------------------------------- 1 | @media (min-width: $mobile) and (max-width: $tablet) { 2 | /* components */ 3 | 4 | /* components */ 5 | 6 | /* pages */ 7 | .mail-table{ 8 | td{ 9 | font-size:$small-font-size - 2 !important; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/components/styles/ProductCardName.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ProductCardName = (props) => { 4 | return( 5 |
6 | {props.children} 7 |
8 | ); 9 | } 10 | 11 | export default ProductCardName; -------------------------------------------------------------------------------- /src/components/styles/ProductCardCategory.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ProductCardCategory = (props) => { 4 | return( 5 |
6 | {props.children} 7 |
8 | ); 9 | } 10 | 11 | export default ProductCardCategory; -------------------------------------------------------------------------------- /src/redux/store.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware, compose } from 'redux'; 2 | import rootReducer from './reducers'; 3 | import thunk from 'redux-thunk'; 4 | 5 | export default createStore(rootReducer, compose(applyMiddleware(thunk) 6 | // , window.devToolsExtension ? window.devToolsExtension() : f => f 7 | )); -------------------------------------------------------------------------------- /src/helpers/stringHelper.js: -------------------------------------------------------------------------------- 1 | export default { 2 | cutString : (string, maxLength) => { 3 | let result = ''; 4 | //check string 5 | if(typeof string !== 'undefined'){ 6 | result = string.length > maxLength ? string.slice(0, maxLength)+"..." : string; 7 | } 8 | 9 | return result; 10 | } 11 | } -------------------------------------------------------------------------------- /src/components/styles/Breadcrumb.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Breadcrumb = (props) => { 4 | return( 5 | 10 | ); 11 | } 12 | 13 | export default Breadcrumb; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/sass/_colors.scss: -------------------------------------------------------------------------------- 1 | // colors 2 | $default-color : #7757F7; 3 | $black: #1c1c1c; 4 | $dark-gray: #4e4e4e; 5 | $form-border: #e6e6e6; 6 | $blue: #3498DB; 7 | $white : #fff; 8 | $gray : #f2f2f2; 9 | $red : #ED6D6D; 10 | $green : #75ED6D; 11 | $side-nav: #fff; 12 | 13 | //bootstrap color replacement 14 | $primary : $default-color; 15 | $danger: #D15C41; 16 | $warning: #E1E53D; 17 | $success: #27CF74; 18 | $info: #80FEDE; 19 | 20 | 21 | //forms 22 | $form-bg : #fff; -------------------------------------------------------------------------------- /src/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Variables using by application 3 | */ 4 | $background-color : #fff; 5 | $input-color: $gray; 6 | $navbar-color : $white; 7 | $default-font-size : 10pt; 8 | $small-font-size : 9pt; 9 | $large-font-size : 16pt; 10 | $huge-font-size : 20pt; 11 | $shadow: 0 0 1.5px rgb(109, 108, 108); 12 | $form-height: 45px; 13 | $checkbox-size: 14px; 14 | 15 | //text 16 | $h1 : 24px; 17 | $h2 : 18px; 18 | $h3 : 16px; 19 | $h4 : 12px; 20 | $h5 : 9px; 21 | 22 | //resolution 23 | $mobile : 767px; 24 | $tablet : 992px; 25 | 26 | //components 27 | $badge-image-size : 33px; -------------------------------------------------------------------------------- /src/components/styles/ProductCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const ProductCard = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | return( 11 |
12 | {props.children} 13 |
14 | ); 15 | } 16 | 17 | //prop types initialize 18 | ProductCard.propTypes = { 19 | className: PropTypes.string 20 | } 21 | 22 | export default ProductCard; -------------------------------------------------------------------------------- /src/components/styles/BreadcrumbItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const BreadcrumbItem = (props) => { 7 | //get button outlined 8 | const isActive = typeof props.isActive !== 'undefined' ? props.isActive : false; 9 | 10 | return( 11 |
  • 12 | {props.children} 13 |
  • 14 | ); 15 | } 16 | 17 | //prop types initialize 18 | BreadcrumbItem.propTypes = { 19 | isActive : PropTypes.bool 20 | } 21 | 22 | export default BreadcrumbItem; -------------------------------------------------------------------------------- /src/components/styles/MenuLink.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const MenuLink = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | return( 11 |
  • 12 | { props.children } 13 |
  • 14 | ); 15 | } 16 | 17 | //prop types initialize 18 | MenuLink.propTypes = { 19 | style : PropTypes.object, 20 | className: PropTypes.string 21 | } 22 | 23 | export default MenuLink; -------------------------------------------------------------------------------- /src/components/styles/Row.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Row = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | return( 11 |
    12 | { props.children } 13 |
    14 | ); 15 | } 16 | 17 | //prop types initialize 18 | Row.propTypes = { 19 | style : PropTypes.object, 20 | className: PropTypes.string 21 | } 22 | 23 | export default Row; -------------------------------------------------------------------------------- /src/components/styles/FormGroup.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const FormGroup = (props) => { 7 | //get custom class 8 | const isRow = typeof props.isRow !== 'undefined' ? props.isRow : false; 9 | 10 | return( 11 |
    12 | { props.children } 13 |
    14 | ); 15 | } 16 | 17 | //prop types initialize 18 | FormGroup.propTypes = { 19 | style : PropTypes.object, 20 | isRow : PropTypes.bool 21 | } 22 | 23 | export default FormGroup; -------------------------------------------------------------------------------- /src/components/styles/ProductCardImage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const ProductCardImage = (props) => { 7 | //get custom class 8 | const image = typeof props.image !== 'undefined' ? props.image : ''; 9 | 10 | return( 11 |
    12 | {""}/ 13 |
    14 | ); 15 | } 16 | 17 | //prop types initialize 18 | ProductCardImage.propTypes = { 19 | image: PropTypes.string 20 | } 21 | 22 | export default ProductCardImage; -------------------------------------------------------------------------------- /src/components/styles/Container.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Container = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | return( 11 |
    12 | { props.children } 13 |
    14 | ); 15 | } 16 | 17 | //prop types initialize 18 | Container.propTypes = { 19 | style : PropTypes.object, 20 | className: PropTypes.string 21 | } 22 | 23 | export default Container; -------------------------------------------------------------------------------- /src/components/styles/Form.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Form = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | return( 11 |
    12 | { props.children } 13 |
    14 | ); 15 | } 16 | 17 | //prop types initialize 18 | Form.propTypes = { 19 | style : PropTypes.object, 20 | className : PropTypes.string, 21 | handleSubmit : PropTypes.func, 22 | } 23 | 24 | export default Form; -------------------------------------------------------------------------------- /src/components/layouts/BlankLayout.js: -------------------------------------------------------------------------------- 1 | import React, {Fragment} from 'react'; 2 | 3 | /* components */ 4 | /* components */ 5 | 6 | const BlankLayout = (props) => { 7 | return( 8 | 9 | {/* set container width to all content */} 10 |
    11 |
    12 |
    13 | 14 | {/* render children content */} 15 | { props.children } 16 | 17 |
    18 |
    19 |
    20 |
    21 | ); 22 | } 23 | 24 | export default BlankLayout; -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import './sass/index.scss'; 5 | import * as serviceWorker from './serviceWorker'; 6 | 7 | /* Libs */ 8 | import { Provider } from 'react-redux'; 9 | import store from './redux/store'; 10 | 11 | ReactDOM.render( 12 | 13 | 14 | 15 | , document.getElementById('root') 16 | ); 17 | 18 | // If you want your app to work offline and load faster, you can change 19 | // unregister() to register() below. Note this comes with some pitfalls. 20 | // Learn more about service workers: https://bit.ly/CRA-PWA 21 | serviceWorker.unregister(); 22 | -------------------------------------------------------------------------------- /src/components/styles/CarouselIndicator.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const CarouselIndicator = (props) => { 7 | //get array of item 8 | const items = typeof props.items !== 'undefined' ? props.items : []; 9 | 10 | return( 11 | 16 | ); 17 | } 18 | 19 | //prop types initialize 20 | CarouselCaption.propTypes = { 21 | items : PropTypes.array 22 | } 23 | 24 | 25 | export default CarouselIndicator; -------------------------------------------------------------------------------- /src/components/styles/H1.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const H1 = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get align 11 | const align = typeof props.align !== 'undefined' ? props.align : 'left'; 12 | 13 | return( 14 |

    { props.children }

    15 | ); 16 | } 17 | 18 | //prop types initialize 19 | H1.propTypes = { 20 | style : PropTypes.object, 21 | className : PropTypes.string, 22 | align : PropTypes.oneOf(['left', 'center', 'right']) 23 | } 24 | 25 | export default H1; -------------------------------------------------------------------------------- /src/components/styles/H2.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const H2 = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get align 11 | const align = typeof props.align !== 'undefined' ? props.align : 'left'; 12 | 13 | return( 14 |

    { props.children }

    15 | ); 16 | } 17 | 18 | //prop types initialize 19 | H2.propTypes = { 20 | style : PropTypes.object, 21 | className : PropTypes.string, 22 | align : PropTypes.oneOf(['left', 'center', 'right']) 23 | } 24 | 25 | export default H2; -------------------------------------------------------------------------------- /src/components/styles/H3.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const H3 = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get align 11 | const align = typeof props.align !== 'undefined' ? props.align : 'left'; 12 | 13 | return( 14 |

    { props.children }

    15 | ); 16 | } 17 | 18 | //prop types initialize 19 | H3.propTypes = { 20 | style : PropTypes.object, 21 | className : PropTypes.string, 22 | align : PropTypes.oneOf(['left', 'center', 'right']) 23 | } 24 | 25 | export default H3; -------------------------------------------------------------------------------- /src/components/styles/H4.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const H4 = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get align 11 | const align = typeof props.align !== 'undefined' ? props.align : 'left'; 12 | 13 | return( 14 |

    { props.children }

    15 | ); 16 | } 17 | 18 | //prop types initialize 19 | H4.propTypes = { 20 | style : PropTypes.object, 21 | className : PropTypes.string, 22 | align : PropTypes.oneOf(['left', 'center', 'right']) 23 | } 24 | 25 | export default H4; -------------------------------------------------------------------------------- /src/components/styles/H5.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const H5 = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get align 11 | const align = typeof props.align !== 'undefined' ? props.align : 'left'; 12 | 13 | return( 14 |
    { props.children }
    15 | ); 16 | } 17 | 18 | //prop types initialize 19 | H5.propTypes = { 20 | style : PropTypes.object, 21 | className : PropTypes.string, 22 | align : PropTypes.oneOf(['left', 'center', 'right']) 23 | } 24 | 25 | export default H5; -------------------------------------------------------------------------------- /src/components/layouts/MessagePreview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const MessagePreview = ({ message }) => { 4 | return( 5 |
    6 | ... 7 | 8 |
    9 |
    10 | { message.title } 11 |
    12 |
    13 | { message.description } 14 |
    15 |
    16 | { message.time } 17 |
    18 |
    19 |
    20 | ); 21 | } 22 | 23 | export default MessagePreview; -------------------------------------------------------------------------------- /src/components/layouts/NotificationPreview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const NotificationPreview = ({ notification }) => { 4 | return( 5 |
    6 | ... 7 | 8 |
    9 |
    10 | { notification.title } 11 |
    12 |
    13 | { notification.description } 14 |
    15 |
    16 | { notification.time } 17 |
    18 |
    19 |
    20 | ); 21 | } 22 | 23 | export default NotificationPreview; -------------------------------------------------------------------------------- /src/components/styles/ImageCardDescription.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const ImageCardDescription = (props) => { 7 | let maxLength = 100; 8 | let description = ''; 9 | 10 | //get maxLength 11 | maxLength = typeof props.maxLength !== 'undefined' ? props.maxLength : maxLength; 12 | 13 | //get description 14 | if(typeof props.children !== 'undefined'){ 15 | description = props.children.length > maxLength ? props.children.slice(0, maxLength)+'...' : props.children; 16 | } 17 | 18 | return( 19 |

    { description }

    20 | ); 21 | } 22 | 23 | //prop types initialize 24 | ImageCardDescription.propTypes = { 25 | maxLength: PropTypes.number 26 | } 27 | 28 | export default ImageCardDescription; -------------------------------------------------------------------------------- /src/components/styles/ProductCardDescription.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const ProductCardDescription = (props) => { 7 | let maxLength = 100; 8 | let description = ''; 9 | 10 | //get maxLength 11 | maxLength = typeof props.maxLength !== 'undefined' ? props.maxLength : maxLength; 12 | 13 | //get description 14 | if(typeof props.children !== 'undefined'){ 15 | description = props.children.length > maxLength ? props.children.slice(0, maxLength)+'...' : props.children; 16 | } 17 | 18 | return( 19 |

    { description }

    20 | ); 21 | } 22 | 23 | //prop types initialize 24 | ProductCardDescription.propTypes = { 25 | maxLength: PropTypes.number 26 | } 27 | 28 | export default ProductCardDescription; -------------------------------------------------------------------------------- /src/components/layouts/AdminLayout.js: -------------------------------------------------------------------------------- 1 | import React, {Fragment} from 'react'; 2 | 3 | /* components */ 4 | import Navbar from './Navbar.js'; 5 | import Menubar from './Menubar'; 6 | /* components */ 7 | 8 | const Adminlayout = (props) => { 9 | return( 10 | 11 | {/* Top navigation bar and Menu bar */} 12 | 13 | 14 | 15 | {/* set container width to all content */} 16 |
    17 |
    18 |
    19 | 20 | {/* render children content */} 21 | { props.children } 22 | 23 |
    24 |
    25 |
    26 |
    27 | ); 28 | } 29 | 30 | export default Adminlayout; -------------------------------------------------------------------------------- /src/components/styles/DropdownItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const DropdownItem = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get button enable 11 | const disabled = typeof props.disabled !== 'undefined' ? props.disabled : false; 12 | const isDisabled = disabled ? ' disabled ' : ' '; 13 | 14 | return( 15 | 22 | ); 23 | } 24 | 25 | //prop types initialize 26 | DropdownItem.propTypes = { 27 | className: PropTypes.string, 28 | handleClick: PropTypes.func, 29 | disabled: PropTypes.bool, 30 | } 31 | 32 | export default DropdownItem; -------------------------------------------------------------------------------- /src/components/styles/Collapse.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import useCollapse from 'react-collapsed'; 3 | 4 | //libs 5 | import PropTypes from 'prop-types'; // prop types 6 | 7 | const Collapse = (props) => { 8 | //get custom class 9 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 10 | 11 | //get is open 12 | const isOpen = typeof props.isOpen !== 'undefined' ? props.isOpen : false; 13 | 14 | //collapse 15 | const {getCollapseProps} = useCollapse({ isOpen }); 16 | 17 | return( 18 |
    19 |
    20 | { props.children } 21 |
    22 |
    23 | ); 24 | } 25 | 26 | //prop types initialize 27 | Collapse.propTypes = { 28 | className : PropTypes.string, 29 | style : PropTypes.object, 30 | isOpen : PropTypes.bool, 31 | } 32 | 33 | export default Collapse; -------------------------------------------------------------------------------- /src/components/styles/ImageCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const ImageCard = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get image 11 | const image = typeof props.image !== 'undefined' ? props.image : ''; 12 | 13 | //get image 14 | const isOverlay = typeof props.isOverlay !== 'undefined' ? props.isOverlay : false; 15 | 16 | return( 17 |
    18 | {""} 19 |
    20 | {props.children} 21 |
    22 |
    23 | ); 24 | } 25 | 26 | //prop types initialize 27 | ImageCard.propTypes = { 28 | className: PropTypes.string, 29 | image: PropTypes.string, 30 | isOverlay: PropTypes.bool, 31 | } 32 | 33 | export default ImageCard; -------------------------------------------------------------------------------- /src/components/styles/Avatar.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Avatar = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get src 11 | const imageSrc = typeof props.src !== 'undefined' ? props.src : ''; 12 | 13 | //get size 14 | const size = typeof props.size !== 'undefined' ? ' '+props.size+' ' : ' medium '; 15 | 16 | return( 17 |
    18 | { imageSrc !== '' ? ( 19 | { 20 | ) : '' } 21 |
    22 | ); 23 | } 24 | 25 | //prop types initialize 26 | Avatar.propTypes = { 27 | style : PropTypes.object, 28 | className : PropTypes.string, 29 | alt : PropTypes.string, 30 | src : PropTypes.string, 31 | size : PropTypes.oneOf(['small', 'medium', 'large']), 32 | } 33 | 34 | export default Avatar; -------------------------------------------------------------------------------- /src/components/pages/Page500.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | 3 | /* libs */ 4 | import { Link } from 'react-router-dom'; 5 | import { 6 | Container, 7 | Row, 8 | Box, 9 | H1, 10 | H2} from '../styles'; 11 | 12 | const Page500 = (props) => { 13 | return( 14 | 15 | 16 | 17 | 18 |
    19 | 20 |
    21 |

    500

    22 |

    Internal Server Error

    23 |

    Sorry, something went wrong. Please try again later.

    24 | Reload 25 |
    26 |
    27 |
    28 |
    29 | ); 30 | } 31 | 32 | export default Page500; -------------------------------------------------------------------------------- /src/components/styles/Table.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Table = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get type 11 | const type = typeof props.type !== 'undefined' ? ' table-'+props.type : ' '; 12 | 13 | //get size 14 | const size = typeof props.size !== 'undefined' ? ' '+props.size+' ' : ' medium '; 15 | 16 | //get responsive 17 | const isResponsive = typeof props.isResponsive !== 'undefined' ? ' table-responsive-sm ' : ' '; 18 | 19 | return( 20 | 21 | { props.children } 22 |
    23 | ); 24 | } 25 | 26 | //prop types initialize 27 | Table.propTypes = { 28 | style : PropTypes.object, 29 | className : PropTypes.string, 30 | isResponsive : PropTypes.bool, 31 | type : PropTypes.oneOf(['dark', 'striped', 'bordered']), 32 | size : PropTypes.oneOf(['small', 'medium', 'large']), 33 | } 34 | 35 | export default Table; -------------------------------------------------------------------------------- /src/components/styles/BoxTitle.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const BoxTitle = (props) => { 7 | //get align 8 | const align = typeof props.align !== 'undefined' ? props.align : 'left'; 9 | 10 | //get icon 11 | const icon = typeof props.icon !== 'undefined' ? props.icon : ''; 12 | 13 | //get custom class 14 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 15 | 16 | return( 17 |
    18 |
    19 | { icon !== '' ? ( 20 | 21 | ) : '' } 22 | { props.label } 23 |
    24 |
    25 | { props.subLabel } 26 |
    27 |
    28 | ); 29 | } 30 | 31 | //prop types initialize 32 | BoxTitle.propTypes = { 33 | className : PropTypes.string, 34 | style : PropTypes.object, 35 | label: PropTypes.string, 36 | subLabel: PropTypes.string, 37 | align: PropTypes.string, 38 | icon: PropTypes.string 39 | } 40 | 41 | export default BoxTitle; -------------------------------------------------------------------------------- /src/components/pages/Page404.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | 3 | /* libs */ 4 | import { Link } from 'react-router-dom'; 5 | import { 6 | Container, 7 | Row, 8 | Box, 9 | Form, 10 | FormGroup, 11 | Input, 12 | H1, 13 | H2} from '../styles'; 14 | 15 | const Page404 = (props) => { 16 | return( 17 | 18 | 19 | 20 | 21 |
    22 | 23 |
    24 |

    404

    25 |

    Page Not Found

    26 |

    Sorry, we can't find the page you are looking for

    27 |
    28 | 29 | 30 | 31 |
    32 | Go Back Home 33 |
    34 |
    35 |
    36 |
    37 | ); 38 | } 39 | 40 | export default Page404; -------------------------------------------------------------------------------- /src/sass/_mobile.scss: -------------------------------------------------------------------------------- 1 | @media (max-width: $mobile) { 2 | .top-navbar{ 3 | padding: 10px 20px 10px 20px !important; 4 | } 5 | 6 | .menu-navbar{ 7 | } 8 | 9 | .pull{ 10 | margin-top:-10px !important; 11 | } 12 | 13 | .submenu{ 14 | .horizontal-menu{ 15 | .title{ 16 | padding: 10px 22px 0px 22px; 17 | } 18 | 19 | ul{ 20 | padding: 10px 0px 10px 15px; 21 | } 22 | } 23 | } 24 | 25 | .content{ 26 | padding:0px !important; 27 | margin-top:20px; 28 | margin-bottom:20px; 29 | 30 | .title{ 31 | padding:0px 15px 0px 15px; 32 | } 33 | } 34 | 35 | /*======================= Components ============================ */ 36 | 37 | .row{ 38 | margin-right: 0px !important; 39 | margin-left: 0px !important; 40 | 41 | .custom-col{ 42 | padding-left: 0px !important; 43 | padding-right: 0px !important; 44 | } 45 | 46 | .col-box{ 47 | padding:10px; 48 | } 49 | } 50 | 51 | .custom-row{ 52 | margin-bottom:0px; 53 | } 54 | /*======================= Components ============================ */ 55 | 56 | /* pages */ 57 | .mail-table{ 58 | td{ 59 | font-size:$small-font-size - 2 !important; 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /src/components/styles/ProductCardPrice.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | import CurrencyFormat from 'react-currency-format'; 6 | 7 | const ProductCardPrice = (props) => { 8 | //get currency 9 | const currency = typeof props.currency !== 'undefined' ? props.currency : '$ '; 10 | 11 | //get price 12 | const price = typeof props.price !== 'undefined' ? props.price : 0; 13 | 14 | //get after discount price 15 | const afterDiscountPrice = typeof props.price !== 'undefined' ? props.afterDiscountPrice : 0; 16 | 17 | return( 18 |
    19 |
    0 ? 'discount' : '')}> 20 | {currency} 21 |
    22 | { afterDiscountPrice > 0 ? ( 23 |
    24 | {currency} 25 |
    26 | ): '' } 27 |
    28 | ); 29 | } 30 | 31 | //prop types initialize 32 | ProductCardPrice.propTypes = { 33 | currency: PropTypes.string, 34 | price: PropTypes.number, 35 | afterDiscountPrice: PropTypes.number, 36 | } 37 | 38 | export default ProductCardPrice; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "refast", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "apexcharts": "^3.10.1", 7 | "bootstrap": "^4.3.1", 8 | "font-awesome": "^4.7.0", 9 | "jquery": "^3.4.1", 10 | "moment": "^2.24.0", 11 | "node-sass": "^4.12.0", 12 | "popper.js": "^1.16.0", 13 | "prop-types": "^15.7.2", 14 | "react": "^16.10.2", 15 | "react-apexcharts": "^1.3.3", 16 | "react-big-calendar": "^0.23.0", 17 | "react-collapsed": "^2.2.2", 18 | "react-currency-format": "^1.0.0", 19 | "react-datetime": "^2.16.3", 20 | "react-dom": "^16.10.2", 21 | "react-range": "^1.4.3", 22 | "react-redux": "^7.1.1", 23 | "react-router-dom": "^5.1.2", 24 | "react-scripts": "3.2.0", 25 | "react-syntax-highlighter": "^11.0.2", 26 | "react-toastify": "^5.4.0", 27 | "redux": "^4.0.4", 28 | "redux-thunk": "^2.3.0" 29 | }, 30 | "scripts": { 31 | "start": "react-scripts start", 32 | "build": "react-scripts build", 33 | "test": "react-scripts test", 34 | "eject": "react-scripts eject" 35 | }, 36 | "eslintConfig": { 37 | "extends": "react-app" 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.2%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 1 chrome version", 47 | "last 1 firefox version", 48 | "last 1 safari version" 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/redux/actions/authAction.js: -------------------------------------------------------------------------------- 1 | import { IS_AUTHENTICATED, LOGIN, LOGOUT } from './actionTypes' 2 | import config from './../../config.js'; 3 | 4 | /* Login method */ 5 | export const login = (content, callBack) => { 6 | // user signed up success 7 | // set user to local storage 8 | localStorage.setItem(config.USER_KEY, JSON.stringify(content)); 9 | let user = localStorage.getItem(config.USER_KEY); 10 | 11 | //run callback 12 | callBack(); 13 | 14 | //return 15 | return { 16 | type: LOGIN, 17 | payload: JSON.parse(user) 18 | } 19 | } 20 | 21 | /* Logout method */ 22 | export const logout = (callBack) => dispatch => { 23 | // Sign-out successful. 24 | // remove user from local storage 25 | localStorage.removeItem(config.USER_KEY); 26 | 27 | //dispatch store 28 | dispatch({ 29 | type: LOGOUT 30 | }); 31 | 32 | //execute callback 33 | callBack(); 34 | } 35 | 36 | /* method to check if user already login or not */ 37 | export const isAuthenticated = () => { 38 | //set default value to false 39 | let isLocalStorageContainUser = false; 40 | 41 | //get user from localstorage 42 | let user = localStorage.getItem(config.USER_KEY); 43 | if(user!==null){ 44 | //authenticated user 45 | isLocalStorageContainUser = true; 46 | } 47 | 48 | return { 49 | type: IS_AUTHENTICATED, 50 | payload : isLocalStorageContainUser 51 | } 52 | } -------------------------------------------------------------------------------- /src/components/pages/components/AvatarPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { 5 | Box, 6 | Row, 7 | Container, 8 | BoxTitle, 9 | Avatar} from './../../styles'; 10 | /* Styles */ 11 | 12 | const AvatarPage = () => { 13 | return( 14 |
    15 |
    16 | Avatar 17 |
    18 | circle image for user avatar. 19 |
    20 |
    21 | 22 |
    23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
    40 |
    41 | ); 42 | } 43 | 44 | export default AvatarPage; -------------------------------------------------------------------------------- /src/components/styles/Checkbox.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Checkbox = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get label 11 | const label = typeof props.label !== 'undefined' ? props.label : ''; 12 | 13 | //get is circular 14 | const isCircular = typeof props.isCircular !== 'undefined' ? props.isCircular : false; 15 | 16 | //get checked 17 | const isChecked = typeof props.isChecked !== 'undefined' ? props.isChecked : false; 18 | 19 | return( 20 | 21 | 28 | 29 | { label } 30 | 31 | 32 | ); 33 | } 34 | 35 | //prop types initialize 36 | Checkbox.propTypes = { 37 | className : PropTypes.string, 38 | handleChange: PropTypes.func, 39 | label: PropTypes.string, 40 | isChecked : PropTypes.bool, 41 | isCircular: PropTypes.bool 42 | } 43 | 44 | 45 | export default Checkbox; -------------------------------------------------------------------------------- /src/components/styles/Col.js: -------------------------------------------------------------------------------- 1 | //default react 2 | import React from 'react'; 3 | 4 | //libs 5 | import PropTypes from 'prop-types'; // prop types 6 | 7 | const Col = (props) => { 8 | //default bootstrap col grid size 9 | const xs = typeof props.xs !== 'undefined' ? ' col-'+props.xs : ''; 10 | const xsOffset = typeof props.xsOffset !== 'undefined' ? ' offset-'+props.xsOffset : ''; 11 | 12 | const sm = typeof props.sm !== 'undefined' ? ' col-sm-'+props.sm : ''; 13 | const smOffset = typeof props.smOffset !== 'undefined' ? ' offset-sm-'+props.smOffset : ''; 14 | 15 | const md = typeof props.md !== 'undefined' ? ' col-md-'+props.md : ''; 16 | const mdOffset = typeof props.mdOffset !== 'undefined' ? ' offset-md-'+props.mdOffset : ''; 17 | 18 | const lg = typeof props.lg !== 'undefined' ? ' col-lg-'+props.lg : ''; 19 | const lgOffset = typeof props.lgOffset !== 'undefined' ? ' offset-lg-'+props.lgOffset : ''; 20 | 21 | //get custom class 22 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 23 | 24 | return( 25 |
    26 | { props.children } 27 |
    28 | ); 29 | } 30 | 31 | //prop types initialize 32 | Col.propTypes = { 33 | style : PropTypes.object, 34 | className: PropTypes.string, 35 | xs: PropTypes.number, 36 | sm: PropTypes.number, 37 | md: PropTypes.number, 38 | lg: PropTypes.number 39 | } 40 | 41 | export default Col; -------------------------------------------------------------------------------- /src/components/pages/components/HeaderPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { 5 | Box, 6 | Row, 7 | Container, 8 | H1, 9 | H2, 10 | H3, 11 | H4, 12 | H5, 13 | BoxTitle} from './../../styles'; 14 | /* Styles */ 15 | 16 | const BadgePage = () => { 17 | return( 18 |
    19 |
    20 | Header 21 |
    22 | various header text size. 23 |
    24 |
    25 | 26 |
    27 | 28 | 29 | 30 | 31 |

    Header 1

    32 |

    Header 2

    33 |

    Header 3

    34 |

    Header 4

    35 |
    Header 5
    36 |
    37 | 38 | 39 |

    Header 1 Center

    40 |

    Header 2 Left

    41 |

    Header 3 Right

    42 |

    Header 4 Center

    43 |
    Header 5 Right
    44 |
    45 |
    46 |
    47 |
    48 |
    49 | ); 50 | } 51 | 52 | export default BadgePage; -------------------------------------------------------------------------------- /src/components/pages/documentation/components/Avatar.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import DocsExample from './../DocsExample'; 3 | import { 4 | Avatar 5 | } from '../../../styles'; 6 | 7 | const Avatars = () => { 8 | return ( 9 | 10 | 14 | 15 | 16 | 17 | 18 | )} 19 | code={( 20 | `import React from 'react'; 21 | import { Avatar } from './styles'; 22 | 23 | const Avatars = () => { 24 | return( 25 |
    26 | 27 | 28 | 29 |
    30 | ) 31 | } 32 | 33 | export default Avatars; 34 | ` 35 | )} 36 | properties={( 37 | `Avatar.propTypes = { 38 | style : PropTypes.object, //your custom style object here 39 | className : PropTypes.string, //your custom styling class here 40 | alt : PropTypes.string, //avatar image alt properties 41 | src : PropTypes.string, //image source 42 | size : PropTypes.oneOf(['small', 'medium', 'large']), //avatar size 43 | }` 44 | )} 45 | /> 46 | 47 |
    48 | ) 49 | } 50 | 51 | export default Avatars; -------------------------------------------------------------------------------- /src/components/layouts/MessageContainer.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | //components 7 | import MessagePreview from './MessagePreview'; 8 | 9 | const MessageContainer = (props) => { 10 | //get is open 11 | const isOpen = typeof props.isOpen !== 'undefined' ? props.isOpen : false; 12 | let navWidthResult = isOpen ? '320px' : '0px'; 13 | 14 | /* Set the width of the side navigation to 0 */ 15 | const closeNav = () => { 16 | props.setOpenMessage(false); 17 | } 18 | 19 | return( 20 |
    23 |
    24 |  Messages 25 |
    26 | × 27 | 28 | 36 | 44 |
    45 | ); 46 | } 47 | 48 | //prop types initialize 49 | MessageContainer.propTypes = { 50 | isOpen : PropTypes.bool, 51 | } 52 | 53 | export default MessageContainer; -------------------------------------------------------------------------------- /src/redux/reducers/authReducer.js: -------------------------------------------------------------------------------- 1 | import { IS_AUTHENTICATED, LOGIN, LOGOUT } from '../actions/actionTypes'; 2 | import config from './../../config.js'; 3 | 4 | //set default value for authentication 5 | let isAuth = false; 6 | let userObj = {}; 7 | 8 | //method to get user token from local storage 9 | // return true is user token exist in localStorage 10 | // return false if isnt 11 | const authenticatingFromLocalStorage = () => { 12 | let user = JSON.parse(localStorage.getItem(config.USER_KEY)); 13 | if(user!==null){ 14 | userObj = user; 15 | isAuth = true; 16 | }else{ 17 | userObj = {}; 18 | isAuth = false; 19 | } 20 | } 21 | 22 | //run method above 23 | authenticatingFromLocalStorage(); 24 | 25 | //insert auth and user obj initial state 26 | const initialState = { 27 | isAuthenticated : isAuth, 28 | user: userObj 29 | } 30 | 31 | export default (state = initialState, action) => { 32 | switch(action.type){ 33 | case IS_AUTHENTICATED: 34 | return Object.assign( 35 | {}, 36 | state, 37 | { 38 | isAuthenticated: action.payload 39 | } 40 | ) 41 | case LOGIN: 42 | return Object.assign( 43 | {}, 44 | state, 45 | { 46 | isAuthenticated: true, 47 | user: action.payload 48 | } 49 | ) 50 | case LOGOUT: 51 | return Object.assign( 52 | {}, 53 | state, 54 | { 55 | isAuthenticated: false, 56 | user: {} 57 | } 58 | ) 59 | default: 60 | return (state); 61 | } 62 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 16 | 17 | 26 | Refast - React Admin Template 27 | 28 | 29 | 30 |
    31 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/components/styles/Badge.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Badge = (props) => { 7 | //get badge type 8 | const badgeType = typeof props.type !== 'undefined' ? props.type : ''; 9 | 10 | //get badge message 11 | const badgeMessage = typeof props.message !== 'undefined' ? props.message : ''; 12 | 13 | //get badge icon 14 | const badgeIcon = typeof props.icon !== 'undefined' ? props.icon : ''; 15 | 16 | //get badge image 17 | const badgeImage = typeof props.image !== 'undefined' ? props.image : ''; 18 | 19 | //get custom class 20 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 21 | 22 | //get size 23 | const size = typeof props.size !== 'undefined' ? ' '+props.size+' ' : ' medium '; 24 | 25 | return( 26 |
    27 | {/* Badge Image */} 28 | { badgeImage !== '' ? ( 29 |
    30 | {""}/ 31 |
    32 | ) : '' } 33 | 34 | {/* Badge Icon */} 35 | { badgeIcon !== '' ? ( 36 | 37 | ) : '' } 38 | 39 | {/* Badge Label */} 40 | 41 | { badgeMessage } 42 | 43 |
    44 | ); 45 | } 46 | 47 | //prop types initialize 48 | Badge.propTypes = { 49 | style : PropTypes.object, 50 | className: PropTypes.string, 51 | message: PropTypes.any, 52 | type: PropTypes.oneOf(['primary', 'success', 'danger', 'warning', 'info']), 53 | size: PropTypes.oneOf(["small", "medium", "large"]), 54 | icon: PropTypes.string 55 | } 56 | 57 | export default Badge; -------------------------------------------------------------------------------- /src/components/pages/ResetPasswordPage.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { Box, BoxTitle, Form, FormGroup, Input, Button, H4 } from '../styles'; 4 | 5 | const ResetPasswordPage = () => { 6 | /* hooks */ 7 | const [newPassword, setNewPassword] = useState(''); 8 | 9 | return( 10 |
    11 | {/* logo and header information */} 12 |
    13 | logo 14 |
    15 | REACT ADMIN TEMPLATE 16 |
    17 |
    18 | 19 | {/* content form */} 20 | 21 | 22 |
    { 23 | e.preventDefault(); 24 | alert("Password has been reset."); 25 | }}> 26 | 27 | { setNewPassword(e.target.value) }}/> 34 | 35 | 36 |
    42 | ); 43 | } 44 | 45 | export default ResetPasswordPage; -------------------------------------------------------------------------------- /src/components/pages/documentation/DocsExample.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; 3 | import { darcula as myStyle } from 'react-syntax-highlighter/dist/esm/styles/prism'; 4 | 5 | const DocsExample = (props) => { 6 | return ( 7 |
    8 |
    9 | {/* render example */} 10 | { typeof props.example !== 'undefined' ? ( 11 |
    12 | { typeof props.title !== 'undefined' ? ( 13 |
    14 | { props.title } 15 |
    16 | ) : '' } 17 | { props.example } 18 |
    19 | ) : '' } 20 | 21 | {/* render code */} 22 | { typeof props.code !== 'undefined' ? ( 23 |
    24 | 25 | { props.code } 26 | 27 |
    28 | ) : '' } 29 |
    30 | 31 | {/* render prop types */} 32 | { typeof props.properties !== 'undefined' ? ( 33 |
    34 |
    35 | Properties 36 |
    37 | 38 | { props.properties } 39 | 40 |
    41 | ) : '' } 42 |
    43 | ) 44 | } 45 | 46 | export default DocsExample; -------------------------------------------------------------------------------- /src/components/pages/ForgotPasswordPage.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { Box, BoxTitle, Form, FormGroup, Input, Button, H4 } from '../styles'; 4 | 5 | const ForgotPasswordPage = () => { 6 | /* hooks */ 7 | const [email, setEmail] = useState(''); 8 | 9 | return( 10 |
    11 | {/* logo and header information */} 12 |
    13 | logo 14 |
    15 | REACT ADMIN TEMPLATE 16 |
    17 |
    18 | 19 | {/* content form */} 20 | 21 | 22 |
    { 23 | e.preventDefault(); 24 | alert("Email sent to: "+email); 25 | }}> 26 | 27 | { setEmail(e.target.value) }}/> 33 | 34 | 35 |
    41 | ); 42 | } 43 | 44 | export default ForgotPasswordPage; -------------------------------------------------------------------------------- /src/components/pages/components/CarouselPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, Row, Container, Carousel, BoxTitle } from './../../styles'; 5 | /* Styles */ 6 | 7 | const CarouselPage = () => { 8 | 9 | const carouselImages = [ 10 | { 11 | image: '/images/slider1.jpg', 12 | useCaption : false, 13 | handleClick : () => { 14 | alert("Carousel clicked"); 15 | } 16 | }, 17 | { 18 | image: '/images/slider2.jpg', 19 | useCaption : true, 20 | captionColor : '#000', 21 | title: 'Caption Title', 22 | subTitle: 'Caption Sub Title or Paragraph Here.' 23 | }, 24 | { 25 | image: '/images/slider3.jpg', 26 | useCaption : false 27 | } 28 | ]; 29 | 30 | return( 31 |
    32 |
    33 | Carousel 34 |
    35 | a slideshow component. 36 |
    37 |
    38 | 39 |
    40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | ); 55 | } 56 | 57 | export default CarouselPage; -------------------------------------------------------------------------------- /src/components/styles/Box.js: -------------------------------------------------------------------------------- 1 | //default react 2 | import React from 'react'; 3 | 4 | //libs 5 | import PropTypes from 'prop-types'; // prop types 6 | 7 | const Box = (props) => { 8 | //default bootstrap col grid size 9 | const xs = typeof props.xs !== 'undefined' ? ' col-'+props.xs : ''; 10 | const xsOffset = typeof props.xsOffset !== 'undefined' ? ' offset-'+props.xsOffset : ''; 11 | 12 | const sm = typeof props.sm !== 'undefined' ? ' col-sm-'+props.sm : ''; 13 | const smOffset = typeof props.smOffset !== 'undefined' ? ' offset-sm-'+props.smOffset : ''; 14 | 15 | const md = typeof props.md !== 'undefined' ? ' col-md-'+props.md : ''; 16 | const mdOffset = typeof props.mdOffset !== 'undefined' ? ' offset-md-'+props.mdOffset : ''; 17 | 18 | const lg = typeof props.lg !== 'undefined' ? ' col-lg-'+props.lg : ''; 19 | const lgOffset = typeof props.lgOffset !== 'undefined' ? ' offset-lg-'+props.lgOffset : ''; 20 | 21 | //get custom class 22 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 23 | 24 | //get transparent 25 | const isTransparent = typeof props.isTransparent !== 'undefined' ? (props.isTransparent ? ' transparent' : '') : ''; 26 | 27 | return( 28 |
    29 |
    30 | { props.children } 31 |
    32 |
    33 | ); 34 | } 35 | 36 | //prop types initialize 37 | Box.propTypes = { 38 | style : PropTypes.object, 39 | className: PropTypes.string, 40 | xs: PropTypes.number, 41 | xsOffset: PropTypes.number, 42 | sm: PropTypes.number, 43 | smOffset: PropTypes.number, 44 | md: PropTypes.number, 45 | mdOffset: PropTypes.number, 46 | lg: PropTypes.number, 47 | lgOffset: PropTypes.number, 48 | isTransparent: PropTypes.bool, 49 | } 50 | 51 | export default Box; -------------------------------------------------------------------------------- /src/components/pages/components/AlertPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, BoxTitle, Row, Container, Alert } from './../../styles'; 5 | /* Styles */ 6 | 7 | const AlertPage = () => { 8 | return( 9 |
    10 |
    11 | Alerts 12 |
    13 | show text messages with colorful background and informative icon. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
    39 |
    40 | ); 41 | } 42 | 43 | export default AlertPage; -------------------------------------------------------------------------------- /src/components/styles/Alert.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Alert = (props) => { 7 | //get alert type 8 | const alertType = typeof props.type !== 'undefined' ? props.type : ''; 9 | 10 | //get alert message 11 | const alertMessage = typeof props.message !== 'undefined' ? props.message : ''; 12 | 13 | //get alert icon 14 | const withIcon = typeof props.icon !== 'undefined' ? props.icon : false; 15 | let alertIcon = ''; 16 | if(withIcon){ 17 | switch(alertType.toLowerCase()){ 18 | case 'success': 19 | alertIcon = 'fa fa-check-circle' 20 | break; 21 | case 'danger': 22 | alertIcon = 'fa fa-exclamation' 23 | break; 24 | case 'warning': 25 | alertIcon = 'fa fa-info-circle' 26 | break; 27 | case 'primary': 28 | alertIcon = 'fa fa-star' 29 | break; 30 | case 'info': 31 | alertIcon = 'fa fa-paper-plane' 32 | break; 33 | default: 34 | alertIcon = ''; 35 | break; 36 | } 37 | } 38 | 39 | //get custom class 40 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 41 | 42 | return( 43 |
    44 | { withIcon ? ( 45 |
    46 | 47 |
    48 | ) : '' } 49 |
    50 | { alertMessage } 51 |
    52 |
    53 | ); 54 | } 55 | 56 | //prop types initialize 57 | Alert.propTypes = { 58 | style : PropTypes.object, 59 | className: PropTypes.string, 60 | message: PropTypes.any, 61 | type: PropTypes.oneOf(['primary', 'success', 'danger', 'warning', 'info']), 62 | icon: PropTypes.bool 63 | } 64 | 65 | export default Alert; -------------------------------------------------------------------------------- /src/components/pages/documentation/components/Header.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import DocsExample from './../DocsExample'; 3 | import { 4 | H1, 5 | H2, 6 | H3, 7 | H4, 8 | H5, 9 | } from '../../../styles'; 10 | 11 | const Header = () => { 12 | return ( 13 | 14 | 18 |

    Header 1

    19 |

    Header 2

    20 |

    Header 3

    21 |

    Header 4

    22 |
    Header 5
    23 | 24 | )} 25 | code={( 26 | `import React from 'react'; 27 | import { H1, H2, H3, H4, H5 } from './styles'; 28 | 29 | const Header = () => { 30 | return( 31 |
    32 |

    Header 1

    33 |

    Header 2

    34 |

    Header 3

    35 |

    Header 4

    36 |
    Header 5
    37 |
    38 | ) 39 | } 40 | 41 | export default Header; 42 | ` 43 | )} 44 | properties={( 45 | `H.propTypes = { 46 | style : PropTypes.object, 47 | className : PropTypes.string, 48 | align : PropTypes.oneOf(['left', 'center', 'right']) 49 | }` 50 | )} 51 | /> 52 | 56 |

    Header 1

    57 |

    Header 2

    58 |

    Header 3

    59 | 60 | )} 61 | code={( 62 | `import React from 'react'; 63 | import { H1, H2, H3 } from './styles'; 64 | 65 | const Header = () => { 66 | return( 67 |
    68 |

    Header 1

    69 |

    Header 2

    70 |

    Header 3

    71 |
    72 | ) 73 | } 74 | 75 | export default Header; 76 | ` 77 | )} 78 | /> 79 |
    80 | ) 81 | } 82 | 83 | export default Header; -------------------------------------------------------------------------------- /src/components/styles/Select.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Select = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get name 11 | const inputName = typeof props.name !== 'undefined' ? props.name : ''; 12 | 13 | //get placeholder 14 | const placeholder = typeof props.placeholder !== 'undefined' ? props.placeholder : ''; 15 | 16 | //get id 17 | const inputId = typeof props.id !== 'undefined' ? props.id : 'text'; 18 | 19 | //get required 20 | const isRequired = typeof props.required !== 'undefined' ? props.required : false; 21 | 22 | //get is valid 23 | const isValid = typeof props.isValid !== 'undefined' ? (props.isValid ? 'valid ' : 'invalid ') : ' '; 24 | 25 | //get message 26 | let message = typeof props.message !== 'undefined' ? props.message : ''; 27 | 28 | //custom attr 29 | let attrs = {}; 30 | if(inputId !== ''){ 31 | attrs['id'] = inputId; 32 | } 33 | attrs['required'] = isRequired; 34 | 35 | return( 36 |
    37 | { message !== '' ? ( 38 |
    39 | { message } 40 |
    41 | ) : '' } 42 | 54 |
    55 | ); 56 | } 57 | 58 | //prop types initialize 59 | Select.propTypes = { 60 | className : PropTypes.string, 61 | name : PropTypes.string, 62 | value : PropTypes.any, 63 | id : PropTypes.string, 64 | placeholder : PropTypes.string, 65 | required : PropTypes.bool, 66 | handleChange : PropTypes.func, 67 | isValid : PropTypes.bool, 68 | message : PropTypes.string, 69 | } 70 | 71 | export default Select; -------------------------------------------------------------------------------- /src/components/pages/components/BreadcrumbsPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, Row, Container, Breadcrumb, BreadcrumbItem } from './../../styles'; 5 | /* Styles */ 6 | 7 | const BreadcrumbsPage = () => { 8 | return( 9 |
    10 |
    11 | Breadcrumbs 12 |
    13 | give information about current page navigation. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 | 22 | 23 | Products 24 | 25 | 26 | 27 | 28 | 29 | 30 | Products 31 | 32 | 33 | Men's 34 | 35 | 36 | 37 | 38 | 39 | 40 | Products 41 | 42 | 43 | Men's 44 | 45 | 46 | Watch 47 | 48 | 49 | 50 | 51 | 52 |
    53 |
    54 | ); 55 | } 56 | 57 | export default BreadcrumbsPage; -------------------------------------------------------------------------------- /src/components/pages/components/BoxPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, BoxTitle, Row, Container } from './../../styles'; 5 | /* Styles */ 6 | 7 | const BoxPage = () => { 8 | return( 9 |
    10 |
    11 | Box 12 |
    13 | rectangle white box with shadow. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 | small 6 22 |
    23 | medium 4 24 |
    25 | large 3 26 |
    27 | 28 | small 6 29 |
    30 | medium 6 31 |
    32 | large 9 33 |
    34 |
    35 | 36 | 37 | medium 8, offset 2 38 |
    39 | large 6, offset 3 40 |
    41 |
    42 | 43 | 44 | 45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 46 | 47 | 48 | 49 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 50 | 51 | 52 | 53 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 54 | 55 | 56 |
    57 |
    58 |
    59 | ); 60 | } 61 | 62 | export default BoxPage; -------------------------------------------------------------------------------- /src/components/styles/Menu.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment, useState } from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Menu = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get label 11 | const label = typeof props.label !== 'undefined' ? props.label : ''; 12 | 13 | //get children 14 | const children = typeof props.children !== 'undefined' ? props.children : ''; 15 | 16 | //get id 17 | const id = typeof props.id !== 'undefined' ? props.id : ''; 18 | 19 | //get is submenu 20 | const isSubmenu = typeof props.isSubmenu !== 'undefined' ? props.isSubmenu : false; 21 | 22 | //hooks 23 | const [openSubmenu, setOpenSubmenu] = useState(false); 24 | 25 | //custom attr 26 | let attrs = {}; 27 | if(id !== ''){ 28 | attrs['id'] = id; 29 | } 30 | 31 | return( 32 | 33 | { isSubmenu ? ( 34 | //submenu 35 |
  • {setOpenSubmenu(false)}} className={customClassName}> 36 | { 37 | setOpenSubmenu(!openSubmenu) 38 | }}> 39 | {/* show label */} 40 | { label } 41 | 42 | {/* show arrow icon */} 43 | { children!=='' ? ( 44 | 49 | ) : '' } 50 | 51 | {/* checkbox to show submenu or hide */} 52 | setOpenSubmenu(e.checked)}/> 53 | 54 | {/* submenu area */} 55 | 58 |
  • 59 | ) : ( 60 | //normal menu, only show link 61 | children 62 | ) } 63 |
    64 | 65 | 66 | ); 67 | } 68 | 69 | //prop types initialize 70 | Menu.propTypes = { 71 | style : PropTypes.object, 72 | className: PropTypes.string, 73 | isSubmenu: PropTypes.bool, 74 | id: PropTypes.any, 75 | label: PropTypes.any 76 | } 77 | 78 | export default Menu; -------------------------------------------------------------------------------- /src/components/styles/Modal.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | //styles 7 | import H2 from './H2'; 8 | 9 | //jquery 10 | import $ from 'jquery'; 11 | window.$ = $; 12 | 13 | 14 | const Modal = (props) => { 15 | //get custom class 16 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 17 | 18 | //get size 19 | const size = typeof props.size !== 'undefined' ? props.size : 'medium'; 20 | let modalSize; 21 | switch(size){ 22 | case 'small': 23 | modalSize = 'modal-sm' 24 | break; 25 | case 'medium': 26 | modalSize = '' 27 | break; 28 | case 'large': 29 | modalSize = 'modal-lg' 30 | break; 31 | default: 32 | modalSize = ''; 33 | break; 34 | } 35 | 36 | // my modal ref 37 | let myModal = React.createRef(); 38 | 39 | //is modal open 40 | const isShow = typeof props.isShow !== 'undefined' ? props.isShow : false; 41 | 42 | useEffect(() => { 43 | //trigger modal to show or hide 44 | if(isShow){ 45 | $(myModal.current).modal('show'); 46 | }else{ 47 | $(myModal.current).modal('hide'); 48 | } 49 | }); 50 | 51 | return( 52 | /* Modal */ 53 |
    54 |
    55 |
    56 |
    57 | { typeof props.title !== 'undefined' ? ( 58 |

    { props.title }

    59 | ) : '' } 60 | 61 | 64 |
    65 | 66 | {/* modal body */} 67 |
    68 | { props.children } 69 |
    70 |
    71 |
    72 |
    73 | ); 74 | } 75 | 76 | //prop types initialize 77 | Modal.propTypes = { 78 | style : PropTypes.object, 79 | className : PropTypes.string, 80 | isShow : PropTypes.bool, 81 | handleButtonCloseClick : PropTypes.func, 82 | size : PropTypes.oneOf(['small', 'medium', 'large']), 83 | } 84 | 85 | export default Modal; -------------------------------------------------------------------------------- /src/components/styles/IconCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | import CurrencyFormat from 'react-currency-format'; 6 | 7 | const IconCard = (props) => { 8 | //get custom class 9 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 10 | 11 | //get label 12 | const label = typeof props.label !== 'undefined' ? props.label : ''; 13 | 14 | //get icon 15 | const icon = typeof props.icon !== 'undefined' ? props.icon : ''; 16 | 17 | //get number 18 | const number = typeof props.number !== 'undefined' ? props.number : ''; 19 | 20 | //get number 21 | const align = typeof props.align !== 'undefined' ? props.align : ''; 22 | 23 | //get statistic 24 | const statisticValue = typeof props.statisticValue !== 'undefined' ? props.statisticValue : ''; 25 | const statisticPostfix = typeof props.statisticPostfix !== 'undefined' ? props.statisticPostfix : ''; 26 | const getStatistic = (statisticValue) => { 27 | return( 28 | 0 ? 'green' : 'red'}> 29 |   30 |   31 | { statisticValue > 0 ? ( 32 | 33 | ) : ( 34 | 35 | ) } 36 |  {Math.abs(statisticValue)+ '' +statisticPostfix} 37 | 38 | ) 39 | } 40 | 41 | return( 42 |
    43 | {/* main content */} 44 |
    45 | { icon !== '' ? ( 46 |
    47 | 48 |
    ) : '' } 49 | 50 |
    51 | { label.toUpperCase() } 52 | { statisticValue !== '' ? ( 53 | getStatistic(statisticValue) 54 | ) : '' } 55 |
    56 |
    57 | 58 |
    59 |
    60 |
    61 | ); 62 | } 63 | 64 | //prop types initialize 65 | IconCard.propTypes = { 66 | style : PropTypes.object, 67 | className: PropTypes.string, 68 | align: PropTypes.oneOf(['left', 'center', 'right']), 69 | label: PropTypes.string, 70 | icon: PropTypes.string, 71 | number: PropTypes.number, 72 | statisticValue: PropTypes.number, 73 | statisticPostfix: PropTypes.string, 74 | } 75 | 76 | export default IconCard; -------------------------------------------------------------------------------- /src/components/styles/Accordion.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Accordion = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get id 11 | const id = typeof props.id !== 'undefined' ? props.id : 'accordionExample'; 12 | 13 | //get items 14 | const accordionItems = typeof props.items !== 'undefined' ? props.items : []; 15 | 16 | //prepare is open 17 | accordionItems.map((item, index) => { 18 | if(index === 0){ 19 | item.isOpen = true; 20 | }else{ 21 | item.isOpen = false; 22 | } 23 | 24 | return item; 25 | }); 26 | 27 | //use hooks 28 | const [items, setItems] = useState(accordionItems); 29 | 30 | const handleHeaderClick = (itemIndex) => { 31 | let newItems = items.map((item, index) => { 32 | let newItem = Object.assign({}, item); 33 | if(index === itemIndex){ 34 | newItem.isOpen = !item.isOpen; 35 | }else{ 36 | newItem.isOpen = false; 37 | } 38 | return newItem; 39 | }); 40 | 41 | setItems(newItems); 42 | } 43 | 44 | return( 45 |
    46 | { items.map((item, index) => ( 47 |
    48 |
    49 |
    50 | 53 |
    54 | 55 |
    56 | 57 |
    58 |
    59 |
    60 |
    61 | { item.body } 62 |
    63 |
    64 |
    65 | )) } 66 |
    67 | ); 68 | } 69 | 70 | //prop types initialize 71 | Accordion.propTypes = { 72 | style : PropTypes.object, 73 | className : PropTypes.string, 74 | items : PropTypes.array, 75 | id : PropTypes.string 76 | } 77 | 78 | export default Accordion; -------------------------------------------------------------------------------- /src/components/styles/ProgressBar.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const ProgressBar = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get percentage 11 | const percentage = typeof props.percentage !== 'undefined' ? (props.percentage < 10 ? 10 : props.percentage) : 10; 12 | 13 | //get size 14 | const size = typeof props.size !== 'undefined' ? ' '+props.size+' ' : ' medium '; 15 | 16 | //get fill color 17 | const inputfillType = typeof props.color !== 'undefined' ? props.color : 'primary'; 18 | let useAnotherColor = false; 19 | let anotherColor = ''; 20 | let fill; 21 | switch(inputfillType){ 22 | case 'success': 23 | fill = 'success'; 24 | break; 25 | case 'danger': 26 | fill = 'danger'; 27 | break; 28 | case 'warning': 29 | fill = 'warning'; 30 | break; 31 | case 'primary': 32 | fill = 'primary' 33 | break; 34 | case 'info': 35 | fill = 'info' 36 | break; 37 | default: 38 | useAnotherColor = true; 39 | anotherColor = props.color; 40 | break; 41 | } 42 | //check if use another color or not 43 | fill = useAnotherColor ? '' : ' progress-bar-'+fill; 44 | 45 | /* custom style */ 46 | let style = { 47 | width : (percentage + '%') 48 | } 49 | //check if use another color 50 | if(useAnotherColor){ 51 | style['backgroundColor'] = anotherColor; 52 | } 53 | 54 | //get label 55 | const label = typeof props.label !== 'undefined' ? props.label : ''; 56 | 57 | //get show label 58 | const showLabel = typeof props.showLabel !== 'undefined' ? props.showLabel : false; 59 | 60 | //get label position 61 | const labelPosition = typeof props.labelPosition !== 'undefined' ? props.labelPosition : 'left'; 62 | 63 | return( 64 |
    65 |
    66 | {/* progress bar fill */} 67 |
    68 |
    69 | 70 | {/* progress label */} 71 | { showLabel ? ( 72 |
    { label }
    73 | ) : '' } 74 |
    75 | ); 76 | } 77 | 78 | //prop types initialize 79 | ProgressBar.propTypes = { 80 | className : PropTypes.string, 81 | percentage : PropTypes.number, 82 | size : PropTypes.oneOf(['small', 'medium', 'large']), 83 | label : PropTypes.any, 84 | labelPosition : PropTypes.oneOf(['left', 'center', 'right']), 85 | showLabel : PropTypes.bool, 86 | color : PropTypes.string 87 | } 88 | 89 | export default ProgressBar; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
    10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
    13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
    18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
    23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
    26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /src/components/pages/components/ChartsPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, Row, Container, ChartDonut, ChartPie, ChartRadar, ChartLine, ChartBar } from './../../styles'; 5 | /* Styles */ 6 | 7 | const ChartsPage = () => { 8 | //donut items 9 | const donutItems = [ 10 | { 11 | label: 'Android', 12 | data: 1040, 13 | color: "#7757F7" 14 | }, 15 | { 16 | label: 'iOS', 17 | data: 674, 18 | color: "#6E55CE" 19 | }, 20 | { 21 | label: 'Win. Phone', 22 | data: 233, 23 | color: "#5742A7" 24 | } 25 | ]; 26 | 27 | //radar items 28 | const radarItems = { 29 | labels : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'], 30 | data : [{ 31 | label: 'Android Downloads', 32 | color:'#7757F7', 33 | data : [203, 175, 377, 245, 289, 200] 34 | }, 35 | { 36 | label: 'iOS Downloads', 37 | color:'#6E55CE', 38 | data : [14, 33, 85, 124, 203, 201] 39 | }] 40 | }; 41 | 42 | //line items 43 | const lineItems = { 44 | labels : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'], 45 | data : [ 46 | { 47 | label: 'Android Downloads', 48 | color:'#7757F7', 49 | data : [203, 175, 377, 245, 289, 200] 50 | }, 51 | { 52 | label: 'iOS Downloads', 53 | color:'#6E55CE', 54 | data : [14, 33, 85, 124, 203, 201] 55 | } 56 | ] 57 | }; 58 | 59 | return( 60 |
    61 |
    62 | Charts 63 |
    64 | various chart styles with ApexChart. 65 |
    66 |
    67 | 68 |
    69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
    91 |
    92 | ); 93 | } 94 | 95 | export default ChartsPage; -------------------------------------------------------------------------------- /src/components/styles/Carousel.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Carousel = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get unique id 11 | const id = typeof props.id !== 'undefined' ? props.id : 'myCarousel'; 12 | 13 | //get array of item 14 | const items = typeof props.items !== 'undefined' ? props.items : []; 15 | 16 | //get indicators 17 | const indicators = typeof props.indicators !== 'undefined' ? props.indicators : true; 18 | 19 | //get controls 20 | const useControls = typeof props.controls !== 'undefined' ? props.controls : true; 21 | 22 | return( 23 |
    24 | {/* Indicators */} 25 | {indicators ? ( 26 |
      27 | { items.map((item, index) => ( 28 |
    1. 29 | )) } 30 |
    31 | ) : ''} 32 | 33 | {/* Main Carousel Items */} 34 |
    35 | { items.map((item, index) => ( 36 |
    37 | {""} 38 | { item.useCaption ? ( 39 |
    40 |

    { item.title }

    41 |
    { item.subTitle }
    42 |
    43 | ) : '' } 44 |
    45 | )) } 46 |
    47 | 48 | {/* Controls */} 49 | { useControls ? ( 50 |
    51 | 52 | 53 | Previous 54 | 55 | 56 | 57 | Next 58 | 59 |
    60 | ) : '' } 61 |
    62 | ); 63 | } 64 | 65 | //prop types initialize 66 | Carousel.propTypes = { 67 | className: PropTypes.string, 68 | id : PropTypes.string, 69 | items : PropTypes.array, 70 | indicators : PropTypes.bool, 71 | controls : PropTypes.bool, 72 | } 73 | 74 | export default Carousel; -------------------------------------------------------------------------------- /src/components/pages/components/BadgePage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, BoxTitle, Row, Container, Badge } from './../../styles'; 5 | /* Styles */ 6 | 7 | const BadgePage = () => { 8 | return( 9 |
    10 |
    11 | Badges 12 |
    13 | show small text with icon and image in various background color. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 |
    22 | 23 | 24 | 25 | 26 | 27 | 28 |
    29 |
    30 | 31 |
    32 | 33 | 34 | 35 | 36 | 37 | 38 |
    39 |
    40 | 41 |
    42 | 43 | 44 | 45 |
    46 |
    47 |
    48 | 49 | 50 |
    51 | 52 | 53 | 54 | 55 |
    56 |
    57 |
    58 |
    59 |
    60 |
    61 | ); 62 | } 63 | 64 | export default BadgePage; -------------------------------------------------------------------------------- /src/components/styles/UserCard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const UserCard = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get avatar 11 | const avatar = typeof props.avatar !== 'undefined' ? props.avatar : ''; 12 | 13 | //get background 14 | const background = typeof props.background !== 'undefined' ? props.background : ''; 15 | 16 | //get title 17 | const title = typeof props.title !== 'undefined' ? props.title : ''; 18 | 19 | //get sub title 20 | const subTitle = typeof props.subTitle !== 'undefined' ? props.subTitle : ''; 21 | 22 | //get button outlined 23 | const isHorizontal = typeof props.isHorizontal !== 'undefined' ? props.isHorizontal : false; 24 | 25 | //get is handle click 26 | const isHandleClick = typeof props.handleClick !== 'undefined' ? ' click-available ' : ' '; 27 | 28 | return( 29 |
    30 | { isHorizontal ? ( 31 | // horizontal 32 |
    33 |
    34 | {""} 35 |
    36 |
    37 |
    38 | { title } 39 |
    40 |
    41 | { subTitle } 42 |
    43 |
    44 | { props.children } 45 |
    46 |
    47 |
    48 | ) : ( 49 | // vertical 50 |
    51 |
    52 | { background!=='' ? ( 53 | {""} 54 | ) : '' } 55 |
    56 |
    57 | {""} 58 |
    59 |
    60 | { title } 61 |
    62 |
    63 | { subTitle } 64 |
    65 |
    66 | { props.children } 67 |
    68 |
    69 | ) } 70 | 71 | 72 |
    73 | ); 74 | } 75 | 76 | //prop types initialize 77 | UserCard.propTypes = { 78 | className: PropTypes.string, 79 | avatar: PropTypes.string, 80 | background: PropTypes.string, 81 | title: PropTypes.string, 82 | subTitle: PropTypes.string, 83 | isHorizontal: PropTypes.bool, 84 | handleClick: PropTypes.func, 85 | } 86 | 87 | export default UserCard; -------------------------------------------------------------------------------- /src/components/pages/documentation/components/Alerts.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import DocsExample from './../DocsExample'; 3 | import { 4 | Alert 5 | } from '../../../styles'; 6 | 7 | const Alerts = () => { 8 | return ( 9 | 10 | 14 | 15 | 16 | 17 | 18 | 19 |
    20 | )} 21 | code={( 22 | `import React from 'react'; 23 | import { Alert } from './styles'; 24 | 25 | const Alerts = () => { 26 | return( 27 |
    28 | 29 | 30 | 31 | 32 | 33 |
    34 | ) 35 | } 36 | 37 | export default Alerts; 38 | ` 39 | )} 40 | properties={( 41 | `Alert.propTypes = { 42 | style : PropTypes.object, //your custom style object here 43 | className: PropTypes.string, //your custom styling class here 44 | message: PropTypes.string, //alert message text 45 | type: PropTypes.oneOf(['primary', 'success', 'danger', 'warning', 'info']), //alert type color 46 | icon: PropTypes.bool //is show alert icon 47 | }` 48 | )} 49 | /> 50 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | )} 62 | code={( 63 | `import React from 'react'; 64 | import { Alert } from './styles'; 65 | 66 | const Alerts = () => { 67 | return( 68 |
    69 | 70 | 71 | 72 | 73 | 74 |
    75 | ) 76 | } 77 | 78 | export default Alerts; 79 | ` 80 | )} 81 | /> 82 | 83 | ) 84 | } 85 | 86 | export default Alerts; -------------------------------------------------------------------------------- /src/components/pages/components/ModalPage.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, BoxTitle, Row, Container, Button, Modal } from './../../styles'; 5 | /* Styles */ 6 | 7 | const ModalPage = () => { 8 | //hooks 9 | const [showModal, setShowModal] = useState(false); 10 | const [showSmallModal, setShowSmallModal] = useState(false); 11 | const [showLargeModal, setShowLargeModal] = useState(false); 12 | 13 | return( 14 |
    15 |
    16 | Modals 17 |
    18 | overlay content with fade background. 19 |
    20 |
    21 | 22 |
    23 | 24 | 25 | 26 | 27 |
    81 |
    82 | ); 83 | } 84 | 85 | export default ModalPage; -------------------------------------------------------------------------------- /src/components/styles/ChartBar.js: -------------------------------------------------------------------------------- 1 | //default react 2 | import React from 'react'; 3 | 4 | //libs 5 | import Chart from 'react-apexcharts'; 6 | import PropTypes from 'prop-types'; // prop types 7 | 8 | const ChartBar = (props) => { 9 | //get items & init data 10 | const items = typeof props.items !== 'undefined' ? props.items : []; 11 | 12 | //init default options 13 | let options = null; 14 | 15 | //init default error messages 16 | let error = ""; 17 | 18 | //try setting chart options 19 | 20 | try{ 21 | //get datas 22 | let dataItems = items.data; 23 | let labels = items.labels; 24 | let colors = dataItems.map(item => (item.color)); 25 | let seriesData = dataItems.map(item => { 26 | return { 27 | name : item.label, 28 | data : item.data 29 | } 30 | }) 31 | 32 | options = { 33 | series:seriesData, 34 | colors: colors, 35 | yaxis:{ 36 | axisBorder:{ 37 | show:false 38 | } 39 | }, 40 | xaxis: { 41 | categories: labels 42 | }, 43 | } 44 | 45 | //check title 46 | if(typeof props.title !== 'undefined'){ 47 | options = Object.assign({}, options, { 48 | title: { 49 | text: props.title 50 | } 51 | }) 52 | } 53 | 54 | //check legend 55 | const legend = typeof props.legend !== 'undefined' ? props.legend.toLowerCase() : "none"; 56 | let legendPosition = 'none'; 57 | switch(legend){ 58 | case 'top': 59 | legendPosition = 'top'; 60 | break; 61 | case 'bottom': 62 | legendPosition = 'bottom'; 63 | break; 64 | case 'left': 65 | legendPosition = 'left'; 66 | break; 67 | case 'right': 68 | legendPosition = 'right'; 69 | break; 70 | default: 71 | legendPosition = 'none'; 72 | break; 73 | } 74 | if(legendPosition!=='none'){ 75 | //add legend 76 | options = Object.assign({}, options, { 77 | legend: { 78 | fontSize: 10, 79 | position: legendPosition, 80 | markers:{ 81 | width:8, 82 | height:8, 83 | } 84 | } 85 | }); 86 | }else{ 87 | options = Object.assign({}, options, { 88 | legend: { 89 | show : false 90 | } 91 | }); 92 | } 93 | }catch(err){ 94 | //set error messages 95 | error = err.message; 96 | } 97 | 98 | return( 99 |
    100 | { options !== null ? ( 101 | 102 | ) : error } 103 |
    104 | 105 | ); 106 | } 107 | 108 | //prop types initialize 109 | ChartBar.propTypes = { 110 | items : PropTypes.object, 111 | title : PropTypes.string, 112 | legend: PropTypes.oneOf(["none", "top", "bottom", "right", "left"]) 113 | } 114 | 115 | export default ChartBar; -------------------------------------------------------------------------------- /src/components/styles/ChartLine.js: -------------------------------------------------------------------------------- 1 | //default react 2 | import React from 'react'; 3 | 4 | //libs 5 | import Chart from 'react-apexcharts'; 6 | import PropTypes from 'prop-types'; // prop types 7 | 8 | const ChartLine = (props) => { 9 | //get items & init data 10 | const items = typeof props.items !== 'undefined' ? props.items : []; 11 | 12 | //init default options 13 | let options = null; 14 | 15 | //init default error messages 16 | let error = ""; 17 | 18 | //try setting chart options 19 | 20 | try{ 21 | //get datas 22 | let dataItems = items.data; 23 | let labels = items.labels; 24 | let colors = dataItems.map(item => (item.color)); 25 | let seriesData = dataItems.map(item => { 26 | return { 27 | name : item.label, 28 | data : item.data 29 | } 30 | }) 31 | 32 | options = { 33 | series:seriesData, 34 | colors: colors, 35 | yaxis:{ 36 | axisBorder:{ 37 | show:false 38 | } 39 | }, 40 | xaxis: { 41 | categories: labels 42 | }, 43 | } 44 | 45 | //check title 46 | if(typeof props.title !== 'undefined'){ 47 | options = Object.assign({}, options, { 48 | title: { 49 | text: props.title 50 | } 51 | }) 52 | } 53 | 54 | //check legend 55 | const legend = typeof props.legend !== 'undefined' ? props.legend.toLowerCase() : "none"; 56 | let legendPosition = 'none'; 57 | switch(legend){ 58 | case 'top': 59 | legendPosition = 'top'; 60 | break; 61 | case 'bottom': 62 | legendPosition = 'bottom'; 63 | break; 64 | case 'left': 65 | legendPosition = 'left'; 66 | break; 67 | case 'right': 68 | legendPosition = 'right'; 69 | break; 70 | default: 71 | legendPosition = 'none'; 72 | break; 73 | } 74 | if(legendPosition!=='none'){ 75 | //add legend 76 | options = Object.assign({}, options, { 77 | legend: { 78 | fontSize: 10, 79 | position: legendPosition, 80 | markers:{ 81 | width:8, 82 | height:8, 83 | } 84 | } 85 | }); 86 | }else{ 87 | options = Object.assign({}, options, { 88 | legend: { 89 | show : false 90 | } 91 | }); 92 | } 93 | }catch(err){ 94 | //set error messages 95 | error = err.message; 96 | } 97 | 98 | return( 99 |
    100 | { options !== null ? ( 101 | 102 | ) : error } 103 |
    104 | 105 | ); 106 | } 107 | 108 | //prop types initialize 109 | ChartLine.propTypes = { 110 | items : PropTypes.object, 111 | title : PropTypes.string, 112 | legend: PropTypes.oneOf(["none", "top", "bottom", "right", "left"]) 113 | } 114 | 115 | export default ChartLine; -------------------------------------------------------------------------------- /src/components/styles/index.js: -------------------------------------------------------------------------------- 1 | // this is portal file to export all styles 2 | 3 | /* Styles */ 4 | 5 | //Menu 6 | import Menu from './Menu'; 7 | import MenuLink from './MenuLink'; 8 | 9 | //Avatar 10 | import Avatar from './Avatar'; 11 | 12 | //text 13 | import H1 from './H1'; 14 | import H2 from './H2'; 15 | import H3 from './H3'; 16 | import H4 from './H4'; 17 | import H5 from './H5'; 18 | 19 | //box 20 | import Box from './Box.js'; 21 | import BoxTitle from './BoxTitle.js'; 22 | 23 | //grid 24 | import Container from './Container.js'; 25 | import Row from './Row.js'; 26 | import Col from './Col.js'; 27 | 28 | //alert 29 | import Alert from './Alert.js'; 30 | 31 | //badge 32 | import Badge from './Badge.js'; 33 | 34 | //button 35 | import Button from './Button.js'; 36 | 37 | //forms 38 | import Form from './Form'; 39 | import FormGroup from './FormGroup'; 40 | import Input from './Input'; 41 | import Select from './Select'; 42 | import Textarea from './Textarea'; 43 | import Checkbox from './Checkbox'; 44 | 45 | //cards 46 | import IconCard from './IconCard.js'; 47 | import UserCard from './UserCard'; 48 | import ImageCard from './ImageCard'; 49 | import ImageCardTitle from './ImageCardTitle'; 50 | import ImageCardSubTitle from './ImageCardSubTitle'; 51 | import ImageCardDescription from './ImageCardDescription'; 52 | import ProductCard from './ProductCard'; 53 | import ProductCardName from './ProductCardName'; 54 | import ProductCardImage from './ProductCardImage'; 55 | import ProductCardPrice from './ProductCardPrice'; 56 | import ProductCardDescription from './ProductCardDescription'; 57 | import ProductCardCategory from './ProductCardCategory'; 58 | 59 | //breadcrumbs 60 | import Breadcrumb from './Breadcrumb'; 61 | import BreadcrumbItem from './BreadcrumbItem'; 62 | 63 | //carousel 64 | import Carousel from './Carousel'; 65 | 66 | //charts 67 | import ChartDonut from './ChartDonut'; 68 | import ChartPie from './ChartPie'; 69 | import ChartRadar from './ChartRadar'; 70 | import ChartLine from './ChartLine'; 71 | import ChartBar from './ChartBar'; 72 | 73 | //collapse 74 | import Collapse from './Collapse'; 75 | import Accordion from './Accordion'; 76 | 77 | //modal 78 | import Modal from './Modal'; 79 | 80 | //dropdown 81 | import Dropdown from './Dropdown'; 82 | import DropdownItem from './DropdownItem'; 83 | 84 | //table 85 | import Table from './Table'; 86 | 87 | //Progress Bar 88 | import ProgressBar from './ProgressBar'; 89 | 90 | /* Styles */ 91 | 92 | //multiple export 93 | export { 94 | Menu, 95 | MenuLink, 96 | Avatar, 97 | H1, 98 | H2, 99 | H3, 100 | H4, 101 | H5, 102 | Box, 103 | BoxTitle, 104 | Button, 105 | Form, 106 | FormGroup, 107 | Input, 108 | Textarea, 109 | Select, 110 | Checkbox, 111 | Container, 112 | Row, 113 | Col, 114 | Alert, 115 | Badge, 116 | IconCard, 117 | UserCard, 118 | ImageCard, 119 | ImageCardTitle, 120 | ImageCardSubTitle, 121 | ImageCardDescription, 122 | ProductCard, 123 | ProductCardName, 124 | ProductCardImage, 125 | ProductCardPrice, 126 | ProductCardDescription, 127 | ProductCardCategory, 128 | Breadcrumb, 129 | BreadcrumbItem, 130 | Carousel, 131 | ChartDonut, 132 | ChartPie, 133 | ChartRadar, 134 | ChartLine, 135 | ChartBar, 136 | Collapse, 137 | Accordion, 138 | Modal, 139 | Dropdown, 140 | DropdownItem, 141 | Table, 142 | ProgressBar, 143 | }; -------------------------------------------------------------------------------- /src/components/pages/FAQPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* components */ 4 | import { Breadcrumb, BreadcrumbItem, Container, Row, Accordion, Col } from '../styles'; 5 | 6 | const FAQPage = () => { 7 | /* array of faq */ 8 | const faq = [ 9 | { 10 | key : 'What is REFAST template?', 11 | body : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 12 | }, 13 | { 14 | key : 'How to buy this template?', 15 | body : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 16 | }, 17 | { 18 | key : 'Where do i download the file to?', 19 | body : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 20 | }, 21 | { 22 | key : 'I have trouble installing this template on my website', 23 | body : "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." 24 | }, 25 | { 26 | key : 'I need more information about this website.', 27 | body : ( 28 |
    click here to get more information about this product.
    29 | ) 30 | }, 31 | ]; 32 | 33 | return( 34 |
    35 | {/* page title */} 36 |
    37 | Frequently Asked Questions 38 | 39 | {/* breadcrumb info */} 40 | 41 | 42 | Page 43 | 44 | 45 | FAQ 46 | 47 | 48 |
    49 |
    50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
    58 | ); 59 | } 60 | 61 | export default FAQPage; -------------------------------------------------------------------------------- /src/components/styles/ChartPie.js: -------------------------------------------------------------------------------- 1 | //default react 2 | import React from 'react'; 3 | 4 | //libs 5 | import Chart from 'react-apexcharts'; 6 | import PropTypes from 'prop-types'; // prop types 7 | 8 | const ChartPie = (props) => { 9 | //get items & init data 10 | const items = typeof props.items !== 'undefined' ? props.items : []; 11 | 12 | //init default options 13 | let options = null; 14 | 15 | //init default error messages 16 | let error = ""; 17 | 18 | //try setting chart options 19 | 20 | try{ 21 | //get datas 22 | let numbers = items.map(item => (item.data)); 23 | let labels = items.map(item => (item.label)); 24 | let colors = items.map(item => (item.color)); 25 | 26 | options = { 27 | series: numbers, 28 | labels: labels, 29 | colors: colors, 30 | dataLabels: { 31 | enabled : false 32 | }, 33 | states: { 34 | hover: { 35 | enabled: false 36 | } 37 | }, 38 | plotOptions: { 39 | pie: { 40 | donut: { 41 | labels : { 42 | show : false 43 | } 44 | } 45 | } 46 | } 47 | } 48 | 49 | //check title 50 | if(typeof props.title !== 'undefined'){ 51 | options = Object.assign({}, options, { 52 | title: { 53 | text: props.title 54 | } 55 | }) 56 | } 57 | 58 | //check legend 59 | const legend = typeof props.legend !== 'undefined' ? props.legend.toLowerCase() : "none"; 60 | let legendPosition = 'none'; 61 | switch(legend){ 62 | case 'top': 63 | legendPosition = 'top'; 64 | break; 65 | case 'bottom': 66 | legendPosition = 'bottom'; 67 | break; 68 | case 'left': 69 | legendPosition = 'left'; 70 | break; 71 | case 'right': 72 | legendPosition = 'right'; 73 | break; 74 | default: 75 | legendPosition = 'none'; 76 | break; 77 | } 78 | if(legendPosition!=='none'){ 79 | //add legend 80 | options = Object.assign({}, options, { 81 | legend: { 82 | fontSize: 10, 83 | position: legendPosition, 84 | markers:{ 85 | width:8, 86 | height:8 87 | } 88 | } 89 | }); 90 | }else{ 91 | options = Object.assign({}, options, { 92 | legend: { 93 | show : false 94 | } 95 | }); 96 | } 97 | }catch(err){ 98 | //set error messages 99 | error = err.message; 100 | } 101 | 102 | return( 103 |
    104 | { options !== null ? ( 105 | 106 | ) : error } 107 |
    108 | 109 | ); 110 | } 111 | 112 | //prop types initialize 113 | ChartPie.propTypes = { 114 | items : PropTypes.array, 115 | title : PropTypes.string, 116 | legend: PropTypes.oneOf(["none", "top", "bottom", "right", "left"]) 117 | } 118 | 119 | export default ChartPie; -------------------------------------------------------------------------------- /src/components/pages/SignupPage.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { Box, BoxTitle, Form, FormGroup, Input, Button, Checkbox, H4, Textarea } from '../styles'; 4 | 5 | const SignupPage = () => { 6 | /* hooks */ 7 | const [name, setName] = useState(''); 8 | const [email, setEmail] = useState(''); 9 | const [password, setPassword] = useState(''); 10 | const [address, setAddress] = useState(''); 11 | const [agreed, setAgreed] = useState(false); 12 | 13 | return( 14 |
    15 | {/* logo and header information */} 16 |
    17 | logo 18 |
    19 | REACT ADMIN TEMPLATE 20 |
    21 |
    22 | 23 | {/* content form */} 24 | 25 | 26 |
    { 27 | e.preventDefault(); 28 | alert("Sign up success"); 29 | }}> 30 | 31 | { setName(e.target.value) }}/> 38 | 39 | 40 | { setEmail(e.target.value) }}/> 47 | 48 | 49 | { setPassword(e.target.value) }}/> 56 | 57 | 58 | 86 | 87 | { maxLength !== 9999 ? ( 88 |
    89 | { currentLength } / { maxLength } 90 |
    91 | ) : '' } 92 |
    93 | ); 94 | } 95 | 96 | //prop types initialize 97 | Textarea.propTypes = { 98 | style : PropTypes.object, 99 | className : PropTypes.string, 100 | value: PropTypes.any, 101 | name : PropTypes.string, 102 | id : PropTypes.string, 103 | maxLength : PropTypes.number, 104 | autoComplete : PropTypes.bool, 105 | required : PropTypes.bool, 106 | pattern : PropTypes.string, 107 | placeholder : PropTypes.string, 108 | handleChange : PropTypes.func, 109 | isValid : PropTypes.bool, 110 | message : PropTypes.string, 111 | } 112 | 113 | export default Textarea; -------------------------------------------------------------------------------- /src/components/pages/documentation/getting_started/Installation.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; 3 | import { darcula as myStyle } from 'react-syntax-highlighter/dist/esm/styles/prism'; 4 | import { Box, BoxTitle, Alert } from '../../../styles'; 5 | 6 | const Installation = () => { 7 | return( 8 | 9 | 10 |
    11 | NodeJS - install node js from its official website here http://nodejs.org/. 12 |
    13 | NPM - npm will automaticly installed with NodeJS. 14 |
    15 |
    16 | after installation finish you can check version of NodeJS by typing in your terminal or cmd 17 | 18 | {`node -v`} 19 | 20 | result: 21 | 22 | {`v12.13.0`} 23 | 24 | and check NPM version by typing 25 | 26 | {`npm -v`} 27 | 28 | result: 29 | 30 | {`v6.12.0`} 31 | 32 | 33 |
    34 | 35 |
    36 | to run demo simply install serve and run serve on your machine: 37 | 38 | {`npm install -g serve 39 | serve -s build`} 40 | 41 | 42 | it will show information of your server running host and port: 43 | 44 | {`Serving! 45 | 46 | - Local: http://localhost:5000 47 | - On Your Network: http://192.168.1.15:5000 48 | 49 | Copied local address to clipboard!`} 50 | 51 | then you can run demo by simply run http://localhost:5000 in your browser. 52 | 53 |
    54 |
    55 | 56 |
    57 | below is template folder structure that will make you easy to find components or files. 58 |
    59 | 61 | All main components (ProgressBar, Box, Charts, etc) in src/components/styles. 62 | 63 | )}/> 64 | 65 | {`src/ 66 | components/ 67 | /apps /* example app */ 68 | /layout /* Navbar, Menubar, Notification & Message Panel here */ 69 | /pages /* Authorization, Misc, Error pages, Docs and etc. */ 70 | /styles /* this contains all components template style */ 71 | helpers/ 72 | /* all helpers file */ 73 | redux/ 74 | actions/ /* all redux actions */ 75 | reducers/ /* all reducers */ 76 | store.js /* redux create store */ 77 | sass/ 78 | _calendar.scss /* big calendar and datetime picker styles */ 79 | _colors.scss /* all colors in 1 file make it easy to change */ 80 | _components.scss /* all styles use in components */ 81 | _desktop.scss /* desktop resolution styles */ 82 | _menu.scss /* menu styles */ 83 | _mobile.scss /* mobile resolution styles */ 84 | _tablet.scss /* tablet resolution styles */ 85 | _variables.scss /* global variables */ 86 | index.scss /* put all scss together */ 87 | `} 88 | 89 |
    90 | ) 91 | } 92 | 93 | export default Installation; -------------------------------------------------------------------------------- /src/components/styles/Dropdown.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Dropdown = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get position 11 | const inputPosition = typeof props.position !== 'undefined' ? props.position : ''; 12 | let position; 13 | switch(inputPosition){ 14 | case 'top': 15 | position = 'dropup' 16 | break; 17 | case 'left': 18 | position = 'dropleft' 19 | break; 20 | case 'right': 21 | position = 'dropright' 22 | break; 23 | default: 24 | position = ' ' 25 | break; 26 | } 27 | position = position !== ' ' ? 'btn-group '+position+' ' : ''; 28 | 29 | //get button color 30 | const inputButtonType = typeof props.color !== 'undefined' ? props.color : ' btn-primary'; 31 | let useAnotherColor = false; 32 | let anotherColor = ''; 33 | let buttonType; 34 | switch(inputButtonType){ 35 | case 'success': 36 | buttonType = 'btn-success' 37 | break; 38 | case 'danger': 39 | buttonType = 'btn-danger' 40 | break; 41 | case 'warning': 42 | buttonType = 'btn-warning' 43 | break; 44 | case 'primary': 45 | buttonType = 'btn-primary' 46 | break; 47 | case 'info': 48 | buttonType = 'btn-info' 49 | break; 50 | default: 51 | buttonType = 'btn-primary'; 52 | useAnotherColor = true; 53 | anotherColor = props.color; 54 | break; 55 | } 56 | 57 | //get button size 58 | const inputButtonSize = typeof props.size !== 'undefined' ? props.size : 'medium'; 59 | let buttonSize; 60 | switch(inputButtonSize){ 61 | case 'small': 62 | buttonSize = 'btn-sm' 63 | break; 64 | case 'medium': 65 | buttonSize = 'btn-md' 66 | break; 67 | case 'large': 68 | buttonSize = 'btn-lg' 69 | break; 70 | default: 71 | buttonSize = 'btn-md' 72 | break; 73 | } 74 | //add space between class 75 | buttonSize = ' ' + buttonSize; 76 | 77 | //get button icon 78 | const buttonIcon = typeof props.icon !== 'undefined' ? props.icon : ''; 79 | 80 | //get button enable 81 | const disabled = typeof props.disabled !== 'undefined' ? (props.disabled ? ' disabled ' : ' ') : ' '; 82 | 83 | //get has arrow icon 84 | const arrowIcon = typeof props.hasArrowIcon !== 'undefined' ? (props.hasArrowIcon ? ' ' : ' remove-icon ') : ' '; 85 | 86 | let customStyle = {}; 87 | if(useAnotherColor){ 88 | customStyle = { 89 | backgroundColor: anotherColor 90 | } 91 | } 92 | 93 | return( 94 |
    95 | 104 |
    105 | { props.children } 106 |
    107 |
    108 | ); 109 | } 110 | 111 | //prop types initialize 112 | Dropdown.propTypes = { 113 | className: PropTypes.string, 114 | label: PropTypes.string, 115 | color: PropTypes.string, 116 | size: PropTypes.string, 117 | icon: PropTypes.string, 118 | disabled: PropTypes.bool, 119 | hasArrowIcon: PropTypes.bool, 120 | position: PropTypes.oneOf(["top", "bottom", "left", "right"]), 121 | } 122 | 123 | export default Dropdown; -------------------------------------------------------------------------------- /src/components/styles/ChartRadar.js: -------------------------------------------------------------------------------- 1 | //default react 2 | import React from 'react'; 3 | 4 | //libs 5 | import Chart from 'react-apexcharts'; 6 | import PropTypes from 'prop-types'; // prop types 7 | 8 | const ChartRadar = (props) => { 9 | //get items & init data 10 | const items = typeof props.items !== 'undefined' ? props.items : []; 11 | 12 | //get size 13 | const chartSize = typeof props.size !== 'undefined' ? props.size : null; 14 | 15 | //init default options 16 | let options = null; 17 | 18 | //init default error messages 19 | let error = ""; 20 | 21 | //try setting chart options 22 | 23 | try{ 24 | //get datas 25 | let dataItems = items.data; 26 | let colors = dataItems.map(item => (item.color)); 27 | let seriesData = dataItems.map(item => { 28 | return { 29 | name : item.label, 30 | data : item.data 31 | } 32 | }) 33 | 34 | options = { 35 | series: seriesData, 36 | stroke: { 37 | show: true, 38 | colors: colors 39 | }, 40 | markers: { 41 | size: 3, 42 | hover: { 43 | size: 4 44 | }, 45 | colors: colors 46 | }, 47 | fill: { 48 | opacity: 0.2, 49 | colors: colors 50 | }, 51 | labels: items.labels, 52 | plotOptions: { 53 | radar: { 54 | size : chartSize, 55 | polygons: { 56 | strokeColor: '#e8e8e8', 57 | fill: { 58 | colors: ['#f8f8f8', '#fff'] 59 | } 60 | } 61 | } 62 | } 63 | } 64 | 65 | //check title 66 | if(typeof props.title !== 'undefined'){ 67 | options = Object.assign({}, options, { 68 | title: { 69 | text: props.title 70 | } 71 | }) 72 | } 73 | 74 | //check legend 75 | const legend = typeof props.legend !== 'undefined' ? props.legend.toLowerCase() : "none"; 76 | let legendPosition = 'none'; 77 | switch(legend){ 78 | case 'top': 79 | legendPosition = 'top'; 80 | break; 81 | case 'bottom': 82 | legendPosition = 'bottom'; 83 | break; 84 | case 'left': 85 | legendPosition = 'left'; 86 | break; 87 | case 'right': 88 | legendPosition = 'right'; 89 | break; 90 | default: 91 | legendPosition = 'none'; 92 | break; 93 | } 94 | if(legendPosition!=='none'){ 95 | //add legend 96 | options = Object.assign({}, options, { 97 | legend: { 98 | fontSize: 10, 99 | position: legendPosition, 100 | markers:{ 101 | width:8, 102 | height:8, 103 | fillColors : colors 104 | } 105 | } 106 | }); 107 | }else{ 108 | options = Object.assign({}, options, { 109 | legend: { 110 | show : false 111 | } 112 | }); 113 | } 114 | }catch(err){ 115 | //set error messages 116 | error = err.message; 117 | } 118 | 119 | return( 120 |
    121 | { options !== null ? ( 122 | 123 | ) : error } 124 |
    125 | 126 | ); 127 | } 128 | 129 | //prop types initialize 130 | ChartRadar.propTypes = { 131 | items : PropTypes.object, 132 | title : PropTypes.string, 133 | size : PropTypes.number, 134 | legend: PropTypes.oneOf(["none", "top", "bottom", "right", "left"]) 135 | } 136 | 137 | export default ChartRadar; -------------------------------------------------------------------------------- /src/components/pages/components/DropdownsPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, Row, Container, Col, Dropdown, DropdownItem, BoxTitle } from './../../styles'; 5 | /* Styles */ 6 | 7 | const DropdownsPage = () => { 8 | return( 9 |
    10 |
    11 | Dropdowns 12 |
    13 | toggle button for displaying list of links and etc.. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Link 1 27 | Link 2 28 | Link 2 29 |
    30 | Link 3 31 |
    32 | 33 | 34 | 35 | 36 | Link 1 37 | Link 2 38 | Link 2 39 |
    40 | Link 3 41 |
    42 | 43 | 44 | 45 | 46 | Link 1 47 | Link 2 48 | Link 2 49 |
    50 | Link 3 51 |
    52 | 53 | 54 | 55 | 56 | Link 1 57 | Link 2 58 | Link 2 59 |
    60 | Link 3 61 |
    62 | 63 |
    64 |
    65 |
    66 |
    67 |
    68 |
    69 |
    70 | ); 71 | } 72 | 73 | export default DropdownsPage; -------------------------------------------------------------------------------- /src/components/pages/documentation/components/Carousels.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import DocsExample from './../DocsExample'; 3 | import { 4 | Carousel 5 | } from '../../../styles'; 6 | 7 | const Carousels = () => { 8 | //carousel images 9 | const carouselImages = [ 10 | { 11 | image: '/images/slider1.jpg', 12 | useCaption : false, 13 | handleClick : () => { 14 | alert("Carousel clicked"); 15 | } 16 | }, 17 | { 18 | image: '/images/slider2.jpg', 19 | useCaption : true, 20 | captionColor : '#000', 21 | title: 'Caption Title', 22 | subTitle: 'Caption Sub Title or Paragraph Here.' 23 | }, 24 | { 25 | image: '/images/slider3.jpg', 26 | useCaption : false 27 | } 28 | ]; 29 | 30 | return ( 31 | 32 | 36 | 37 | 38 | )} 39 | code={( 40 | `import React from 'react'; 41 | import { Carousel } from './styles'; 42 | 43 | const Carousels = () => { 44 | //carousel images 45 | const carouselImages = [ 46 | { 47 | image: '/images/slider1.jpg', 48 | useCaption : false, 49 | //you can pass on handle click callback per items 50 | handleClick : () => { 51 | alert("Carousel clicked"); 52 | } 53 | }, 54 | { 55 | image: '/images/slider2.jpg', 56 | useCaption : true, 57 | captionColor : '#000', 58 | title: 'Caption Title', 59 | subTitle: 'Caption Sub Title or Paragraph Here.' 60 | }, 61 | { 62 | image: '/images/slider3.jpg', 63 | useCaption : false 64 | } 65 | ]; 66 | 67 | return( 68 |
    69 | 70 |
    71 | ) 72 | } 73 | 74 | export default Carousels; 75 | ` 76 | )} 77 | properties={( 78 | `Carousel.propTypes = { 79 | className: PropTypes.string, //custom className 80 | id : PropTypes.string, //ATTENTION: this field is required, you must provided unique id for carousel 81 | items : PropTypes.array, //array of items 82 | indicators : PropTypes.bool, //is carousel show indicators 83 | controls : PropTypes.bool, //is show arrow controls 84 | }` 85 | )} 86 | /> 87 | 88 | 92 | 93 | 94 | )} 95 | code={( 96 | `import React from 'react'; 97 | import { Carousel } from './styles'; 98 | 99 | const Carousels = () => { 100 | //carousel images 101 | const carouselImages = [ 102 | { 103 | image: '/images/slider1.jpg', 104 | useCaption : false, 105 | //you can pass on handle click callback per items 106 | handleClick : () => { 107 | alert("Carousel clicked"); 108 | } 109 | }, 110 | { 111 | image: '/images/slider2.jpg', 112 | useCaption : true, 113 | captionColor : '#000', 114 | title: 'Caption Title', 115 | subTitle: 'Caption Sub Title or Paragraph Here.' 116 | }, 117 | { 118 | image: '/images/slider3.jpg', 119 | useCaption : false 120 | } 121 | ]; 122 | 123 | return( 124 |
    125 | 126 |
    127 | ) 128 | } 129 | 130 | export default Carousels; 131 | ` 132 | )} 133 | /> 134 |
    135 | ) 136 | } 137 | 138 | export default Carousels; -------------------------------------------------------------------------------- /src/components/layouts/Navbar.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | //libs 4 | import { Link } from 'react-router-dom'; 5 | import { connect } from 'react-redux'; 6 | 7 | /* redux */ 8 | import { logout } from './../../redux/actions/authAction'; 9 | 10 | /* components */ 11 | import NotificationContainer from './NotificationContainer.js' 12 | import MessageContainer from './MessageContainer.js' 13 | import { Avatar } from '../styles'; 14 | /* components */ 15 | 16 | const Navbar = (props) => { 17 | /* trigger logout */ 18 | const logoutProcess = () => { 19 | props.logout(() => { 20 | //put your callback actions here 21 | }); 22 | } 23 | 24 | //notification hooks 25 | const [openNotification, setOpenNotification] = useState(false); 26 | //message hooks 27 | const [openMessage, setOpenMessage] = useState(false); 28 | 29 | return( 30 | 83 | ); 84 | } 85 | 86 | /* map redux states to be accessed by global props */ 87 | const mapStateToProps = state => ({ 88 | }); 89 | 90 | /* connect use react redux */ 91 | export default connect(mapStateToProps, { 92 | /* redux actions to be accessed by global props */ 93 | logout 94 | })(Navbar); -------------------------------------------------------------------------------- /src/components/layouts/NotificationContainer.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | //components 7 | import NotificationPreview from './NotificationPreview.js'; 8 | 9 | const NotificationContainer = (props) => { 10 | //get is open 11 | const isOpen = typeof props.isOpen !== 'undefined' ? props.isOpen : false; 12 | let navWidthResult = isOpen ? '320px' : '0px'; 13 | 14 | //slide left nav 15 | if(isOpen){ 16 | //document.getElementById("root").style.marginLeft = "320px"; 17 | }else{ 18 | //document.getElementById("root").style.marginLeft = "0px"; 19 | } 20 | 21 | /* Set the width of the side navigation to 0 */ 22 | const closeNav = () => { 23 | props.setOpenNotification(false); 24 | } 25 | 26 | return( 27 |
    30 |
    31 |  Notifications 32 |
    33 | × 34 | 35 | 43 | 51 | 59 | 67 | 75 | 83 | 91 | 99 |
    100 | ); 101 | } 102 | 103 | //prop types initialize 104 | NotificationContainer.propTypes = { 105 | isOpen : PropTypes.bool, 106 | } 107 | 108 | export default NotificationContainer; -------------------------------------------------------------------------------- /readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | REFAST - Readme 4 | 5 | 33 | 34 |

    35 | Environment Setup 36 |

    37 |

    38 | REFAST is using 16.10.2 of react version, using full hooks and functional components and Redux, 39 | it requires NodeJS and NPM (Node Package Manager) to start developing. 40 |

      41 |
    • 42 | NodeJS - install node js from its official website here https://nodejs.org/en/. 43 |
    • 44 |
    • 45 | NPM - npm will automaticly installed with NodeJS. 46 |
    • 47 |
    48 |

    49 |

    50 | after installation finish you can check version of NodeJS by typing in your terminal or cmd 51 |

    52 |
    node -v
    53 | result: 54 |
    v12.13.0
    55 |

    and check NPM version by typing

    56 |
    npm -v
    57 | result: 58 |
    v6.12.0
    59 | 60 |

    Run Demo

    61 |

    to run demo simply install serve and run serve on your machine:

    62 |
    npm install -g serve
     63 | serve -s build
    64 |

    it will show information of your server running host and port:

    65 |
    Serving!
     66 | 
     67 | - Local:            http://localhost:5000
     68 | - On Your Network:  http://192.168.1.15:5000
     69 | 
     70 | Copied local address to clipboard!
    71 |

    then you can run demo by simply run http://localhost:5000 in your browser.

    72 | 73 |

    Folder Structures

    74 |

    below is template folder structure that will make you easy to find components or files.

    75 |
    76 | All main components (ProgressBar, Box, Charts, etc) in src/components/styles. 77 | 78 |
    src/
     79 |     components/
     80 |         /apps /* example applications */
     81 |         /layout /* Navbar, Menubar, Notification & Message Panel here */
     82 |         /pages /* Authorization, Misc, Error pages, Docs and etc. */
     83 |         /styles /* this folder contains all main components template style */
     84 |     helpers/
     85 |         /* all helpers file */
     86 |     redux/
     87 |         actions/ /* all redux actions */
     88 |         reducers/ /* all reducers */
     89 |         store.js /* redux create store */
     90 |     sass/
     91 |         _calendar.scss /* big calendar and datetime picker styles */
     92 |         _colors.scss /* all colors in 1 file make it easy to change */
     93 |         _components.scss /* all styles use in components */
     94 |         _desktop.scss /* desktop resolution styles */
     95 |         _menu.scss /* menu styles */
     96 |         _mobile.scss /* mobile resolution styles */
     97 |         _tablet.scss /* tablet resolution styles */
     98 |         _variables.scss /* global variables */
     99 |         index.scss /* put all scss together */
    100 | 101 |

    Documentation

    102 | you can read components docs here https://refast.netlify.com/documentation. 103 |
    104 | You must login first (empty email and password accepted) only for demo purpose. 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/components/pages/components/CollapsePage.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, Row, Container, Button, Collapse, BoxTitle, Accordion, Alert } from './../../styles'; 5 | /* Styles */ 6 | 7 | const CollapsePage = () => { 8 | const [isOpen, setIsOpen] = useState(false); 9 | const [isNestedOpen, setIsNestedOpen] = useState(false); 10 | const [isNestedSubOpen, setIsNestedSubOpen] = useState(false); 11 | 12 | const accordionItems = [ 13 | { 14 | key : 'Button 1', 15 | body : ( 16 |
    17 | 18 | Successfully deploy to staging. 19 |  
    21 | ) 22 | }, 23 | { 24 | key : 'Button 2', 25 | body : "Lorem ipsup dolor sir amet" 26 | } 27 | ]; 28 | 29 | return( 30 |
    31 |
    32 | Collapse 33 |
    34 | toggle visibility of content. 35 |
    36 |
    37 | 38 |
    39 | 40 | 41 | 42 | 43 |
    83 |
    84 | ); 85 | } 86 | 87 | export default CollapsePage; -------------------------------------------------------------------------------- /src/components/pages/components/ButtonPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, BoxTitle, Row, Container, Button } from './../../styles'; 5 | /* Styles */ 6 | 7 | const ButtonPage = () => { 8 | return( 9 |
    10 |
    11 | Buttons 12 |
    13 | various buttons styling. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 |
    22 | 23 |
    43 |
    44 | 45 |
    46 | 47 |
    61 |
    62 | 63 |
    64 | 65 |
    72 |
    73 |
    74 |
    75 |
    76 |
    77 | ); 78 | } 79 | 80 | export default ButtonPage; -------------------------------------------------------------------------------- /src/components/styles/Input.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Input = (props) => { 7 | //get custom class 8 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 9 | 10 | //get type 11 | let inputType = typeof props.type !== 'undefined' ? props.type : 'text'; 12 | const [type, setType] = useState(inputType); 13 | 14 | //get name 15 | const inputName = typeof props.name !== 'undefined' ? props.name : ''; 16 | 17 | //get id 18 | const inputId = typeof props.id !== 'undefined' ? props.id : ''; 19 | 20 | //get maxLength 21 | const maxLength = typeof props.maxLength !== 'undefined' ? props.maxLength : 9999; 22 | const [currentLength, setCurrentLength] = useState(0); 23 | useEffect(() => { 24 | setCurrentLength(() => { 25 | //check if value already set 26 | return typeof props.value !== 'undefined' ? props.value.length : 0 27 | }); 28 | }, [props.value]); 29 | 30 | //get pattern 31 | let pattern = typeof props.pattern !== 'undefined' ? props.pattern : ''; 32 | 33 | //get auto complete 34 | const autoComplete = typeof props.autoComplete !== 'undefined' ? props.autoComplete : false; 35 | 36 | //get required 37 | const isRequired = typeof props.required !== 'undefined' ? props.required : false; 38 | 39 | //get is valid 40 | const isValid = typeof props.isValid !== 'undefined' ? (props.isValid == null ? '' : (props.isValid ? 'valid ' : 'invalid ')) : ' '; 41 | 42 | //get message 43 | let message = typeof props.message !== 'undefined' ? props.message : ''; 44 | 45 | //get icon 46 | let icon = typeof props.icon !== 'undefined' ? props.icon : ''; 47 | 48 | //custom attr 49 | let attrs = {}; 50 | if(pattern !== ''){ 51 | attrs['pattern'] = pattern; 52 | } 53 | if(inputId !== ''){ 54 | attrs['id'] = inputId; 55 | } 56 | attrs['required'] = isRequired; 57 | 58 | return( 59 |
    60 | {/* message for input */} 61 | { message !== '' ? ( 62 |
    63 | { message } 64 |
    65 | ) : '' } 66 | 67 | {/* check icon */} 68 | { icon !== '' ? ( 69 | 70 | ) : '' } 71 | 72 | {/* input element */} 73 | { 87 | // custom handle change 88 | if(maxLength!==9999){ 89 | setCurrentLength(e.target.value.length); 90 | } 91 | }} 92 | /> 93 | 94 | {/* password type */} 95 | { inputType.toLowerCase() === 'password' ? ( 96 |
    97 | { 98 | inputType = type.toLowerCase()==='password' ? 'text' : 'password'; 99 | setType(inputType); 100 | }}> 101 |
    102 | ) : '' } 103 | 104 | {/* max length help label */} 105 | { maxLength !== 9999 ? ( 106 |
    107 | { currentLength } / { maxLength } 108 |
    109 | ) : '' } 110 |
    111 | ); 112 | } 113 | 114 | //prop types initialize 115 | Input.propTypes = { 116 | style : PropTypes.object, 117 | className : PropTypes.string, 118 | value : PropTypes.any, 119 | type : PropTypes.string, 120 | name : PropTypes.string, 121 | id : PropTypes.string, 122 | maxLength : PropTypes.number, 123 | autoComplete : PropTypes.bool, 124 | required : PropTypes.bool, 125 | pattern : PropTypes.string, 126 | placeholder : PropTypes.string, 127 | handleChange : PropTypes.func, 128 | handleKeyPress : PropTypes.func, 129 | handleKeyDown : PropTypes.func, 130 | isValid : PropTypes.bool, 131 | message : PropTypes.string, 132 | icon : PropTypes.string, 133 | } 134 | 135 | export default Input; -------------------------------------------------------------------------------- /src/components/pages/documentation/components/Box.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import DocsExample from './../DocsExample'; 3 | import { 4 | Box, 5 | BoxTitle, 6 | Row 7 | } from '../../../styles'; 8 | 9 | const BoxDocumentation = () => { 10 | return ( 11 | 12 | 16 | 17 | 18 | small 6 19 |
    20 | medium 4 21 |
    22 | large 3 23 |
    24 | 25 | small 6 26 |
    27 | medium 6 28 |
    29 | large 9 30 |
    31 |
    32 | 33 | 34 | medium 8, offset 2 35 |
    36 | large 6, offset 3 37 |
    38 |
    39 |
    40 | )} 41 | code={( 42 | `import React from 'react'; 43 | import { Row, Box } from './styles'; 44 | 45 | const Box = () => { 46 | return( 47 |
    48 | 49 | 50 | small 6 51 |
    52 | medium 4 53 |
    54 | large 3 55 |
    56 | 57 | small 6 58 |
    59 | medium 6 60 |
    61 | large 9 62 |
    63 |
    64 | 65 | 66 | medium 8, offset 2 67 |
    68 | large 6, offset 3 69 |
    70 |
    71 |
    72 | ) 73 | } 74 | 75 | export default Box; 76 | ` 77 | )} 78 | properties={( 79 | `Box.propTypes = { 80 | style : PropTypes.object, //your custom style object here 81 | className: PropTypes.string, //your custom class here 82 | xs: PropTypes.number, 83 | xsOffset: PropTypes.number, 84 | sm: PropTypes.number, 85 | smOffset: PropTypes.number, 86 | md: PropTypes.number, 87 | mdOffset: PropTypes.number, 88 | lg: PropTypes.number, 89 | lgOffset: PropTypes.number, 90 | isTransparent: PropTypes.bool, //is box white background or transparent 91 | }` 92 | )} 93 | /> 94 | 98 | 99 | 100 | 101 | Lorem ipsum dolor sit amet 102 | 103 | 104 | 105 | Lorem ipsum dolor sit amet 106 | 107 | 108 | 109 | Lorem ipsum dolor sit amet 110 | 111 | 112 |
    113 | )} 114 | code={( 115 | `import React from 'react'; 116 | import { Row, Box } from './styles'; 117 | 118 | const Box = () => { 119 | return( 120 |
    121 | 122 | 123 | 124 | Lorem ipsum dolor sit amet 125 | 126 | 127 | 128 | Lorem ipsum dolor sit amet 129 | 130 | 131 | 132 | Lorem ipsum dolor sit amet 133 | 134 | 135 |
    136 | ) 137 | } 138 | 139 | export default Box; 140 | ` 141 | )} 142 | /> 143 | 144 | ) 145 | } 146 | 147 | export default BoxDocumentation; -------------------------------------------------------------------------------- /src/components/pages/components/ProgressBarPage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Styles */ 4 | import { Box, Row, Container, ProgressBar, Col, BoxTitle } from './../../styles'; 5 | /* Styles */ 6 | 7 | const ProgressBarPage = () => { 8 | return( 9 |
    10 |
    11 | Progress Bar 12 |
    13 | display progress of a process. 14 |
    15 |
    16 | 17 |
    18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
    95 |
    96 | ); 97 | } 98 | 99 | export default ProgressBarPage; -------------------------------------------------------------------------------- /src/components/styles/Button.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | //libs 4 | import PropTypes from 'prop-types'; // prop types 5 | 6 | const Button = (props) => { 7 | //get label 8 | const isLabelExist = typeof props.label !== 'undefined' ? true : false; 9 | 10 | //get button outlined 11 | const inputButtonOutlined = typeof props.isOutlined !== 'undefined' ? props.isOutlined : false; 12 | 13 | //get button full width 14 | const isFull = typeof props.isFull !== 'undefined' ? props.isFull : false; 15 | 16 | //get button enable 17 | const disabled = typeof props.disabled !== 'undefined' ? props.disabled : false; 18 | 19 | //get button type 20 | let buttonBehaviorType = typeof props.type !== 'undefined' ? props.type : 'button'; 21 | if(buttonBehaviorType!=='submit'){ 22 | buttonBehaviorType = 'button'; 23 | } 24 | 25 | //get button color 26 | const inputButtonType = typeof props.color !== 'undefined' ? props.color : ' btn-primary'; 27 | let useAnotherColor = false; 28 | let anotherColor = ''; 29 | let buttonType; 30 | switch(inputButtonType){ 31 | case 'success': 32 | buttonType = 'btn-success' 33 | break; 34 | case 'danger': 35 | buttonType = 'btn-danger' 36 | break; 37 | case 'warning': 38 | buttonType = 'btn-warning' 39 | break; 40 | case 'primary': 41 | buttonType = 'btn-primary' 42 | break; 43 | case 'info': 44 | buttonType = 'btn-info' 45 | break; 46 | default: 47 | buttonType = 'btn-primary'; 48 | useAnotherColor = true; 49 | anotherColor = props.color; 50 | break; 51 | } 52 | //check for outline 53 | buttonType = inputButtonOutlined ? (buttonType.replace('-', '-outline-')) : buttonType; 54 | //add space between class 55 | buttonType = ' ' + buttonType; 56 | 57 | //get button size 58 | const inputButtonSize = typeof props.size !== 'undefined' ? props.size : ' btn-sm'; 59 | let buttonSize; 60 | switch(inputButtonSize){ 61 | case 'small': 62 | buttonSize = 'btn-sm' 63 | break; 64 | case 'medium': 65 | buttonSize = 'btn-md' 66 | break; 67 | case 'large': 68 | buttonSize = 'btn-lg' 69 | break; 70 | default: 71 | buttonSize = 'btn-md' 72 | break; 73 | } 74 | //add space between class 75 | buttonSize = ' ' + buttonSize; 76 | 77 | //get is rounded button 78 | const isButtonRounded = typeof props.isRounded !== 'undefined' ? (props.isRounded ? ' rounded' : '') : ''; 79 | 80 | //get custom class 81 | const customClassName = typeof props.className !== 'undefined' ? props.className : ''; 82 | 83 | //get custom class 84 | const id = typeof props.id !== 'undefined' ? props.id : ''; 85 | 86 | //get button icon 87 | const buttonIcon = typeof props.icon !== 'undefined' ? props.icon : ''; 88 | 89 | //custom style 90 | let customStyle = {}; 91 | if(useAnotherColor){ 92 | customStyle = { 93 | backgroundColor: anotherColor, 94 | borderColor : anotherColor 95 | } 96 | } 97 | //add custom style from attr 98 | if(props.style !== 'undefined'){ 99 | customStyle = Object.assign({}, customStyle, props.style); 100 | } 101 | 102 | //custom attr 103 | let attrs = {}; 104 | if(id !== ''){ 105 | attrs['id'] = id; 106 | } 107 | attrs['disabled'] = disabled; 108 | 109 | //get custom data attributes 110 | let dataAttributes = {}; 111 | Object.keys(props).map(propKey => { 112 | //check if attribute key contains data- 113 | if(propKey.includes('data-')){ 114 | //return 115 | dataAttributes[propKey] = props[propKey]; 116 | } 117 | 118 | return true 119 | }); 120 | 121 | return( 122 | 136 | ); 137 | } 138 | 139 | //prop types initialize 140 | Button.propTypes = { 141 | style : PropTypes.object, 142 | className: PropTypes.string, 143 | id: PropTypes.string, 144 | icon: PropTypes.string, 145 | type: PropTypes.oneOf(['button', 'submit']), 146 | color: PropTypes.string, 147 | size: PropTypes.oneOf(['small', 'medium', 'large']), 148 | label: PropTypes.string, 149 | disabled: PropTypes.bool, 150 | isOutlined: PropTypes.bool, 151 | isRounded: PropTypes.bool, 152 | isFull: PropTypes.bool, 153 | handleClick: PropTypes.func, 154 | } 155 | 156 | export default Button; --------------------------------------------------------------------------------