Ganti Image Logo
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import {
|
||||
Badge,
|
||||
Box,
|
||||
Collapse,
|
||||
Group,
|
||||
Image,
|
||||
Input,
|
||||
NavLink as MantineNavLink,
|
||||
Stack,
|
||||
Text,
|
||||
useMantineColorScheme,
|
||||
useMantineColorScheme
|
||||
} from "@mantine/core";
|
||||
import { useLocation, useNavigate } from "@tanstack/react-router";
|
||||
import { ChevronDown, ChevronUp, Search } from "lucide-react";
|
||||
@@ -66,30 +64,7 @@ export function Sidebar({ className }: SidebarProps) {
|
||||
return (
|
||||
<Box className={className}>
|
||||
{/* Logo */}
|
||||
<Box
|
||||
p="md"
|
||||
style={{ borderBottom: "1px solid var(--mantine-color-gray-3)" }}
|
||||
>
|
||||
<Group gap="xs">
|
||||
<Badge
|
||||
color="dark"
|
||||
variant="filled"
|
||||
size="xl"
|
||||
radius="md"
|
||||
py="xs"
|
||||
px="md"
|
||||
style={{ fontSize: "1.5rem", fontWeight: "bold" }}
|
||||
>
|
||||
DESA
|
||||
</Badge>
|
||||
<Badge color="green" variant="filled" size="md" radius="md">
|
||||
+
|
||||
</Badge>
|
||||
</Group>
|
||||
<Text size="xs" c="dimmed" mt="xs">
|
||||
Digitalisasi Desa Transparansi Kerja
|
||||
</Text>
|
||||
</Box>
|
||||
<Image src={"/logo-desa-plus.png"} width={201} height={84} />
|
||||
|
||||
{/* Search */}
|
||||
<Box p="md">
|
||||
|
||||
BIN
src/components/ui/logo-desa-plus.png
Normal file
BIN
src/components/ui/logo-desa-plus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
34
src/index.ts
34
src/index.ts
@@ -95,10 +95,27 @@ if (!isProduction) {
|
||||
getHeader(name: string) {
|
||||
return this.headers[name.toLowerCase()];
|
||||
},
|
||||
writeHead(code: number, headers: Record<string, string>) {
|
||||
this.statusCode = code;
|
||||
Object.assign(this.headers, headers);
|
||||
},
|
||||
write(chunk: any, callback?: () => void) {
|
||||
// Collect chunks for streaming responses
|
||||
if (!this._chunks) this._chunks = [];
|
||||
this._chunks.push(chunk);
|
||||
if (callback) callback();
|
||||
return true; // Indicate we can accept more data
|
||||
},
|
||||
headers: {} as Record<string, string>,
|
||||
end(data: any) {
|
||||
// Handle potential Buffer or string data from Vite
|
||||
let body = data;
|
||||
|
||||
// If we have collected chunks from write() calls, combine them
|
||||
if (this._chunks && this._chunks.length > 0) {
|
||||
body = Buffer.concat(this._chunks);
|
||||
}
|
||||
|
||||
if (data instanceof Uint8Array) {
|
||||
body = data;
|
||||
} else if (typeof data === "string") {
|
||||
@@ -158,6 +175,11 @@ if (!isProduction) {
|
||||
if (fs.existsSync(srcPath)) {
|
||||
filePath = srcPath;
|
||||
}
|
||||
// Check public folder for static assets
|
||||
const publicPath = path.join("public", pathname);
|
||||
if (fs.existsSync(publicPath)) {
|
||||
filePath = publicPath;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. If not found and looks like an asset (has extension), try root of dist or src
|
||||
@@ -173,8 +195,18 @@ if (!isProduction) {
|
||||
) {
|
||||
filePath = fallbackDistPath;
|
||||
}
|
||||
// Try public folder
|
||||
else {
|
||||
const fallbackPublicPath = path.join("public", filename);
|
||||
if (
|
||||
fs.existsSync(fallbackPublicPath) &&
|
||||
fs.statSync(fallbackPublicPath).isFile()
|
||||
) {
|
||||
filePath = fallbackPublicPath;
|
||||
}
|
||||
}
|
||||
// Special handling for PWA files in src
|
||||
else if (pathname.includes("assetlinks.json")) {
|
||||
if (pathname.includes("assetlinks.json")) {
|
||||
const srcFilename = pathname.includes("assetlinks.json")
|
||||
? ".well-known/assetlinks.json"
|
||||
: filename;
|
||||
|
||||
@@ -8,6 +8,7 @@ import { createServer as createViteServer } from "vite";
|
||||
export async function createVite() {
|
||||
return createViteServer({
|
||||
root: process.cwd(),
|
||||
publicDir: "public",
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(process.cwd(), "./src"),
|
||||
|
||||
Reference in New Issue
Block a user