This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global describe, it, expect, beforeEach :true */ | |
import React from "react"; | |
import { shallow, configure } from "enzyme"; | |
import Adapter from "enzyme-adapter-react-16"; | |
import Home from "../scenes/Home"; | |
configure({ adapter: new Adapter() }); | |
describe("Home Scene", () => { | |
const wrapper = shallow(<Home />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if there are ',' & '.' in a input and after ',' is not 00 | |
function checkSeparator(amount) { | |
if (amount.indexOf(",") > -1 || amount.indexOf(" ") > -1) { | |
if (amount.split(",")[1] !== "00") { | |
throw new Error("Invalid separator!"); | |
} | |
} | |
} | |
// Check Rp is wrong position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Layout, Icon } from "antd"; | |
import Home from "./Home"; | |
import "./App.css"; | |
const App = () => { | |
return ( | |
<Layout className="app"> | |
<Layout.Content> | |
<div className="box"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import { Input, Button, Typography, Row, Col, message } from "antd"; | |
import TableResult from "./components/TableResult"; | |
import { validationAmount } from "../../utils/helpers"; | |
import { fractions } from "../../config/fractions"; | |
class Home extends Component { | |
state = { | |
amount: "", | |
amountLeft: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import PropTypes from "prop-types"; | |
import { convertToRupiah } from "../../../../utils/helpers"; | |
import DataTable from "./components/dataTable"; | |
import AmountLeftTable from "./components/amountLeftTable"; | |
import "./index.css"; | |
const TableResult = ({ data, amountLeft }) => { | |
// Result data fractions | |
const dataSource = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Table } from "antd"; | |
import column from "./column"; | |
const dataTable = ({ dataSource }) => { | |
return ( | |
<Table | |
pagination={false} | |
dataSource={dataSource} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Column table | |
export default function column(title, dataIndex, width, render) { | |
return { | |
title, | |
dataIndex, | |
key: dataIndex, | |
width, | |
render | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Table } from "antd"; | |
import { convertToRupiah } from "../../../../../utils/helpers"; | |
import column from "./column"; | |
const amountLeftTable = ({ amountLeft }) => { | |
return ( | |
<Table | |
showHeader={false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Koneksi.php | |
<?php | |
class Koneksi { | |
private $SERVER = "localhost"; | |
private $DATABASE = "contoh_test"; | |
private $USERNAME = "root"; | |
private $PASSWORD = ""; | |
private $koneksi; | |
public function __construct() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
NewerOlder