Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit 7d8ae33

Browse files
Merge pull request #11 from aXenDeveloper/change_marketplace_ips
Change marketplace IPS to invisionize
2 parents c92f335 + c7c822c commit 7d8ae33

File tree

32 files changed

+437
-292
lines changed

32 files changed

+437
-292
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"commitlint",
66
"datetime",
77
"fluentui",
8+
"invisionize",
89
"overscan",
910
"stylelint",
1011
"Swipeable",

app/[locale]/(main)/faq/layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { getTranslator } from 'next-intl/server';
33
import { Metadata } from 'next';
44

55
import { WrapperFaq } from '@/views/faq/wrapper/WrapperFaq';
6-
7-
import { CONFIG_TITLE } from '../../../../config';
6+
import { CONFIG } from '@/config';
87

98
interface MetadataProps {
109
params: {
@@ -18,7 +17,7 @@ export async function generateMetadata({ params: { locale } }: MetadataProps): P
1817
return {
1918
title: {
2019
default: t('faq'),
21-
template: `%s - ${t('faq')} - ${CONFIG_TITLE}`
20+
template: `%s - ${t('faq')} - ${CONFIG.title}`
2221
}
2322
};
2423
}

app/[locale]/(main)/products/(products)/page.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getTranslator } from 'next-intl/server';
22

33
import { ProductsView } from '@/views/products/ProductsView';
4+
import { CONFIG, ExchangeRateToUSD } from '@/config';
45

