mirror of
https://git.aramjonghu.dev/AramJonghu/aramjonghu-site.git
synced 2026-09-07 07:43:31 +02:00
chore(icons): nerd-fonts icons included
This commit is contained in:
@@ -52,8 +52,8 @@ export default function Header({ theme }: HeaderProps) {
|
||||
</nav>
|
||||
|
||||
<div>
|
||||
<button className="ui-btn ui-btn:hover" onClick={toggleTheme}>
|
||||
{currentTheme === "macchiato" ? "🌙 Dark" : "☀️ Light"}
|
||||
<button className="ui-btn ui-btn:hover text-lg font-[NerdFontSymbols]" onClick={toggleTheme}>
|
||||
{currentTheme === "macchiato" ? "" : ""}
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
useMemo,
|
||||
type ComponentPropsWithoutRef,
|
||||
@@ -196,6 +197,8 @@ export default function MdProcessor({
|
||||
})
|
||||
: null;
|
||||
|
||||
const copyRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
if (highlighted) {
|
||||
return (
|
||||
<div className="relative border-2 border-ctp-text/50 rounded-md overflow-hidden my-6 bg-ctp-base">
|
||||
@@ -204,6 +207,32 @@ export default function MdProcessor({
|
||||
{lang}
|
||||
</span>
|
||||
)}
|
||||
<button
|
||||
ref={copyRef}
|
||||
onClick={() => {
|
||||
navigator.clipboard
|
||||
.writeText(code)
|
||||
.then(() => {
|
||||
if (copyRef.current) {
|
||||
copyRef.current.textContent =
|
||||
"Copied!";
|
||||
setTimeout(
|
||||
() => {
|
||||
if (
|
||||
copyRef.current
|
||||
)
|
||||
copyRef.current.textContent =
|
||||
"\uf0c5";
|
||||
},
|
||||
1500,
|
||||
);
|
||||
}
|
||||
});
|
||||
}}
|
||||
className="absolute top-1 right-1 px-2 py-1 text-base font-mono text-ctp-subtext0 hover:text-ctp-green transition-colors cursor-pointer select-none z-10 font-[NerdFontSymbols]"
|
||||
>
|
||||
|
||||
</button>
|
||||
<div
|
||||
className={`overflow-x-auto text-sm p-4 ${lang ? "pt-7" : ""}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
|
||||
Reference in New Issue
Block a user