Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sasasamaes committed Nov 29, 2024
1 parent 6d51874 commit 823981c
Show file tree
Hide file tree
Showing 69 changed files with 726 additions and 848 deletions.
33 changes: 17 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
module.exports = {
parser: '@typescript-eslint/parser',
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin', 'import'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
settings: {
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
}
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
settings: {
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
extends: [
'eslint:recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'prettier/prettier': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'import/no-unresolved': 'error',
'import/named': 'error',
},
ignorePatterns: ['.eslintrc.js'],
}
};
12 changes: 6 additions & 6 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
semi: true,
trailingComma: 'es5',
singleQuote: true,
printWidth: 100,
tabWidth: 2,
};
semi: true,
trailingComma: 'es5',
singleQuote: true,
printWidth: 100,
tabWidth: 2,
};
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**Revolutionary Farmers** is a Next.js project focused on advancing agriculture by providing a platform with escrow services. This project aims to bring innovative solutions to farmers, suppliers, and buyers in the agriculture sector by ensuring secure transactions through escrow as a service.

## ✨ Features

- **Escrow Service:** Secure transactions for agriculture.
- **User Authentication:** Secure login for all users.
- **Product Listings:** Manage and view agricultural products.
Expand All @@ -12,7 +13,7 @@
## 📝 Prerequisites

Ensure you have **Node.js** installed (version 18.x or higher).
To verify the installed version, use the following command:
To verify the installed version, use the following command:

