├── 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 |
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 |
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 |
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 |
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 | setShowModal(true)}
29 | label="Show Modal"/>
30 |
31 | {/* Modal */}
32 | setShowModal(false)}>
36 |
37 | {/* Modal Body */}
38 | Modal body
39 |
40 |
41 |
42 |
43 |
44 | setShowSmallModal(true)}
46 | label="Small Modal"/>
47 |
48 | {/* Modal */}
49 | setShowSmallModal(false)}>
54 |
55 | {/* Modal Body */}
56 | Modal body
57 |
58 |
59 |
60 |
61 |
62 | setShowLargeModal(true)}
64 | label="Large Modal"/>
65 |
66 | {/* Modal */}
67 | setShowLargeModal(false)}>
72 |
73 | {/* Modal Body */}
74 | Modal body
75 |
76 |
77 |
78 |
79 |
80 |
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 |
18 |
19 | REACT ADMIN TEMPLATE
20 |
21 |
22 |
23 | {/* content form */}
24 |
25 |
26 |
76 |
77 |
78 | );
79 | }
80 |
81 | export default SignupPage;
--------------------------------------------------------------------------------
/src/components/styles/ChartDonut.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 ChartDonut = (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 : true
43 | },
44 | size: '75%'
45 | }
46 | }
47 | }
48 | }
49 |
50 | //check title
51 | if(typeof props.title !== 'undefined'){
52 | options = Object.assign({}, options, {
53 | title: {
54 | text: props.title
55 | }
56 | })
57 | }
58 |
59 | //check legend
60 | const legend = typeof props.legend !== 'undefined' ? props.legend.toLowerCase() : "none";
61 | let legendPosition = 'none';
62 | switch(legend){
63 | case 'top':
64 | legendPosition = 'top';
65 | break;
66 | case 'bottom':
67 | legendPosition = 'bottom';
68 | break;
69 | case 'left':
70 | legendPosition = 'left';
71 | break;
72 | case 'right':
73 | legendPosition = 'right';
74 | break;
75 | default:
76 | legendPosition = 'none';
77 | break;
78 | }
79 | if(legendPosition!=='none'){
80 | //add legend
81 | options = Object.assign({}, options, {
82 | legend: {
83 | fontSize: 10,
84 | position: legendPosition,
85 | markers:{
86 | width:8,
87 | height:8
88 | }
89 | }
90 | });
91 | }else{
92 | options = Object.assign({}, options, {
93 | legend: {
94 | show : false
95 | }
96 | });
97 | }
98 | }catch(err){
99 | //set error messages
100 | error = err.message;
101 | }
102 |
103 | return(
104 |
105 | { options !== null ? (
106 |
107 | ) : error }
108 |
109 |
110 | );
111 | }
112 |
113 | //prop types initialize
114 | ChartDonut.propTypes = {
115 | items : PropTypes.array,
116 | title : PropTypes.string,
117 | legend: PropTypes.oneOf(["none", "top", "bottom", "right", "left"])
118 | }
119 |
120 | export default ChartDonut;
--------------------------------------------------------------------------------
/src/components/pages/documentation/components/Breadcrumbs.js:
--------------------------------------------------------------------------------
1 | import React, { Fragment } from 'react';
2 | import DocsExample from './../DocsExample';
3 | import {
4 | Row,
5 | Box,
6 | Breadcrumb,
7 | BreadcrumbItem
8 | } from '../../../styles';
9 |
10 | const Breadcrumbs = () => {
11 | return (
12 |
13 |
17 |
18 |
19 |
20 | Products
21 |
22 |
23 |
24 |
25 |
26 |
27 | Products
28 |
29 |
30 | Men's
31 |
32 |
33 |
34 |
35 |
36 |
37 | Products
38 |
39 |
40 | Men's
41 |
42 |
43 | Watch
44 |
45 |
46 |
47 |
48 | )}
49 | code={(
50 | `import React from 'react';
51 | import { Row, Box, Breadcrumb, BreadcrumbItem } from './styles';
52 |
53 | const Breadcrumbs = () => {
54 | return(
55 |
56 |
57 |
58 |
59 | Products
60 |
61 |
62 |
63 |
64 |
65 |
66 | Products
67 |
68 |
69 | Men's
70 |
71 |
72 |
73 |
74 |
75 |
76 | Products
77 |
78 |
79 | Men's
80 |
81 |
82 | Watch
83 |
84 |
85 |
86 |
87 | )
88 | }
89 |
90 | export default Breadcrumbs;
91 | `
92 | )}
93 | properties={(
94 | `BreadcrumbItem.propTypes = {
95 | isActive : PropTypes.bool //is breadcrumb item is active (unclickable)
96 | }`
97 | )}
98 | />
99 |
100 | )
101 | }
102 |
103 | export default Breadcrumbs;
--------------------------------------------------------------------------------
/src/components/pages/LoginPage.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 |
3 | /* libs */
4 | import { Link } from 'react-router-dom';
5 | import { connect } from 'react-redux';
6 | import { toast } from 'react-toastify';
7 |
8 | /* redux */
9 | import { login } from './../../redux/actions/authAction';
10 |
11 | /* components */
12 | import { Box, BoxTitle, Form, FormGroup, Input, Button, Checkbox, H4 } from '../styles';
13 |
14 | const LoginPage = (props) => {
15 | /* hooks */
16 | const [email, setEmail] = useState('admin@gmail.com');
17 | const [password, setPassword] = useState('123456');
18 | const [rememberMe, setRememberMe] = useState(false);
19 |
20 | /* login method call redux actions */
21 | const login = () => {
22 | props.login('jwt_token_here', () => {
23 | //show toast
24 | toast("Welcome...");
25 |
26 | //push to dashboard view
27 | props.history.push('/');
28 | });
29 | }
30 |
31 | return(
32 |
33 | {/* logo and header information */}
34 |
35 |
36 |
37 | REACT ADMIN TEMPLATE
38 |
39 |
40 |
41 | {/* content form */}
42 |
43 |
44 | {
45 | e.preventDefault();
46 | login();
47 | }}>
48 |
49 | { setEmail(e.target.value) }}/>
56 |
57 |
58 | { setPassword(e.target.value) }}/>
65 |
66 |
67 | { setRememberMe(e.target.checked) }}
70 | label="remember me?"/>
71 |
72 |
73 |
74 |
75 | or login with
76 |
77 |
78 |
79 |
80 |
81 |
82 | Doesn have an account? Sign up Here
83 |
84 |
85 |
86 | );
87 | }
88 |
89 | /* map redux states to be accessed by global props */
90 | const mapStateToProps = state => ({
91 | isAuthenticated : state.authReducer.isAuthenticated
92 | });
93 |
94 | /* connect use react redux */
95 | export default connect(mapStateToProps, {
96 | /* redux actions to be accessed by global props */
97 | login
98 | })(LoginPage);
--------------------------------------------------------------------------------
/src/sass/_menu.scss:
--------------------------------------------------------------------------------
1 | $text_color: $black;
2 | $sub_menu_text_color: white;
3 | $menu_color: $white;
4 | $submenu_color: $dark-gray;
5 | $drop_icon_color: white;
6 | $background_color_submenu: $submenu_color;
7 | $background_menu_color:$menu_color;
8 | $background_submenu_color: white;
9 | $background_drop_icon_color: rgba(0, 0, 0, .125);
10 | $border_text_color: transparent;
11 |
12 | /* default style for mobile */
13 | #menu {
14 | label{
15 | margin-bottom:0px;
16 | }
17 |
18 | border-bottom:1px solid darken($gray,5%);
19 | ul {
20 | margin: 0;
21 | padding: 0;
22 | span.drop-icon {
23 | display: none;
24 | }
25 | }
26 | .main-menu {
27 | display: none;
28 | }
29 | input[type="checkbox"] {
30 | display: none;
31 | &:checked {
32 | &+.sub-menu {
33 | display: block;
34 | }
35 | }
36 | }
37 | li {
38 | border-style: solid;
39 | border-color: $border_text_color;
40 | border-width: 0 0 0px;
41 | position: relative;
42 | display: block;
43 | color: $text_color;
44 | label.drop-icon {
45 | position: absolute;
46 | right: 1.5em;
47 | top: 1.0em;
48 | }
49 | }
50 | .sub-menu {
51 | background-color: $background_color_submenu;
52 | margin: 0;
53 | display: none;
54 | li {
55 | &:last-child {
56 | border-width: 0;
57 | }
58 | }
59 | a {
60 | color:$sub_menu_text_color;
61 | &:hover {
62 | color: $sub_menu_text_color;
63 | }
64 | }
65 | }
66 | a {
67 | font-size:$default-font-size;
68 | position: relative;
69 | display: block;
70 | color: $text_color;
71 | padding: 1em 1.5em;
72 | &:hover {
73 | text-decoration: none;
74 | background-color: $default-color;
75 | color: $menu_color;
76 | }
77 | }
78 | background-color: $background_menu_color;
79 | label.drop-icon {
80 | border-radius: 50%;
81 | width: 1.2em;
82 | height: 1.2em;
83 | text-align: center;
84 | background-color: $background_drop_icon_color;
85 | text-shadow: 0 0 0 transparent;
86 | color: $drop_icon_color;
87 | }
88 | .drop-icon {
89 | line-height: 1;
90 |
91 | i{
92 | font-size:7pt;
93 | }
94 | }
95 | }
96 | #tm {
97 | &:checked {
98 | &+.main-menu {
99 | display: block;
100 | }
101 | }
102 | }
103 | #toggle-menu {
104 | font-size: $default-font-size;
105 | border-style: solid;
106 | border-color: $border_text_color;
107 | border-width: 0 0 1px;
108 | position: relative;
109 | display: block;
110 | color: $text_color;
111 | background-color: $background_menu_color;
112 | padding: 1em 1.5em;
113 | .drop-icon {
114 | position: absolute;
115 | right: 1.5em;
116 | top: 1em;
117 | }
118 | span.drop-icon {
119 | border-radius: 50%;
120 | width: 1.2em;
121 | height: 1.2em;
122 | text-align: center;
123 | background-color: $background_drop_icon_color;
124 | text-shadow: 0 0 0 transparent;
125 | color: $drop_icon_color;
126 | }
127 | }
128 |
129 | /* menu on dekstop */
130 | @media only screen and (min-width: $mobile) {
131 | #menu {
132 | .main-menu {
133 | display: block;
134 | }
135 | label.drop-icon {
136 | display: none;
137 | }
138 | ul {
139 | span.drop-icon {
140 | display: inline-block;
141 | }
142 | }
143 | li {
144 | float: left;
145 | border-width: 0 1px 0 0;
146 | &:hover {
147 | >input[type="checkbox"] {
148 | &+.sub-menu {
149 | display: block;
150 | }
151 | }
152 | }
153 | }
154 | .sub-menu {
155 | li {
156 | float: none;
157 | border-width: 0 0 1px;
158 | }
159 | border-width: 0;
160 | margin: 0;
161 | position: absolute;
162 | top: 100%;
163 | left: 0;
164 | width: 12em;
165 | z-index: 3000;
166 | display: none;
167 | .sub-menu {
168 | top: 0;
169 | left: 100%;
170 | }
171 | }
172 | input[type="checkbox"] {
173 | &:checked {
174 | &+.sub-menu {
175 | display: none;
176 | }
177 | }
178 | }
179 | }
180 | #toggle-menu {
181 | display: none;
182 | }
183 | }
--------------------------------------------------------------------------------
/src/components/styles/Textarea.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 |
3 | //libs
4 | import PropTypes from 'prop-types'; // prop types
5 |
6 | const Textarea = (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 id
14 | const inputId = typeof props.id !== 'undefined' ? props.id : '';
15 |
16 | //get maxLength
17 | const maxLength = typeof props.maxLength !== 'undefined' ? props.maxLength : 9999;
18 | const [currentLength, setCurrentLength] = useState(0);
19 | useEffect(() => {
20 | setCurrentLength(() => {
21 | //check if value already set
22 | return typeof props.value !== 'undefined' ? props.value.length : 0
23 | });
24 | }, [props.value]);
25 |
26 | //get pattern
27 | let pattern = typeof props.pattern !== 'undefined' ? props.pattern : '';
28 |
29 | //get auto complete
30 | const autoComplete = typeof props.autoComplete !== 'undefined' ? props.autoComplete : false;
31 |
32 | //get required
33 | const isRequired = typeof props.required !== 'undefined' ? props.required : false;
34 |
35 | //get is valid
36 | const isValid = typeof props.isValid !== 'undefined' ? (props.isValid == null ? '' : (props.isValid ? 'valid ' : 'invalid ')) : ' ';
37 |
38 | //get message
39 | let message = typeof props.message !== 'undefined' ? props.message : '';
40 |
41 | //get icon
42 | let icon = typeof props.icon !== 'undefined' ? props.icon : '';
43 |
44 | //custom attr
45 | let attrs = {};
46 | if(pattern !== ''){
47 | attrs['pattern'] = pattern;
48 | }
49 | if(inputId !== ''){
50 | attrs['id'] = inputId;
51 | }
52 | attrs['required'] = isRequired;
53 |
54 | return(
55 |
56 | { message !== '' ? (
57 |
58 | { message }
59 |
60 | ) : '' }
61 |
62 | {/* check icon */}
63 | { icon !== '' ? (
64 |
65 | ) : '' }
66 |
67 |
{
78 | // custom handle change
79 | if(maxLength!==9999){
80 | setCurrentLength(e.target.value.length);
81 | }
82 | }}
83 | value={props.value}
84 | >
85 |
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 |
96 | {/* show button icon */}
97 | {buttonIcon !== '' ? (
98 |
99 | ) : ''}
100 |
101 | {/* show button label */}
102 | { props.label }
103 |
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 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | {
43 | //open notification & close message
44 | if(openMessage){
45 | setOpenMessage(false);
46 | }
47 | setOpenNotification(!openNotification);
48 | }
49 | } className="nav-link click-available" role="button" aria-expanded="false">
50 |
51 | 8
52 |
53 |
54 |
55 |
56 |
57 | {
58 | //close notification & open message
59 | if(openNotification){
60 | setOpenNotification(false);
61 | }
62 | setOpenMessage(!openMessage);
63 | } } className="nav-link click-available" role="button" aria-expanded="false">
64 |
65 | 2
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
Profile
75 |
Change Password
76 |
77 |
Logout
78 |
79 |
80 |
81 |
82 |
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
81 | /layout
82 | /pages
83 | /styles
84 | helpers/
85 |
86 | redux/
87 | actions/
88 | reducers/
89 | store.js
90 | sass/
91 | _calendar.scss
92 | _colors.scss
93 | _components.scss
94 | _desktop.scss
95 | _menu.scss
96 | _mobile.scss
97 | _tablet.scss
98 | _variables.scss
99 | index.scss
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 |
20 |
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 | { setIsOpen(!isOpen) }}/>
44 |
45 |
46 |
47 |
48 | 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
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | { setIsNestedOpen(!isNestedOpen) }}/>
57 |
58 |
59 |
60 |
61 | 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
62 |
63 | Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
64 |
65 |
{ setIsNestedSubOpen(!isNestedSubOpen) }}>
66 | {isNestedSubOpen ?
67 | (
68 | Show Less
69 | ) : ( Show More
)}
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
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 |
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 | 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 |
128 |
129 | {/* check if use icon */}
130 | { buttonIcon !== '' ? ( ) : '' }
131 |
132 | {/* show button label */}
133 | { props.label }
134 |
135 |
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;
--------------------------------------------------------------------------------