Skip to content
Open

Master #1749

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
18 changes: 18 additions & 0 deletions wab/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions wab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Binary file added wab/137f588a-3ab4-43c8-8678-8b5ee0288bd3.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions wab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Magic Patterns - Vite Template

This code was generated by [Magic Patterns](https://magicpatterns.com) for this design: [Source Design](https://www.magicpatterns.com/c/n8t6ftyeqwzmbvhlpr27qb)

## Getting Started

1. Run `npm install`
2. Run `npm run dev`
13 changes: 13 additions & 0 deletions wab/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cambodia Immigration Portal - Fork - Fork - Fork</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions wab/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "magic-patterns-vite-template",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "npx vite",
"build": "npx vite build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"preview": "npx vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"@emotion/react": "^11.13.3",
"lucide-react": "0.522.0"
},
"devDependencies": {
"@types/node": "^20.11.18",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.50.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.1",
"typescript": "^5.5.4",
"vite": "^5.2.0",
"tailwindcss": "3.4.17",
"autoprefixer": "latest",
"postcss": "latest"
}
}
6 changes: 6 additions & 0 deletions wab/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file added wab/public/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wab/public/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wab/public/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wab/public/image-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wab/public/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wab/public/logo-new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions wab/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React, { useState } from 'react';
import { GovernmentBar } from './components/GovernmentBar';
import { Header } from './components/Header';
import { AnnouncementBanner } from './components/AnnouncementBanner';
import { FeaturedNewsSection } from './components/FeaturedNewsSection';
import { ServiceCards } from './components/ServiceCards';
import { SmartGateSection } from './components/SmartGateSection';
import { NewsSection } from './components/NewsSection';
import { Footer } from './components/Footer';
import { LoginOverlay } from './pages/LoginPage';
import { DashboardPage } from './pages/DashboardPage';
import { ComplaintFormPage } from './pages/ComplaintFormPage';
import { QuestionFormPage } from './pages/QuestionFormPage';
import { LanguageProvider } from './lib/LanguageContext';
function AppContent() {
const [showLogin, setShowLogin] = useState(true);
const [currentPage, setCurrentPage] = useState<
'home' | 'dashboard' | 'complaint' | 'question'>(
'home');
const handleGuestLogin = () => {
setCurrentPage('dashboard');
setShowLogin(false);
};
if (currentPage === 'complaint') {
return <ComplaintFormPage onBack={() => setCurrentPage('dashboard')} />;
}
if (currentPage === 'question') {
return <QuestionFormPage onBack={() => setCurrentPage('dashboard')} />;
}
if (currentPage === 'dashboard') {
return (
<DashboardPage
onNavigateToComplaint={() => setCurrentPage('complaint')}
onNavigateToQuestion={() => setCurrentPage('question')} />);


}
return (
<div className="font-sans min-h-screen flex flex-col bg-white">
<GovernmentBar onLoginClick={() => setShowLogin(true)} />
<Header onLoginClick={() => setShowLogin(true)} />
<AnnouncementBanner />
<main className="flex-grow">
<FeaturedNewsSection />
<ServiceCards />
<SmartGateSection />
<NewsSection />
</main>
<Footer />

{/* Login Overlay */}
{showLogin &&
<LoginOverlay
onClose={() => setShowLogin(false)}
onGuestLogin={handleGuestLogin} />

}
</div>);

}
export function App() {
return (
<LanguageProvider>
<AppContent />
</LanguageProvider>);

}
29 changes: 29 additions & 0 deletions wab/src/components/AnnouncementBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { ChevronRight } from 'lucide-react';
import { useLanguage } from '../lib/LanguageContext';
export function AnnouncementBanner() {
const { t } = useLanguage();
return (
<div
className="w-full"
style={{
background: 'linear-gradient(to right, #E5792A, #F5A623)'
}}>

<a
href="https://arrival.gov.kh/"
target="_blank"
rel="noopener noreferrer"
className="container mx-auto px-4 py-3 flex items-center justify-center gap-2 group">

<span className="text-white text-sm md:text-base font-medium text-center">
{t('banner_earrival')}{' '}
<span className="font-bold text-lg md:text-2xl align-middle">
{t('banner_submission_free')}
</span>
</span>
<ChevronRight className="w-5 h-5 md:w-6 md:h-6 text-white shrink-0 group-hover:translate-x-1 transition-transform" />
</a>
</div>);

}
Loading