Updates
This commit is contained in:
parent
69d432b6af
commit
8f5abed48d
@ -24,12 +24,12 @@ type ImageUploadProps = DetailedHTMLProps<
|
|||||||
onChangeHandler?: (
|
onChangeHandler?: (
|
||||||
fileData: FileInputToBase64FunctionReturn | undefined,
|
fileData: FileInputToBase64FunctionReturn | undefined,
|
||||||
inputRef?: React.RefObject<HTMLInputElement | null>,
|
inputRef?: React.RefObject<HTMLInputElement | null>,
|
||||||
utils?: FileInputUtils
|
utils?: FileInputUtils,
|
||||||
) => any;
|
) => any;
|
||||||
changeHandler?: (
|
changeHandler?: (
|
||||||
fileData: FileInputToBase64FunctionReturn | undefined,
|
fileData: FileInputToBase64FunctionReturn | undefined,
|
||||||
inputRef?: React.RefObject<HTMLInputElement | null>,
|
inputRef?: React.RefObject<HTMLInputElement | null>,
|
||||||
utils?: FileInputUtils
|
utils?: FileInputUtils,
|
||||||
) => any;
|
) => any;
|
||||||
onClear?: () => void;
|
onClear?: () => void;
|
||||||
fileInputProps?: DetailedHTMLProps<
|
fileInputProps?: DetailedHTMLProps<
|
||||||
@ -95,7 +95,7 @@ export default function FileUpload({
|
|||||||
FileInputToBase64FunctionReturn | undefined
|
FileInputToBase64FunctionReturn | undefined
|
||||||
>(existingFile);
|
>(existingFile);
|
||||||
const [fileUrl, setFileUrl] = React.useState<string | undefined>(
|
const [fileUrl, setFileUrl] = React.useState<string | undefined>(
|
||||||
existingFileUrl
|
existingFileUrl,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [fileDraggedOver, setFileDraggedOver] = React.useState(false);
|
const [fileDraggedOver, setFileDraggedOver] = React.useState(false);
|
||||||
@ -168,11 +168,11 @@ export default function FileUpload({
|
|||||||
onChangeHandler?.(
|
onChangeHandler?.(
|
||||||
res,
|
res,
|
||||||
inputRef,
|
inputRef,
|
||||||
fileInputUtils
|
fileInputUtils,
|
||||||
);
|
);
|
||||||
changeHandler?.(res, inputRef, fileInputUtils);
|
changeHandler?.(res, inputRef, fileInputUtils);
|
||||||
fileInputProps?.onChange?.(e);
|
fileInputProps?.onChange?.(e);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@ -191,7 +191,7 @@ export default function FileUpload({
|
|||||||
className={twMerge(
|
className={twMerge(
|
||||||
"w-full relative h-full items-center justify-center overflow-hidden",
|
"w-full relative h-full items-center justify-center overflow-hidden",
|
||||||
"pb-10",
|
"pb-10",
|
||||||
previewImageWrapperProps?.className
|
previewImageWrapperProps?.className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
@ -222,7 +222,7 @@ export default function FileUpload({
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
"absolute p-2 top-2 right-2 z-20 bg-background-light dark:bg-background-dark",
|
"absolute p-2 top-2 right-2 z-20 bg-background-light dark:bg-background-dark",
|
||||||
"hover:bg-white dark:hover:bg-black"
|
"hover:bg-white dark:hover:bg-black",
|
||||||
)}
|
)}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
clearFileInput();
|
clearFileInput();
|
||||||
@ -283,7 +283,7 @@ export default function FileUpload({
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
"absolute p-2 top-2 right-2 z-20 bg-white dark:bg-black",
|
"absolute p-2 top-2 right-2 z-20 bg-white dark:bg-black",
|
||||||
"hover:bg-white dark:hover:bg-black"
|
"hover:bg-white dark:hover:bg-black",
|
||||||
)}
|
)}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
setFile(undefined);
|
setFile(undefined);
|
||||||
@ -303,7 +303,7 @@ export default function FileUpload({
|
|||||||
"w-full h-full cursor-pointer hover:bg-slate-100/50 dark:hover:bg-white/5",
|
"w-full h-full cursor-pointer hover:bg-slate-100/50 dark:hover:bg-white/5",
|
||||||
"border-dashed border-2",
|
"border-dashed border-2",
|
||||||
fileDraggedOver ? "bg-slate-100 dark:bg-white/10" : "",
|
fileDraggedOver ? "bg-slate-100 dark:bg-white/10" : "",
|
||||||
placeHolderWrapper?.className
|
placeHolderWrapper?.className,
|
||||||
)}
|
)}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
inputRef.current?.click();
|
inputRef.current?.click();
|
||||||
@ -341,14 +341,14 @@ export default function FileUpload({
|
|||||||
externalSetFile?.(res);
|
externalSetFile?.(res);
|
||||||
onChangeHandler?.(res);
|
onChangeHandler?.(res);
|
||||||
changeHandler?.(res);
|
changeHandler?.(res);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
{...placeHolderWrapper}
|
{...placeHolderWrapper}
|
||||||
>
|
>
|
||||||
<Center
|
<Center
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
fileDraggedOver ? "pointer-events-none" : ""
|
fileDraggedOver ? "pointer-events-none" : "",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Stack className="items-center gap-2">
|
<Stack className="items-center gap-2">
|
||||||
@ -382,10 +382,10 @@ export default function FileUpload({
|
|||||||
if (e.key == "Enter") {
|
if (e.key == "Enter") {
|
||||||
if (tempFileURLRef.current) {
|
if (tempFileURLRef.current) {
|
||||||
setFileUrl(
|
setFileUrl(
|
||||||
tempFileURLRef.current
|
tempFileURLRef.current,
|
||||||
);
|
);
|
||||||
externalSetFileURL(
|
externalSetFileURL(
|
||||||
tempFileURLRef.current
|
tempFileURLRef.current,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -401,10 +401,10 @@ export default function FileUpload({
|
|||||||
|
|
||||||
if (tempFileURLRef.current) {
|
if (tempFileURLRef.current) {
|
||||||
setFileUrl(
|
setFileUrl(
|
||||||
tempFileURLRef.current
|
tempFileURLRef.current,
|
||||||
);
|
);
|
||||||
externalSetFileURL(
|
externalSetFileURL(
|
||||||
tempFileURLRef.current
|
tempFileURLRef.current,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
11
public/robots.txt
Normal file
11
public/robots.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# https://www.tben.me robots.txt
|
||||||
|
|
||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
|
||||||
|
# Sitemaps
|
||||||
|
Sitemap: https://www.tben.me/sitemap.xml
|
||||||
|
|
||||||
|
# Optional: disallow common non-content paths (uncomment if needed)
|
||||||
|
# Disallow: /api/
|
||||||
|
# Disallow: /_next/
|
||||||
58
public/sitemap.xml
Normal file
58
public/sitemap.xml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<!-- Homepage -->
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/</loc>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<!-- Main Pages -->
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/about</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/skills</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/work</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/blog</loc>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/contact</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.6</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<!-- Blog Posts -->
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/blog/nginx-reverse-proxy-caching-rate-limiting-static-files</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.6</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/blog/solving-the-database-hassle</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.5</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/blog/find-your-perfect-framework</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.5</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://www.tben.me/blog/choosing-your-tech-stack</loc>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.5</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
||||||
Loading…
Reference in New Issue
Block a user