moved all the pages into [locale]

This commit is contained in:
2024-02-16 15:51:26 +01:00
parent 64bd026d46
commit ba0934e8cd
19 changed files with 0 additions and 93 deletions

View File

@@ -0,0 +1,6 @@
import { NotFoundPage } from '@/app/ui/NotFoundPage';
const BillNotFound = () =>
<NotFoundPage title="404 Bill Not Found" description="Could not find the requested Bill." />;
export default BillNotFound;

View File

@@ -0,0 +1,19 @@
import { fetchLocationById } from '@/app/lib/actions/locationActions';
import { BillEditForm } from '@/app/ui/BillEditForm';
import { Main } from '@/app/ui/Main';
import { notFound } from 'next/navigation';
export default async function Page({ params:{ id:locationID } }: { params: { id:string } }) {
const location = await fetchLocationById(locationID);
if (!location) {
return(notFound());
}
return (
<Main>
<BillEditForm location={location} />
</Main>
);
}

View File

@@ -0,0 +1,6 @@
import { NotFoundPage } from '@/app/ui/NotFoundPage';
const BillNotFound = () =>
<NotFoundPage title="404 Bill Not Found" description="Could not find the requested Bill." />;
export default BillNotFound;

View File

@@ -0,0 +1,22 @@
import { notFound } from 'next/navigation';
import { fetchLocationById } from '@/app/lib/actions/locationActions';
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
import { BillDeleteForm } from '@/app/ui/BillDeleteForm';
import { fetchBillById } from '@/app/lib/actions/billActions';
import { Main } from '@/app/ui/Main';
export default async function Page({ params:{ id } }: { params: { id:string } }) {
const [locationID, billID] = id.split('-');
const [location, bill] = await fetchBillById(locationID, billID) ?? [];
if (!location || !bill) {
return(notFound());
}
return (
<Main>
<BillDeleteForm location={location} bill={bill} />
</Main>
);
}

View File

@@ -0,0 +1,6 @@
import { NotFoundPage } from '@/app/ui/NotFoundPage';
const BillNotFound = () =>
<NotFoundPage title="404 Bill Not Found" description="Could not find the requested Bill." />;
export default BillNotFound;

View File

@@ -0,0 +1,20 @@
import { fetchBillById } from '@/app/lib/actions/billActions';
import { BillEditForm } from '@/app/ui/BillEditForm';
import { Main } from '@/app/ui/Main';
import { notFound } from 'next/navigation';
export default async function Page({ params:{ id } }: { params: { id:string } }) {
const [locationID, billID] = id.split('-');
const [location, bill] = await fetchBillById(locationID, billID) ?? [];
if (!bill || !location) {
return(notFound());
}
return (
<Main>
<BillEditForm location={location} bill={bill} />
</Main>
);
}

14
app/[locale]/layout.tsx Normal file
View File

@@ -0,0 +1,14 @@
import '@/app/ui/global.css';
import { inter } from '@/app/ui/fonts';
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body className={`${inter.className} antialiased`}>{children}</body>
</html>
);
}

View File