56
interface MetadataProps {
67
params: {
@@ -16,6 +17,15 @@ export async function generateMetadata({ params: { locale } }: MetadataProps) {
1617
};
1718
}
1819

19-
export default function Page() {
20-
return <ProductsView />;
20+
const fetchExchangeRateToUSD = async (): Promise<ExchangeRateToUSD> => {
21+
const current = await fetch(CONFIG.nbpAPI);
22+
23+
return current.json();
24+
};
25+
26+
export default async function Page() {
27+
const exchangeRateToUSD = await fetchExchangeRateToUSD();
28+
const current = exchangeRateToUSD.rates;
29+
30+
return <ProductsView oneUSDtoPLN={current.length > 0 ? current[0].mid : undefined} />;
2131
}

app/[locale]/(main)/products/[id]/page.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { getTranslator } from 'next-intl/server';
22
import { notFound } from 'next/navigation';
33

44
import { ProductView } from '@/views/products/[id]/ProductView';
5-
import { dataProducts } from '@/views/products/dataProducts';
5+
import { productsData } from '@/views/products/productsData';
6+
import { CONFIG, ExchangeRateToUSD } from '@/config';
67

78
interface Props {
89
params: {
@@ -14,7 +15,7 @@ interface Props {
1415
export async function generateMetadata({ params: { id, locale } }: Props) {
1516
const t = await getTranslator(locale, 'nav');
1617

17-
const findProduct = dataProducts.find(product => product.id === id);
18+
const findProduct = productsData.find(product => product.id === id);
1819

1920
if (findProduct) {
2021
return {
@@ -27,12 +28,23 @@ export async function generateMetadata({ params: { id, locale } }: Props) {
2728
};
2829
}
2930

30-
export default function Page({ params: { id } }: Props) {
31-
const findProduct = dataProducts.find(product => product.id === id);
31+
const fetchExchangeRateToUSD = async (): Promise<ExchangeRateToUSD> => {
32+
const current = await fetch(CONFIG.nbpAPI);
33+
34+
return current.json();
35+
};
36+
37+
export default async function Page({ params: { id } }: Props) {
38+
const findProduct = productsData.find(product => product.id === id);
3239

3340
if (!findProduct) {
3441
notFound();
3542
}
3643

37-
return <ProductView {...findProduct} />;
44+
const exchangeRateToUSD = await fetchExchangeRateToUSD();
45+
const current = exchangeRateToUSD.rates;
46+
47+
return (
48+
<ProductView {...findProduct} oneUSDtoPLN={current.length > 0 ? current[0].mid : undefined} />
49+
);
3850
}

app/[locale]/page.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import { HomeView } from '@/views/home/HomeView';
2+
import { CONFIG, ExchangeRateToUSD } from '@/config';
23

3-
export default function Page() {
4-
return <HomeView />;
4+
const fetchExchangeRateToUSD = async (): Promise<ExchangeRateToUSD> => {
5+
const current = await fetch(CONFIG.nbpAPI);
6+
7+
return current.json();
8+
};
9+
10+
export default async function Page() {
11+
const exchangeRateToUSD = await fetchExchangeRateToUSD();
12+
const current = exchangeRateToUSD.rates;
13+
14+
return <HomeView oneUSDtoPLN={current.length > 0 ? current[0].mid : undefined} />;
515
}

app/layout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import '@/styles/global.scss';
33
import { Metadata } from 'next';
44
import { Analytics } from '@vercel/analytics/react';
55

6-
import { CONFIG_TITLE } from '../config';
6+
import { CONFIG } from '../config';
77

88
export function generateMetadata(): Metadata {
99
const desc =
1010
"I'm Maciej Piotr Balcerzak and I'm working as Software Engineer with a passion for creating beautiful and user-friendly products. I have experience in front-end, back-end, testing and UX/UI design, but my primary experience is front-end. Also I'm contributor for Invision Community making themes and apps.";
1111

1212
return {
1313
title: {
14-
default: CONFIG_TITLE,
15-
template: `%s - ${CONFIG_TITLE}`
14+
default: CONFIG.title,
15+
template: `%s - ${CONFIG.title}`
1616
},
1717
icons: {
1818
shortcut: '/icons/favicon.ico'
@@ -21,14 +21,14 @@ export function generateMetadata(): Metadata {
2121
themeColor: '#200706',
2222
metadataBase: new URL('https://axendev.net/'),
2323
openGraph: {
24-
title: CONFIG_TITLE,
24+
title: CONFIG.title,
2525
description: desc,
2626
images: [
2727
{
2828
url: '/icons/og.png',
2929
width: 1050,
3030
height: 350,
31-
alt: CONFIG_TITLE
31+
alt: CONFIG.title
3232
}
3333
]
3434
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Transfer products from IPS Marketplace to Invisionize
2+
3+
As you know IPS Marketplace is closing October 30, 2023 ([You can read more here](https://invisioncommunity.com/news/invision-community/marketplace-closure-r1283/)) and I am moving all products to [Invisionize](https://forum.invisionize.pl/).
4+
5+
## How to transfer license of my products?
6+
7+
1. Sign up on [Invisionize](https://forum.invisionize.pl/),
8+
2. Sand me a PM on [IPS Community](https://invisioncommunity.com/messenger/compose/?to=580858) with your [Invisionize](https://forum.invisionize.pl/) username and which products you want to transfer,
9+
3. Wait for my answer. I will transfer your purchases to your account.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Przenoszenie produktów z IPS Marketplace do Invisionize
2+
3+
Jak już wiesz IPS Marketplace zamyka się 30 Października 2023r. ([Więcej możesz przeczytać tutaj](https://invisioncommunity.com/news/invision-community/marketplace-closure-r1283/)) i przenoszę wszystkie produkty do [Invisionize](https://forum.invisionize.pl/).
4+
5+
## Jak przenieść licencję moich produktów?
6+
7+
1. Zarejestruj się na [Invisionize](https://forum.invisionize.pl/),
8+
2. Wyślij mi wiadomość na [IPS Community](https://invisioncommunity.com/messenger/compose/?to=580858) z nazwą użytkownika na [Invisionize](https://forum.invisionize.pl/) oraz które produkty chcesz przenieść,
9+
3. Poczekaj na odpowiedź. Ja przeniosę Twoje zakupy na Twoje konto.

components/button/Button.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { expect, describe, it } from 'vitest';
33

44
import { Button } from './Button';
55

6+
import { RootMock } from '../../__mocks__/RootMock';
7+
68
describe('Button', () => {
79
it('renders children', () => {
810
const { getByText } = render(<Button id="test">Hello World</Button>);
@@ -19,7 +21,8 @@ describe('Button', () => {
1921
const { getByTestId } = render(
2022
<Button id="test" href="/foo">
2123
Click me
22-
</Button>
24+
</Button>,
25+
{ wrapper: RootMock }
2326
);
2427
const button = getByTestId('button_test');
2528
expect(button.tagName).toBe('A');

components/layout/footer/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import style from './Footer.module.scss';
66
import { Logo } from '@/assets/Logo';
77
import { SocialFooter } from './socials/SocialsFooter';
88
import { InfoFooter } from './info/InfoFooter';
9-
import { CONFIG_TITLE } from '@/config';
9+
import { CONFIG } from '@/config';
1010

1111
export const Footer = () => {
1212
const t = useTranslations('global');
@@ -15,7 +15,7 @@ export const Footer = () => {
1515
<footer className={style.main}>
1616
<div className={cx('layout_wrapper', style.wrapper)}>
1717
<div className={style.logo}>
18-
<Link href="/" aria-label={t('logo', { name: CONFIG_TITLE })}>
18+
<Link href="/" aria-label={t('logo', { name: CONFIG.title })}>
1919
<Logo />
2020
</Link>
2121

0 commit comments

Comments
 (0)