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
/* source: https://dev.to/nicolaserny/table-with-a-fixed-first-column-2c5b */ | |
/* work with bootstrap table css */ | |
/* make the first coloumn of the (row head and body) sticky */ | |
.table-sticky>tr>th:first-child,.table-sticky>tr>td:first-child { | |
position: sticky; | |
left: 0; | |
background-color: inherit; | |
} |
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
export const convertToRupiah = (angka) => { | |
var rupiah = ''; | |
var angkarev = angka.toString().split('').reverse().join(''); | |
for(var i = 0; i < angkarev.length; i++) if(i%3 == 0) rupiah += angkarev.substr(i,3)+'.'; | |
return rupiah.split('',rupiah.length-1).reverse().join(''); | |
} |
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 { useEffect, useState } from "react" | |
export function useToggleTheme() { | |
const [theme, setTheme] = useState('dark') | |
useEffect(() => { | |
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { | |
document.documentElement.classList.add('dark') | |
setTheme('dark') | |
} else { |