Skip to content

Commit 9c37ce7

Browse files
author
Joel Jerez
committed
first commit
0 parents  commit 9c37ce7

21 files changed

+5022
-0
lines changed

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Store React Demo
2+
3+
This repository provides a simple live demo showcasing the usage of [@jereztech/i18n-react](https://github.com/jereztech/i18n-react) and [@jereztech/react-elements](https://github.com/jereztech/react-elements) in a React application.
4+
5+
## Features
6+
7+
- Implements internationalization (i18n) using `@jereztech/i18n-react`
8+
- Utilizes reusable UI components from `@jereztech/react-elements`
9+
- Demonstrates a basic store interface with localized content
10+
11+
## Prerequisites
12+
13+
Ensure you have the following installed:
14+
- [Node.js](https://nodejs.org/) (v18+ recommended)
15+
- [pnpm](https://pnpm.io/) or [npm](https://www.npmjs.com/)
16+
17+
## Installation
18+
19+
Clone the repository and install dependencies:
20+
21+
```sh
22+
git clone https://github.com/jereztech/store-react-demo.git
23+
cd store-react-demo
24+
pnpm install # or npm install
25+
```
26+
27+
## Running the Project
28+
29+
To start the development server, run:
30+
31+
```sh
32+
pnpm dev # or npm run dev
33+
```
34+
35+
This will start the application at `http://localhost:3000/`.
36+
37+
## Using @jereztech/i18n-react
38+
39+
This project integrates `@jereztech/i18n-react` for managing translations.
40+
41+
Example usage:
42+
43+
```tsx
44+
import { useI18n } from "@jereztech/i18n-react";
45+
46+
export default function Footer() {
47+
const { t } = useI18n('Navigation');
48+
return (
49+
<footer className="container">
50+
<p className="float-end">
51+
<a href="#">{t('back-to-top')}</a>
52+
</p>
53+
</footer>
54+
)
55+
}
56+
```
57+
58+
## License
59+
60+
This project is licensed under the **GNU General Public License v3.0**
61+
62+
---
63+
64+
Made with ❤️ by [Jerez Tech](https://jereztech.com)
65+

eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;

i18n.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { dictionaries } from '@/dictionaries';
2+
import { I18nConfig } from "@jereztech/i18n-react";
3+
4+
const i18nConfig: I18nConfig = {
5+
defaultLocale: 'en-US',
6+
dictionaries,
7+
};
8+
9+
export default i18nConfig;

next.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { NextConfig } from "next";
2+
3+
const basePath = process.env.NODE_ENV === 'production' ? '/store-react-demo' : '';
4+
5+
const nextConfig: NextConfig = {
6+
output: 'export',
7+
basePath,
8+
assetPrefix: basePath,
9+
images: {
10+
unoptimized: true,
11+
remotePatterns: [
12+
{ protocol: 'https', hostname: 'flagcdn.com' },
13+
{ protocol: 'https', hostname: 'fakestoreapi.com' },
14+
],
15+
},
16+
};
17+
18+
export default nextConfig;

0 commit comments

Comments
 (0)