Ganti Image Logo
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -33,6 +33,9 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
|
||||
# Dashboard-MD
|
||||
Dashboard-MD
|
||||
|
||||
# Playwright artifacts
|
||||
test-results/
|
||||
playwright-report/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "bun run gen:api && REACT_EDITOR=antigravity bun --hot src/index.ts",
|
||||
"dev": "lsof -ti:3000 | xargs kill -9 2>/dev/null || true; bun run gen:api && REACT_EDITOR=antigravity bun --hot src/index.ts",
|
||||
"lint": "biome check .",
|
||||
"check": "biome check --write .",
|
||||
"format": "biome format --write .",
|
||||
@@ -12,7 +12,7 @@
|
||||
"test": "bun test __tests__/api",
|
||||
"test:ui": "bun test --ui __tests__/api",
|
||||
"test:e2e": "bun run build && playwright test",
|
||||
"build": "bun build ./src/index.html --outdir=dist --sourcemap --target=browser --minify --define:process.env.NODE_ENV='\"production\"' --env='VITE_*'",
|
||||
"build": "bun build ./src/index.html --outdir=dist --sourcemap --target=browser --minify --define:process.env.NODE_ENV='\"production\"' --env='VITE_*' && cp -r public/* dist/ 2>/dev/null || true",
|
||||
"start": "NODE_ENV=production bun src/index.ts",
|
||||
"seed": "bun prisma/seed.ts"
|
||||
},
|
||||
|
||||
BIN
public/logo-desa-plus.png
Normal file
BIN
public/logo-desa-plus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -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