Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menambahkan Progress Bar Ketika Sedang Memuat Halaman #176

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"framer-motion": "^11.11.0",
"lucide-react": "^0.447.0",
"next": "14.2.14",
"next-nprogress-bar": "^2.3.13",
"next-themes": "^0.3.0",
"nextui-alert": "^0.1.4",
"react": "^18",
Expand Down
21 changes: 12 additions & 9 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import './_layout-components/main.css'
import { Providers } from './_layout-components/providers'
import { PageIndicator } from './_layout-components/page-indicator'
import { sans } from './_layout-components/font'
import ProgressBar from '@/components/progress-bar'

export const metadata: Metadata = {
title: 'Sensasi POS — Aplikasi Point of Sale Sederhana',
Expand All @@ -32,18 +33,20 @@ export default function RootLayout({
</head>

<body className={sans.className}>
<Providers>
{navbar}
<ProgressBar>
<Providers>
{navbar}

<div className="sticky top-0 z-20 w-full bg-amber-500 p-2.5 text-center tracking-wide text-zinc-800">
ⓘ Aplikasi masih dalam tahap pengembangan. Silakan kunjungi lagi
nanti.
</div>
<div className="sticky top-0 z-20 w-full bg-amber-500 p-2.5 text-center tracking-wide text-zinc-800">
ⓘ Aplikasi masih dalam tahap pengembangan. Silakan kunjungi lagi
nanti.
</div>

{children}
{children}

<PageIndicator />
</Providers>
<PageIndicator />
</Providers>
</ProgressBar>

{isProduction && <Analytics mode="production" debug={false} />}
</body>
Expand Down
18 changes: 18 additions & 0 deletions src/components/progress-bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use client'

import { AppProgressBar } from 'next-nprogress-bar'
import { ReactNode } from 'react'

export default function ProgressBar({ children }: { children: ReactNode }) {
return (
<>
{children}
<AppProgressBar
height="4px"
color="#006FEE"
options={{ showSpinner: false }}
shallowRouting
/>
</>
)
}