```bash
node -v
Expand All @@ -23,29 +24,33 @@ If Node.js is not installed, download it from the official [Node.js website](htt
## 🚀 Getting Started

1. Clone the Repository:

```bash
git clone https://github.com/your-username/Revolutionary_Farmers.git
cd Revolutionary_Farmers/web/
```

2. Install dependencies:

```bash
npm install
```

3. Run development server:

```bash
npm run dev
```

4. Open [http://localhost:3001](http://localhost:3001) in your browser

Available Commands:

- `npm run dev` - Start development server
- `npm run build` - Create production build
- `npm run start` - Start production server
- `npm run lint` - Run ESLint linter
- `npm run format` - Format code with Prettier
- `npm run format` - Format code with Prettier

## 🛠 Tech Stack

Expand All @@ -65,4 +70,4 @@ Available Commands:
- [ESLint](https://eslint.org) (v8.57.1) - Linting tool for JavaScript/TypeScript
- [PostCSS](https://postcss.org) (v8) - CSS tool for transforming styles
- [Freighter API](https://github.com/stellar/freighter) - API for interacting with Stellar blockchain wallets
- [Stellar SDK](https://stellar.github.io/js-stellar-sdk) (v12.3.0) - JavaScript library for Stellar blockchain
- [Stellar SDK](https://stellar.github.io/js-stellar-sdk) (v12.3.0) - JavaScript library for Stellar blockchain
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
}
2 changes: 1 addition & 1 deletion messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
},
"submitButtonText": "Fund escrow"
}
}
}
2 changes: 1 addition & 1 deletion messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
},
"submitButtonText": "Financiar fideicomiso"
}
}
}
20 changes: 10 additions & 10 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { NextRequest, NextResponse } from 'next/server'
const PUBLIC_FILE = /\.(.*)$/
import { NextRequest, NextResponse } from 'next/server';

const PUBLIC_FILE = /\.(.*)$/;

export async function middleware(req: NextRequest) {
if (
req.nextUrl.pathname.startsWith('/_next') ||
req.nextUrl.pathname.includes('/api/') ||
PUBLIC_FILE.test(req.nextUrl.pathname)
) {
return
return;
}

if (req.nextUrl.locale === 'default') {
const locale = req.cookies.get('NEXT_LOCALE')?.value || 'en'
const locale = req.cookies.get('NEXT_LOCALE')?.value || 'en';

return NextResponse.redirect(
new URL(`/${locale}${req.nextUrl.pathname}${req.nextUrl.search}`, req.url)
)
);
}
}
}
8 changes: 4 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import createNextIntlPlugin from 'next-intl/plugin';

const withNextIntl = createNextIntlPlugin();

/** @type {import('next').NextConfig} */
const nextConfig = {};
export default withNextIntl(nextConfig);

export default withNextIntl(nextConfig);
8 changes: 4 additions & 4 deletions src/app/[locale]/escrow/cancel-escrow/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { CancelEscrowForm } from "@/components/modules/escrow/CancelEscrowForm";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import Bounded from '@/components/Bounded';
import { CancelEscrowForm } from '@/components/modules/escrow/CancelEscrowForm';
import WithAuthProtect from '@/constants/helpers/WithAuth';

const CancelEscrow = () => {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/app/[locale]/escrow/claim-escrow-earnings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { ClaimEscrowEarningsForm } from "@/components/modules/escrow/ClaimEscrowEarningsForm";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import Bounded from '@/components/Bounded';
import { ClaimEscrowEarningsForm } from '@/components/modules/escrow/ClaimEscrowEarningsForm';
import WithAuthProtect from '@/constants/helpers/WithAuth';

const ClaimEscrowEarnings = () => {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/app/[locale]/escrow/complete-escrow/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { CompleteEscrowForm } from "@/components/modules/escrow/CompleEscrowForm";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import Bounded from '@/components/Bounded';
import { CompleteEscrowForm } from '@/components/modules/escrow/CompleEscrowForm';
import WithAuthProtect from '@/constants/helpers/WithAuth';

const CompleteEscrow = () => {
return (
Expand Down
12 changes: 6 additions & 6 deletions src/app/[locale]/escrow/fund-escrow/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { FundEscrowForm } from "@/components/modules/escrow/FundEscrowForm";
import Loader from "@/components/utils/Loader";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import { useLoaderStore } from "@/store/utilsStore";
import Bounded from '@/components/Bounded';
import { FundEscrowForm } from '@/components/modules/escrow/FundEscrowForm';
import Loader from '@/components/utils/Loader';
import WithAuthProtect from '@/constants/helpers/WithAuth';
import { useLoaderStore } from '@/store/utilsStore';

const FundEscrow = () => {
const isLoading = useLoaderStore((state) => state.isLoading);
Expand Down
8 changes: 4 additions & 4 deletions src/app/[locale]/escrow/get-engagement/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { GetEngagementForm } from "@/components/modules/escrow/GetEngagementForm";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import Bounded from '@/components/Bounded';
import { GetEngagementForm } from '@/components/modules/escrow/GetEngagementForm';
import WithAuthProtect from '@/constants/helpers/WithAuth';

const GetEngagement = () => {
return (
Expand Down
12 changes: 6 additions & 6 deletions src/app/[locale]/escrow/initialize-escrow/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { InitializeEscrowForm } from "@/components/modules/escrow/InitializeEscrowForm";
import Loader from "@/components/utils/Loader";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import { useLoaderStore } from "@/store/utilsStore/store";
import Bounded from '@/components/Bounded';
import { InitializeEscrowForm } from '@/components/modules/escrow/InitializeEscrowForm';
import Loader from '@/components/utils/Loader';
import WithAuthProtect from '@/constants/helpers/WithAuth';
import { useLoaderStore } from '@/store/utilsStore/store';

const CreateEscrow = () => {
const isLoading = useLoaderStore((state) => state.isLoading);
Expand Down
8 changes: 4 additions & 4 deletions src/app/[locale]/escrow/refund-remaining-funds/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { RefundRemainingFundsForm } from "@/components/modules/escrow/RefundRemainingFundsForm";
import WithAuthProtect from "@/constants/helpers/WithAuth";
import Bounded from '@/components/Bounded';
import { RefundRemainingFundsForm } from '@/components/modules/escrow/RefundRemainingFundsForm';
import WithAuthProtect from '@/constants/helpers/WithAuth';

const RefundRemainingFuns = () => {
return (
Expand Down
42 changes: 19 additions & 23 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
"use client";
'use client';

import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { NextIntlClientProvider } from "next-intl";
import localFont from "next/font/local";
import { Toaster } from "@/components/ui/toaster";
import Header from "@/components/header/Header";
import "./globals.css";
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import { NextIntlClientProvider } from 'next-intl';
import localFont from 'next/font/local';
import { Toaster } from '@/components/ui/toaster';
import Header from '@/components/header/Header';
import './globals.css';

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
src: './fonts/GeistVF.woff',
variable: '--font-geist-sans',
weight: '100 900',
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
src: './fonts/GeistMonoVF.woff',
variable: '--font-geist-mono',
weight: '100 900',
});

export default function RootLayout({
Expand All @@ -31,24 +31,20 @@ export default function RootLayout({
const router = useRouter();

useEffect(() => {
const storedLocale = localStorage.getItem("language") || locale;
const storedLocale = localStorage.getItem('language') || locale;
if (storedLocale !== currentLocale) {
const newPathname = window.location.pathname.replace(
/^\/[a-z]{2}/,
`/${storedLocale}`
);
const newPathname = window.location.pathname.replace(/^\/[a-z]{2}/, `/${storedLocale}`);
if (newPathname !== window.location.pathname) {
setCurrentLocale(storedLocale); router.replace(newPathname);
setCurrentLocale(storedLocale);
router.replace(newPathname);
}
}
}, [locale, currentLocale, router]);

useEffect(() => {
const loadMessages = async () => {
try {
const importedMessages = (
await import(`../../../messages/${currentLocale}.json`)
).default;
const importedMessages = (await import(`../../../messages/${currentLocale}.json`)).default;
setMessages(importedMessages);
} catch (error) {
console.error(`Failed to load messages for locale: ${currentLocale}`, error);
Expand Down
18 changes: 7 additions & 11 deletions src/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
"use client";
'use client';

import Bounded from "@/components/Bounded";
import { useTranslations } from "next-intl";
import Bounded from '@/components/Bounded';
import { useTranslations } from 'next-intl';

export default function Home() {

const t = useTranslations("HomePage");
const t = useTranslations('HomePage');

return (
<Bounded center={true}>
<div className="flex flex-col justify-center items-center w-full h-full mt-0 md:mt-20 gap-4">
<h1 className="flex flex-col items-center">
+{' '}
<span className="text-[40px] md:text-[80px] font-bold text-primary_green">
{t("title")}
</span>
<span className="text-[40px] md:text-[80px] text-white">
{t("subtitle")}
{t('title')}
</span>
+{' '}
<span className="text-[40px] md:text-[80px] text-white">{t('subtitle')}</span>+{' '}
</h1>
<p className="text-[16px] md:text-[20px] w-full md:max-w-[60%] text-white text-center">
{t("description")}
{t('description')}
</p>
</div>
</Bounded>
Expand Down
Loading

0 comments on commit 823981c

Please sign in to comment.