HomePage.js 14.2 KB
Newer Older
Deni Rinaldi's avatar
Deni Rinaldi committed
1
import React, { Component } from 'react';
d.arizona's avatar
d.arizona committed
2
import { Typography, MuiThemeProvider, createMuiTheme } from '@material-ui/core';
Deni Rinaldi's avatar
Deni Rinaldi committed
3
import MUIDataTable from "mui-datatables";
Deni Rinaldi's avatar
Deni Rinaldi committed
4
import Images from '../assets/Images';
Deni Rinaldi's avatar
Deni Rinaldi committed
5
import DonutChart from 'react-d3-donut';
Deni Rinaldi's avatar
Deni Rinaldi committed
6

Deni Rinaldi's avatar
Deni Rinaldi committed
7 8 9
var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());

Deni Rinaldi's avatar
Deni Rinaldi committed
10 11 12 13 14 15 16 17 18 19 20 21
class HomePage extends Component {
    render() {
        const columns = ["#", "Nama Perusahaan", "Revisi", "Status", {
            name: "Action",
            options: {
                customBodyRender: (val, tableMeta) => {
                    return (
                        <div style={{ display: 'flex' }}>
                            <button
                                style={{
                                    backgroundColor: 'transparent',
                                    cursor: 'pointer',
Deni Rinaldi's avatar
Deni Rinaldi committed
22 23
                                    borderColor: 'transparent',
                                    marginRight: 10
Deni Rinaldi's avatar
Deni Rinaldi committed
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
                                }}
                                onClick={() => null}
                            >
                                <img src={Images.editCopy2} />
                            </button>
                            <button
                                style={{
                                    backgroundColor: 'transparent',
                                    cursor: 'pointer',
                                    borderColor: 'transparent'
                                }}
                                onClick={() => null}
                            >
                                <img src={Images.editCopy} />
                            </button>
                        </div >
                    );
                }
            }
        }]
        const data = [
            ["1", "TRIPUTRA AGRO PERSADA", "Laporan Bulanan - September 2020", "1 (20 Oktober 2020)", "Belum Disetujui"],
            ["2", "DAYA GROUP", "Laporan Bulanan - September 2020", "1 (20 Oktober 2020)", "Belum Disetujui"],
            ["3", "PUNINAR INFINITE RAYA", "Budget Tahunan 2021", "0 (20 Oktober 2020)", "Belum Disetujui"],
            ["4", "DHARMA GROUP", "Laporan Bulanan - September 2020", "0 (20 Oktober 2020)", "Belum Disetujui"],
            ["5", "PUNINAR INFINITE RAYA", "Budget Tahunan 2021", "0 (20 Oktober 2020)", "Belum Disetujui"],
        ]
        const options = {
            filter: false,
            sort: false,
            responsive: "scroll",
            print: false,
            download: false,
            selectableRows: false,
            viewColumns: false,
Deni Rinaldi's avatar
Deni Rinaldi committed
59 60
            rowsPerPage: 5,
            search: false
Deni Rinaldi's avatar
Deni Rinaldi committed
61
        }
Deni Rinaldi's avatar
Deni Rinaldi committed
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
        const dataChart = [{
            count: 90,
            color: '#5198ea',
            name: 'My name',
        }, {
            count: 10,
            color: '#ffd600',
            name: 'name',
        }]
        const dataChart2 = [{
            count: 90,
            color: '#f65a4c',
            name: 'My name',
        }, {
            count: 10,
            color: '#5198ea',
            name: 'name',
        }]
        const dataChart3 = [{
            count: 90,
            color: '#4caf51',
            name: 'My name',
        }, {
            count: 10,
            color: '#f65a4c',
            name: 'name',
        }]
Deni Rinaldi's avatar
Deni Rinaldi committed
89
        return (
Deni Rinaldi's avatar
Deni Rinaldi committed
90
            <div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
91
                <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
92 93 94 95 96 97 98 99 100 101
                    <Typography style={{ fontSize: '24px', color: 'white' }}>Selamat Datang, John!</Typography>
                </div>
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
                    <div style={{ display: 'flex' }}>
                        <Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Menunggu Persetujuan Anda</Typography>
                    </div>

                </div>
                <div style={{ flex: 1, padding: 20, width: '100%' }}>
                    <div>
Deni Rinaldi's avatar
Deni Rinaldi committed
102 103 104 105 106 107 108
                        <MuiThemeProvider theme={getMuiTheme()}>
                            <MUIDataTable
                                data={data}
                                columns={columns}
                                options={options}
                            />
                        </MuiThemeProvider>
Deni Rinaldi's avatar
Deni Rinaldi committed
109 110 111
                    </div>
                    <div style={{ marginTop: 20 }}>
                        <Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Status Laporan</Typography>
Deni Rinaldi's avatar
Deni Rinaldi committed
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
                        <div style={{ marginTop: 10, display: 'flex' }}>
                            <div style={{ width: 280, height: 400, padding: 20, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4', marginRight: 25 }}>
                                <Typography style={{ color: '#4b4b4b', fontSize: '24px', fontWeight: 'bold' }}>Budget Tahunan - 2021</Typography>
                                <div style={{ textAlign: 'center' }}>
                                    <DonutChart
                                        innerRadius={70}
                                        outerRadius={100}
                                        transition={true}
                                        pieClass="pie1"
                                        displayTooltip={true}
                                        strokeWidth={3}
                                        data={dataChart} />
                                </div>
                                <div style={{ display: 'flex', width: '100%', marginTop: 10 }}>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>Submit</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>92.8 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.red} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>-0.6%</Typography>
                                        </div>
                                    </div>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>On Time</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>6.1 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.green} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>0.7%</Typography>
                                        </div>

                                    </div>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>Overdue</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>1.1 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.green} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>0.1%</Typography>
                                        </div>
                                    </div>
                                </div>
                            </div>

Deni Rinaldi's avatar
Deni Rinaldi committed
154
                            <div style={{ width: 280, height: 400, padding: 20, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4', marginRight: 25 }}>
Deni Rinaldi's avatar
Deni Rinaldi committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
                                <Typography style={{ color: '#4b4b4b', fontSize: '24px', fontWeight: 'bold' }}>Laporan Bulanan - Oct 2020</Typography>
                                <div style={{ textAlign: 'center' }}>
                                    <DonutChart
                                        innerRadius={70}
                                        outerRadius={100}
                                        transition={true}
                                        pieClass="pie5"
                                        displayTooltip={true}
                                        strokeWidth={3}
                                        data={dataChart2}
                                    />
                                </div>
                                <div style={{ display: 'flex', width: '100%', marginTop: 10 }}>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>Submit</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>92.8 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.red} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>-0.6%</Typography>
                                        </div>
                                    </div>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>On Time</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>6.1 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.green} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>0.7%</Typography>
                                        </div>

                                    </div>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>Overdue</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>1.1 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.green} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>0.1%</Typography>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div style={{ width: 280, height: 400, padding: 20, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4', }}>
                                <Typography style={{ color: '#4b4b4b', fontSize: '24px', fontWeight: 'bold', height: 71 }}>Lainnya</Typography>
                                <div style={{ textAlign: 'center' }}>
                                    <DonutChart
                                        innerRadius={70}
                                        outerRadius={100}
                                        transition={true}
                                        pieClass="pie2"
                                        displayTooltip={true}
                                        strokeWidth={3}
                                        data={dataChart3}
                                    />
                                </div>
                                <div style={{ display: 'flex', width: '100%', marginTop: 10 }}>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>Submit</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>92.8 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.red} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>-0.6%</Typography>
                                        </div>
                                    </div>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>On Time</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>6.1 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.green} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>0.7%</Typography>
                                        </div>

                                    </div>
                                    <div style={{ width: '33%' }}>
                                        <Typography style={{ color: '#656565', fontSize: '15px', textAlign: 'left' }}>Overdue</Typography>
                                        <Typography style={{ color: '#656565', fontSize: '20px', textAlign: 'left' }}>1.1 %</Typography>
                                        <div style={{ display: 'flex' }} >
                                            <img src={Images.green} />
                                            <Typography style={{ color: '#656565', fontSize: '14px', textAlign: 'left' }}>0.1%</Typography>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>


Deni Rinaldi's avatar
Deni Rinaldi committed
239 240 241 242 243 244 245 246
                    </div>
                </div>

            </div>
        );
    }
}

Deni Rinaldi's avatar
Deni Rinaldi committed
247
export default HomePage;