Next.js merupakan sebuah React framework yang dibentuk buat mengatasi kasus client-side rendering yang dimiliki React. Sebuah halaman website yang dibentuk memakai React ‘terasa ringan’ lantaran tampilan website sangat interaktif.
Selain itu, ketika data berubah, React menggunakan efisien akan mengupdate bagian menurut halaman website yang memang perlu diupdate tanpa perlu reload satu halaman penuh.
Untuk menerima itu seluruh, client wajib load seluruh file JavaScript sebelum konten halaman ditampilkan. apabila file JS relatif akbar maka ketika yang diperlukan buat load pertama kali pula sebagai lebih lama.
Masalah lain menurut client-side rendering merupakan SEO, terdapat kemungkinan web crawler berusaha mengindex halaman yang belum terselesaikan dirender sepenuhnya (lantaran ketika load yang lama). Dan menduga web tadi blank.
Kedua kasus diatas bisa diselesaikan menggunakan teknik pre-rendering. Yaitu halaman HTML dan file JavaScript pada generate sebelum dikirim ke client.
Ada dua bentuk pre-rendering yaitu Server Side Rendering (SSR) dan Static Site Generator (SSG).
Sesuai namanya proses render terjadi pada server dan bukan pada client, setiap request ke server akan direspon menggunakan sebuah halaman HTML.
Setiap request ke server akan direspon menggunakan halaman HTML yang telah terselesaikan digenerate dalam ketika proses build. Teknik cache memakai CDN bisa diterapkan buat mempersingkat ketika akses.
Selain pre-rendering, Next.js pula mempunyai beberapa fitur buat memudahkan kita pada menciptakan pelaksanaan React:
Kemudian untuk selanjutnya buat folder dengan nama wlijoPay, lalu masuk ke dalam folder tersebut untuk membuat file dengan nama index.js ini untuk halaman Wlijo Pay.
import Head from 'next/head';
import LayoutHome from '../../Layouts/LayoutHome';
import Link from 'next/link'
const WlijoPay = () => {
return (
<div>
<Head>
<title>Wlijo Pay</title>
</Head>
<LayoutHome/>
<div className="b-check bg-green">
<div className="is-flex is-justify-content-space-between pl-2 pr-2">
<div className="is-align-items-center">
<button className="button wp is-size-6-mobile is-size-5-desktop">
<i className="fas fa-arrow-left pr-4 white is-size-5"></i>
<p className="white">Wlijo Pay</p>
</button>
</div>
<div className="is-flex is-align-items-center pr-3">
<i className="far fa-question-circle white is-size-5 pr-4"></i>
<i className="fas fa-cog white is-size-5"></i>
</div>
</div>
<div className="is-flex is-align-items-center pl-5 white">
<p>Rp. 702 </p>
<i className="fas fa-angle-up pl-2"></i>
</div>
<div className="columns is-mobile my-5">
<div className="column has-text-centered border-r">
<p className="is-size-5-desktop white">Saldo</p>
<p className="is-size-5-desktop white">Rp. 702</p>
</div>
<div className="column has-text-centered">
<p className="is-size-5-desktop white">Point</p>
<p className="is-size-5-desktop white">Rp. 0</p>
</div>
</div>
</div>
<div className="columns is-mobile my-5 pt-1">
<div className="column has-text-centered green">
<i className="fas fa-wallet is-size-1-desktop"></i>
<p className="is-size-5-desktop">Isi Saldo</p>
</div>
<div className="column has-text-centered green">
<i className="fas fa-exchange-alt is-size-1-desktop"></i>
<p className="is-size-5-desktop">Transfer</p>
</div>
<div className="column has-text-centered green">
<i className="fas fa-download is-size-1-desktop"></i>
<p className="is-size-5-desktop">Tarik Dana</p>
</div>
</div>
<div className="pt-0">
<div className="pl-5">
<p className="is-size-4-desktop">Transaksi Terakhir</p>
</div>
<div className="border-p pt-0"></div>
<div className="is-flex is-justify-content-space-between is-align-items-center">
<div className="is-flex is-align-items-center p-5">
<div className="image is-64x64 is-rounded bg-green pl-3 pt-2">
<i className="fas fa-download is-size-2 white"></i>
</div>
<div className="pl-5">
<p className="is-size-5-desktop">Penarikan</p>
<p className="is-size-7-desktop">Ke Rek : (*9508)</p>
<p className="is-size-7-desktop">01-10-2021</p>
</div></div>
<div className="is-flex is-align-items-center">
<div className="pr-5">
<p className="is-size-6-desktop">- Rp. 21.000</p>
<p className="is-size-7-desktop green has-text-right">Berhasil</p>
</div>
<div>
<i className="fas fa-angle-right is-size-5"></i>
</div>
</div>
</div>
<div className="border-p pt-0"></div>
<div className="is-flex is-justify-content-space-between is-align-items-center">
<div className="is-flex is-align-items-center p-5">
<div className="image is-64x64 is-rounded bg-green pl-4 pt-3">
<i className="fas fa-dollar-sign is-size-2 white"></i>
</div>
<div className="pl-5">
<p className="is-size-5-desktop">Pembayaran</p>
<p className="is-size-7-desktop">Ke Wlijo</p>
<p className="is-size-7-desktop">30-09-2021</p>
</div></div>
<div className="is-flex is-align-items-center">
<div className="pr-5">
<p className="is-size-6-desktop">- Rp. 21.000</p>
<p className="is-size-7-desktop green has-text-right">Berhasil</p>
</div>
<div>
<i className="fas fa-angle-right is-size-5"></i>
</div>
</div>
</div>
<div className="border-p pt-0"></div>
<div className="is-flex is-justify-content-space-between is-align-items-center">
<div className="is-flex is-align-items-center p-5">
<div className="image is-64x64 is-rounded bg-green pl-3 pt-3">
<i className="fas fa-wallet is-size-2 white"></i>
</div>
<div className="pl-5">
<p className="is-size-5-desktop">Top Up</p>
<p className="is-size-7-desktop">Dari Transfer Bank</p>
<p className="is-size-7-desktop">30-09-2021</p>
</div></div>
<div className="is-flex is-align-items-center">
<div className="pr-5">
<p className="is-size-6-desktop">+ Rp. 21.000</p>
<p className="is-size-7-desktop green has-text-right">Berhasil</p>
</div>
<div>
<i className="fas fa-angle-right is-size-5"></i>
</div>
</div>
</div>
<div className="border-p pt-0"></div>
<div className="is-flex is-justify-content-space-between is-align-items-center">
<div className="is-flex is-align-items-center p-5">
<div className="image is-64x64 is-rounded bg-green pl-4 pt-3">
<i className="fas fa-dollar-sign is-size-2 white"></i>
</div>
<div className="pl-5">
<p className="is-size-5-desktop">Pembayaran</p>
<p className="is-size-7-desktop">Ke Wlijo</p>
<p className="is-size-7-desktop">04-09-2021</p>
</div></div>
<div className="is-flex is-align-items-center">
<div className="pr-5">
<p className="is-size-6-desktop">- Rp. 21.000</p>
<p className="is-size-7-desktop green has-text-right">Berhasil</p>
</div>
<div>
<i className="fas fa-angle-right is-size-5"></i>
</div>
</div>
</div>
<div className="border-p pt-0"></div>
</div>
<div className="p-2 has-text-centered">
<a href="/" className="black is-flex is-size-6-mobile is-size-5-desktop is-justify-content-center is-align-items-center">
<p className="pr-1">Lihat Lainnya</p>
<i className="fas fa-angle-right is-size-5"></i>
</a>
</div>
</div>
)
}
export default WlijoPay;
@import 'bulma/css/bulma.css';
.border-p{
border-bottom: 1px solid black;
padding:10px 0px;
width: 100%;
text-align: left;
}
button.wp{
background-color: green;
border: none;
}
.border-r {
border-right: 2px solid rgb(255, 255, 255);
}
div.is-rounded{
border-radius: 100%;
}
.bg-white{
background-color : rgb(255, 255, 255);
}
.bg-green{
background-color : green;
}
.bg-red {
background-color: rgb(255, 70, 70);
}
.bg-gray {
background-color: rgb(207, 207, 207);
}
.red{
color: red;
}
.white , .table thead td.white{
color : white;
}
.gray{
color : gray;
}
.green {
color : green;
}
.black{
color: black;
}
a.checkout{
width: 100%;
border: none;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
div.b-check{
padding:10px 0px;
}
div.alamat-pengiriman{
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.bg-green-nb{
border: none;
color: white;
background-color: transparent;
}
.bg-green-nb:hover{
border: none;
color: white;
background-color: green;
}
.bg-wite-nb{
border: none;
}
.navbar-item {
color : green;
font-size: medium;
}
.navbar-link{
color: green;
font-size: medium;
}
.navbar-end .navbar-item:hover {
color: white;
background-color : green;
border-radius: 20px;
}
.navigasi {
padding:10px 20px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.bg-green {
background-color: green;
}
div.body{
background-image: url("../public/bg.jpg");
background-position: center;
background-size: cover;
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
body{
position: absolute;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#login-form-container{
position: absolute;
width: 100%;
height: 100%;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
justify-content: end;
}
div.login{
width: 600px;
background-color: rgba(255, 255, 255, 0.753);
border-radius: 10px;
}
a.tl{
color: green;
}
a.green-nb{
border: none;
color: green;
}
a.green-nb:hover{
background-color: green;
color: white;
}
a.green-gb{
border: solid 1px green;
color: green;
}
.navbar-brand .navbar-item img {
max-height: 50px;
}
.navbar-menu {
box-shadow: none;
}
.divi {
border-right: 2px solid gray;
}
.active {
color: green;
}
div.aksi .button:hover {
color: white;
}
.btm-border {
border-bottom: 2px solid green;
}
.tp-border {
border-top: 2px solid green;
}
.btm-bordergray {
border-bottom: 2px solid gray;
}
.tp-bordergray {
border-top: 2px solid gray;
}
.masukan {
max-width: 500px
}
.w1000 {
max-width: 1000px;
}
.hscroll {
overflow-x: auto;
padding : 10px;
margin: 10px;
}
.s {
width: 1000px;
}
table thead tr{
background-color: green;
}
.table tr td {
border: none;
}
tr:nth-child(even){background-color: #d4d4d4;}
div.columns {
margin: 0;
}
.wrapper-kasir {
max-width: 400px;
}
.none{
display: none;
}
.w {
word-wrap: break-word;
}
Komentar
Posting Komentar