This file contains hidden or 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
1. AppProvider.test.js | |
import React from "react"; | |
import { render, unmountComponentAtNode } from "react-dom"; | |
import { act } from "react-dom/test-utils"; | |
import AppProvider from "./AppProvider"; | |
describe("<AppProvider />", () => { | |
let container = null; | |
beforeEach(() => { |
This file contains hidden or 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
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
firebase-debug.log* | |
# Firebase cache | |
.firebase/ |
This file contains hidden or 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
{ | |
"printWidth": 100, | |
"trailingComma": "all", | |
"tabWidth": 2, | |
"semi": true, | |
"singleQuote": true | |
} |
This file contains hidden or 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
{ | |
"presets": ["@babel/preset-env", "@babel/preset-react"], | |
"plugins": ["@babel/plugin-proposal-class-properties"] | |
} |
This file contains hidden or 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 ReactDOM from 'react-dom'; | |
import { BrowserRouter, Route } from 'react-router-dom'; | |
import Home from './pages/Home'; | |
import Book from './pages/Book'; | |
import './css/App.css'; | |
const AppRouter = () => ( | |
<BrowserRouter> | |
<Route exact path="/" component={Home} /> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | |
<title>Katalog Buku | Menampilkan koleksi buku terbaik</title> | |
</head> | |
<body> | |
<div id="app"></div> | |
</body> |
This file contains hidden or 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
export const API_BASE_URL = 'https://my-json-server.typicode.com/ridoansaleh/books-api'; |
This file contains hidden or 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 PropTypes from 'prop-types'; | |
import { Link } from 'react-router-dom'; | |
import axios from 'axios'; | |
import { Navbar } from '../components/Navbar'; | |
import { API_BASE_URL } from '../constant'; | |
class Book extends Component { | |
static propTypes = { | |
match: PropTypes.object, |
This file contains hidden or 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 { Link } from 'react-router-dom'; | |
import axios from 'axios'; | |
import { Navbar } from '../components/Navbar'; | |
import { API_BASE_URL } from '../constant'; | |
class Home extends Component { | |
constructor() { | |
super(); |
This file contains hidden or 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
body { | |
margin: 0; | |
} | |
.navbar { | |
width: 100%; | |
height: 30px; | |
padding: 15px 0; | |
background-color: #5d5553; | |
} |