@@ -0,0 +1,79 @@
import { FC } from 'react';
import { Main } from '@/app/ui/Main';
import { authConfig } from "@/app/lib/auth";
import { SignInButton } from '../ui/SignInButton';
import Image from 'next/image';
type Provider = {
id: string;
name: string;
type: string;
style: {
logo: string;
bg: string;
text: string;
};
};
function getProviders(): Provider[] {
const providerKeys: (keyof Provider)[] = ["id", "name", "type", "style"];
return authConfig.providers.map((provider) =>
getKeyValuesFromObject<Provider>(provider, providerKeys)
);
}
function getKeyValuesFromObject<T>(obj: any, keys: (keyof T)[]): T {
return keys.reduce((acc, key) => {
if (obj[key]) {
acc[key] = obj[key];
}
return acc;
}, {} as T);
}
const Page:FC = async () => {
const providers = await getProviders()
return (
<Main>
<h1 className="text-3xl font-bold text-center">
<span className="text-neutral-50 mr-3">Which bills are due?</span>
<span className="text-indigo-400">Which are payed?</span>
<span className="text-neutral-50 ml-3">How much are my expenses?</span>
</h1>
<p className="p mt-[1em] text-center">These are the questions this simple and free app will help you with ...</p>
<p className="p mb-[1em] text-center">... try it & use it completly free!</p>
<span className="text-center">
{
Object.values(providers).map((provider) => (
<div key={provider.name}>
<SignInButton provider={provider} />
</div>
))
}
</span>
<video className="m-auto mt-4" title="Demo osnovnih koraka u aplikaciji" role="img" data-js-id="hero" loop muted playsInline autoPlay poster="hero.png">
<source src="/welcome-demo-vp9-25fps-1500bps.webm" type="video/webm" />
</video>
<h1 className="text-2xl font-bold text-neutral-50 my-5">Easy copy of expenditures</h1>
<p className="p mt-[1em]">All your realestate and utilitys are automatically copied to the next month, so you don&apos;t neeed to do it by hand.</p>
<video className="m-auto mt-4" title="Demo kopiranja mjeseca" role="img" data-js-id="hero" loop muted playsInline autoPlay poster="bar-code-demo.png">
<source src="/kopiranje-mjeseca-demo.webm" type="video/webm" />
</video>
<h1 className="text-2xl font-bold text-neutral-50 my-5">Color signals status</h1>
<p className="p mt-[1em]">Each of trhe utility bills is color coded - at a glance you can see which bill was received and which one is payed.</p>
<Image src="/status-color-demo.png" alt="Boje označavaju status računa" className="m-auto mt-4" width={423} height={145} />
<h1 className="text-2xl font-bold text-neutral-50 my-5">Extraction of 2D bar code</h1>
<p className="p mt-[1em]">If the attached dokument contains a 2D bar code, it is automatically extracted and shown on the page, so you can scan it without opening the PDF document.</p>
<video className="m-auto mt-4" title="Demo generiranja 2D bar koda" role="img" data-js-id="hero" loop muted playsInline autoPlay poster="bar-code-demo.png">
<source src="/bar-code-demo.webm" type="video/webm" />
</video>
</Main>
);
}
export default Page;

31
app/[locale]/page.tsx Normal file
View File

@@ -0,0 +1,31 @@
import { FC, Suspense } from 'react';
import { Main } from './ui/Main';
import HomePage from './ui/HomePage';
import { MonthCardSkeleton } from './ui/MonthCardSkeleton';
export interface PageProps {
searchParams?: {
year?: string;
month?: string;
};
}
const HomePageSkeleton = () =>
<>
<MonthCardSkeleton checked={true} />
<MonthCardSkeleton />
<MonthCardSkeleton />
</>
const Page:FC<PageProps> = async ({ searchParams }) => {
return (
<Main>
<Suspense fallback={<HomePageSkeleton />}>
<HomePage searchParams={searchParams} />
</Suspense>
</Main>
);
}
export default Page;

View File

@@ -0,0 +1,40 @@
import { Main } from "../ui/Main";
import { PageFooter } from "../ui/PageFooter";
import { PageHeader } from "../ui/PageHeader";
const ConsentPage = () =>
<Main>
<article className="prose container mx-auto px-6">
<h1>Application Privacy Policy for Home Utility Bills Tracking Web App</h1>
<h2>1. Introduction</h2>
<p>Welcome to our Home Utility Bills Tracking Web Application (App). This Privacy Policy is intended to inform you about how we collect, use, and disclose your personal information through the operation of the App.</p>
<h2>2. Information We Collect</h2>
<ol>
<li><strong>Information You Provide</strong>: This includes the billing locations, bill names, attached documents, and any other data you enter into the App.</li>
<li><strong>Information from Google OAuth</strong>: When you authenticate using Google OAuth, we receive your email address and OAuth ID.</li>
</ol>
<h2>3. How We Use Your Information</h2>
<ol>
<li><strong>To Provide Our Service</strong>: We use your information to operate, maintain, and provide to you the features and functionality of the App.</li>
<li><strong>Communication</strong>: We may use your email address to communicate with you, for example, to send you notifications about your account or updates to our Privacy Policy.</li>
</ol>
<h2>4. How We Store Your Information</h2>
<p>Your information is stored on secure servers and is only accessible to a limited number of persons who have special access rights to such systems.</p>
<h2>5. Sharing of Your Information</h2>
<p>We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential.</p>
<h2>6. Security</h2>
<p>We implement a variety of security measures to maintain the safety of your personal information when you enter, submit, or access your personal information.</p>
<h2>7. Your Choices and Rights</h2>
<p>You have the right to access, update or request the deletion of your personal information. Please contact us directly to exercise these rights.</p>
<h2>8. Data Retention</h2>
<p>We will retain your information for as long as your account is active or as needed to provide you services. We will also retain and use your information as necessary to comply with our legal obligations, resolve disputes, and enforce our agreements.</p>
<h2>9. Changes to Our Privacy Policy</h2>
<p>We may update this privacy policy to reflect changes to our information practices. If we make any material changes, we will notify you by email (sent to the e-mail address specified in your account) or by means of a notice on this App prior to the change becoming effective.</p>
<h2>10. Contact Us</h2>
<p>If you have any questions about this Privacy Policy, please contact us at <a href="mail:support@rezije.app">support@rezije.app</a>.</p>
<h2>11. Consent</h2>
<p>By using our App, you consent to our privacy policy.</p>
</article>
</Main>;
export default ConsentPage;

