Skip to content

Commit b757509

Browse files
author
Ruben van Leeuwen
committed
Fix rebase errors
1 parent 8354fa8 commit b757509

File tree

3 files changed

+4
-98
lines changed

3 files changed

+4
-98
lines changed

frontend/apps/example/src/app/page.tsx

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,23 @@
11
'use client';
22

3-
<<<<<<< HEAD:frontend/apps/example/src/app/[locale]/page.tsx
4-
<<<<<<< HEAD
5-
<<<<<<< HEAD
6-
import { useParams } from 'next/navigation';
73
import {
4+
Locale,
85
PydanticForm,
96
PydanticFormFieldFormat,
107
PydanticFormFieldType,
118
} from 'pydantic-forms';
12-
=======
13-
>>>>>>> 6b4540b (Cleanup)
14-
=======
15-
import { useParams } from 'next/navigation';
16-
>>>>>>> 305eba5 (prettier)
179
import type {
18-
=======
19-
import {
20-
Locale,
21-
>>>>>>> faa8b5a (Resolved comments):frontend/apps/example/src/app/page.tsx
2210
PydanticComponentMatcher,
2311
PydanticFormApiProvider,
2412
PydanticFormCustomDataProvider,
2513
PydanticFormLabelProvider,
2614
} from 'pydantic-forms';
27-
import {
28-
PydanticForm,
29-
PydanticFormFieldFormat,
30-
PydanticFormFieldType,
31-
} from 'pydantic-forms';
32-
33-
<<<<<<< HEAD:frontend/apps/example/src/app/[locale]/page.tsx
34-
<<<<<<< HEAD
35-
<<<<<<< HEAD
36-
import { TextArea } from '@/fields';
3715

38-
import NLnl from '../../../messages/nl-NL.json';
39-
=======
40-
import {TextArea} from '@/fields';
41-
import {useParams} from "next/navigation";
42-
=======
43-
import {
44-
handleInvalidLocale,
45-
useGetTranslationMessages,
46-
} from '@/app/[locale]/useGetTranslationMessages';
47-
=======
48-
>>>>>>> faa8b5a (Resolved comments):frontend/apps/example/src/app/page.tsx
4916
import { TextArea } from '@/fields';
50-
>>>>>>> 305eba5 (prettier)
5117

52-
<<<<<<< HEAD:frontend/apps/example/src/app/[locale]/page.tsx
53-
>>>>>>> 6b4540b (Cleanup)
54-
import styles from '../page.module.css';
55-
=======
5618
import styles from './page.module.css';
57-
>>>>>>> faa8b5a (Resolved comments):frontend/apps/example/src/app/page.tsx
5819

59-
<<<<<<< HEAD
60-
export default function Home({
61-
messages,
62-
}: {
63-
messages: Record<string, string>;
64-
}) {
65-
const params = useParams();
66-
const locale = params?.locale as string; // Get locale from URL params
67-
=======
6820
export default function Home() {
69-
<<<<<<< HEAD:frontend/apps/example/src/app/[locale]/page.tsx
70-
const { locale } = useParams();
71-
const validLocale = handleInvalidLocale(locale);
72-
>>>>>>> 6b4540b (Cleanup)
73-
74-
=======
75-
>>>>>>> faa8b5a (Resolved comments):frontend/apps/example/src/app/page.tsx
7621
const pydanticFormApiProvider: PydanticFormApiProvider = async ({
7722
requestBody,
7823
}) => {
@@ -109,17 +54,6 @@ export default function Home() {
10954
});
11055
};
11156

112-
<<<<<<< HEAD
113-
=======
114-
const ResetButtonAlternative = () => (
115-
<button type="button">Alternative reset</button>
116-
);
117-
118-
const CancelButtonAlternative = () => (
119-
<button type="button">Alternative cancel</button>
120-
);
121-
122-
>>>>>>> 305eba5 (prettier)
12357
const componentMatcher = (
12458
currentMatchers: PydanticComponentMatcher[],
12559
): PydanticComponentMatcher[] => {
@@ -141,23 +75,13 @@ export default function Home() {
14175
];
14276
};
14377

144-
<<<<<<< HEAD:frontend/apps/example/src/app/[locale]/page.tsx
145-
<<<<<<< HEAD
146-
// const translations = getMessages(locale);
147-
// console.log('NEW translations', translations);
148-
149-
=======
150-
>>>>>>> 6b4540b (Cleanup)
151-
=======
15278
const customTranslations = {
15379
renderForm: {
15480
loading: 'The form is loading. Please wait.',
15581
},
15682
};
157-
15883
const locale = Locale.enGB;
15984

160-
>>>>>>> faa8b5a (Resolved comments):frontend/apps/example/src/app/page.tsx
16185
return (
16286
<div className={styles.page}>
16387
<h1 style={{ marginBottom: '20px' }}>Pydantic Form </h1>
@@ -175,26 +99,8 @@ export default function Home() {
17599
labelProvider: pydanticLabelProvider,
176100
customDataProvider: pydanticCustomDataProvider,
177101
componentMatcher: componentMatcher,
178-
<<<<<<< HEAD:frontend/apps/example/src/app/[locale]/page.tsx
179-
<<<<<<< HEAD
180-
<<<<<<< HEAD
181-
<<<<<<< HEAD
182-
translations: NLnl,
183-
=======
184-
translations : useGetTranslationMessages(validLocale)
185-
>>>>>>> 6b4540b (Cleanup)
186-
=======
187-
translations : useGetTranslationMessages(validLocale), //Comment this line for default translations
188-
locale: validLocale
189-
>>>>>>> 07848e9 (Some refactor)
190-
=======
191-
translations: useGetTranslationMessages(validLocale), //Comment this line for default translations
192-
locale: validLocale,
193-
>>>>>>> 305eba5 (prettier)
194-
=======
195102
customTranslations: customTranslations,
196103
locale: locale,
197-
>>>>>>> faa8b5a (Resolved comments):frontend/apps/example/src/app/page.tsx
198104
}}
199105
/>
200106
</div>

frontend/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/packages/pydantic-forms/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export interface PydanticFormsContextConfig {
312312
customTranslations?: TranslationsJSON;
313313

314314
// locale
315-
locale?: string;
315+
locale?: Locale;
316316
}
317317

318318
export type FormRenderer = React.JSXElementConstructor<{
@@ -517,7 +517,7 @@ export type TranslationsJSON = {
517517
};
518518

519519
export type PydanticFormTranslationsWithLocale = {
520-
locale: string;
520+
locale: Locale;
521521
translations: TranslationsJSON;
522522
};
523523

0 commit comments

Comments
 (0)