Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriocomo committed Jan 24, 2025
2 parents 60907ad + 918dbb2 commit c33d0de
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
13 changes: 13 additions & 0 deletions src/app/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const checkWarnings = async (values: PublicCode) => {
};

const resolver: Resolver<PublicCode | PublicCodeWithDeprecatedFields> = async (values) => {
console.log(values)
const res = await validatorFn(values as PublicCode);

if (res.errors.length === 0)
Expand Down Expand Up @@ -373,6 +374,18 @@ export default function Editor() {
required
/>
</Col>
<Col>
<EditorDescriptionInput<"documentation">
fieldName="documentation"
lang={lang}
/>
</Col>
<Col>
<EditorDescriptionInput<"apiDocumentation">
fieldName="apiDocumentation"
lang={lang}
/>
</Col>
<Col>
<EditorFeatures lang={lang} />
</Col>
Expand Down
20 changes: 7 additions & 13 deletions src/app/components/PubliccodeYmlLanguages.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useEffect } from 'react';
import { upperFirst } from 'lodash';
import { useTranslation } from "react-i18next";
import { useAppDispatch } from "../store";
import { getPubliccodeYmlLanguages, setPubliccodeYmlLanguages } from "../store/publiccodeYmlLanguages";
import { Multiselect } from "react-widgets";
import { useSelector } from 'react-redux';
import { allLangs } from '../../i18n';
import { upperFirst } from 'lodash';
import { Multiselect } from "react-widgets";
import { RenderItemProp } from 'react-widgets/cjs/List';
import { allLangs } from '../../i18n';
import { useAppDispatch } from "../store";
import { getPubliccodeYmlLanguages, setPubliccodeYmlLanguages } from "../store/publiccodeYmlLanguages";

interface Language {
value: string;
Expand All @@ -27,16 +26,11 @@ const renderTagValue = ({ item }: { item: Language }) => (

export const PubliccodeYmlLanguages = (): JSX.Element => {
const dispatch = useAppDispatch();
const { i18n, t } = useTranslation();
const { t } = useTranslation();
const publiccodeYmlLanguages = useSelector(getPubliccodeYmlLanguages)

useEffect(() => {
dispatch(setPubliccodeYmlLanguages([i18n.language]));
console.log(i18n.language)
}, [dispatch, i18n.language]);

const handleChange = (newSelection: Language[]) => {
if (newSelection.length != 0){
if (newSelection.length != 0) {
dispatch(setPubliccodeYmlLanguages(newSelection.map(l => l.value)));
}
};
Expand Down
9 changes: 6 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './app/App.tsx'
import { createRoot } from 'react-dom/client';
import App from './app/App.tsx';
// import './index.css'
import packageJson from '../package.json';

console.log(`${packageJson.name} ${packageJson.version}`);

createRoot(document.getElementById('app')!).render(
// <StrictMode>
<App />
<App />
// </StrictMode>,
)

0 comments on commit c33d0de

Please sign in to comment.