View File

@@ -0,0 +1,52 @@
import { Main } from "../ui/Main";
const TermsPage = () =>
<Main>
<article className="prose container">
<h1>Terms of Service for Home Utility Bills Tracking Web Application</h1>
<h2>1. Introduction</h2>
<p>Welcome to our Home Utility Bills Tracking Web Application (App). These Terms of Service (Terms) govern your access to and use of our App. By accessing or using the App, you agree to be bound by these Terms.</p>
<h2>2. Use of the Service</h2>
<ol>
<li><strong>Eligibility</strong>: You must be at least 18 years old to use the App.</li>
<li><strong>Account Registration</strong>: You must register for an account through Google OAuth to access the App.</li>
<li><strong>User Responsibilities</strong>: You are responsible for all activities conducted under your account and for keeping your password confidential.</li>
</ol>
<h2>3. User Content</h2>
<ol>
<li><strong>Ownership</strong>: You retain all rights to the data you enter into the App, including billing locations, bill names, and attached documents.</li>
<li><strong>Licenses</strong>: You grant us a license to use, store, and display the data you enter into the App for the purpose of providing the service.</li>
</ol>
<h2>4. Prohibited Conduct</h2>
<p>You agree not to use the App in a way that:</p>
<ol>
<li>Violates any law or regulation.</li>
<li>Is harmful, fraudulent, deceptive, threatening, harassing, defamatory, obscene, or otherwise objectionable.</li>
<li>Jeopardizes the security of your account or anyone else&apos;s account.</li>
</ol>
<h2>5. Modifications to the App</h2>
<p>We reserve the right to modify or discontinue, temporarily or permanently, the App (or any part thereof) with or without notice.</p>
<h2>6. Termination</h2>
<p>We may terminate or suspend your access to the App immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.</p>
<h2>7. Disclaimers</h2>
<p>The App is provided on an AS IS and AS AVAILABLE basis. We disclaim all warranties of any kind, whether express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement.</p>
<p><strong>2D Barcode Information Disclaimer:</strong> We do not assume responsibility for the information contained within the 2D barcodes presented by the App. The content encoded in 2D barcodes is generated based on the information provided by the users or derived from the documents uploaded by the user, and we do not verify or guarantee its accuracy or completeness. Users are advised to review and confirm the correctness of such content before using it. We are not liable for any losses or damages resulting from the use of the 2D barcodes, including but not limited to transactions or payments initiated based on the information contained in these barcodes that may be detrimental to the user.</p>
<h2>8. Limitation of Liability</h2>
<p>In no event shall we be liable for any indirect, incidental, special, consequential or punitive damages, or any loss of profits or revenues, whether incurred directly or indirectly, or any loss of data, use, goodwill, or other intangible losses, resulting from:</p>
<ol>
<li>your access to or use of or inability to access or use the App;</li>
<li>any conduct or content of any third party on the App;</li>
<li>the information contained within the 2D barcodes generated or presented by the App.</li>
</ol>
<h2>9. Governing Law</h2>
<p>These Terms shall be governed and construed in accordance with the laws of Croatia, without regard to its conflict of law provisions.</p>
<h2>10. Changes</h2>
<p>We reserve the right, at our sole discretion, to modify or replace these Terms at any time. We will try to provide at least 10 days&apos; notice prior to any new terms taking effect.</p>
<h2>11. Contact Us</h2>
<p>If you have any questions about these Terms, please contact us at <a href="mail:support@rezije.app">support@rezije.app</a>.</p>
</article>
</Main>;
export default TermsPage;