diff --git a/src/assets/scss/components/pageBando.scss b/src/assets/scss/components/pageBando.scss new file mode 100644 index 0000000..df41696 --- /dev/null +++ b/src/assets/scss/components/pageBando.scss @@ -0,0 +1,13 @@ +.pageBando__templateSelection { + display: flex; + gap: 14px; + align-items: flex-end; + + .appForm__field { + width: 100%; + } + + button { + flex: 0 0 auto; + } +} \ No newline at end of file diff --git a/src/assets/scss/theme.scss b/src/assets/scss/theme.scss index bff55e7..f8f29a6 100644 --- a/src/assets/scss/theme.scss +++ b/src/assets/scss/theme.scss @@ -105,4 +105,5 @@ body { @import "./components/appPage.scss"; @import "./components/statsBigBadges.scss"; @import "./components/bandoStatusTag.scss"; -@import "./components/appForm.scss"; \ No newline at end of file +@import "./components/appForm.scss"; +@import "./components/pageBando.scss"; \ No newline at end of file diff --git a/src/components/ProtectedRoute/index.js b/src/components/ProtectedRoute/index.js index 7dccd3c..e6cefbc 100644 --- a/src/components/ProtectedRoute/index.js +++ b/src/components/ProtectedRoute/index.js @@ -1,8 +1,10 @@ import React from 'react'; -import { Navigate, Outlet } from 'react-router-dom'; +import { + //Navigate, + Outlet } from 'react-router-dom'; // tools -import AuthenticationService from '../../service/authentication-service'; +//import AuthenticationService from '../../service/authentication-service'; const ProtectedRoute = () => { diff --git a/src/pages/Bando/index.js b/src/pages/Bando/index.js index ccfe821..c9b0086 100644 --- a/src/pages/Bando/index.js +++ b/src/pages/Bando/index.js @@ -9,10 +9,13 @@ import { InputText } from 'primereact/inputtext'; import { InputTextarea } from 'primereact/inputtextarea'; import getBandoLabel from '../../helpers/getBandoLabel'; import { Button } from 'primereact/button'; +import { Dropdown } from 'primereact/dropdown'; const Bando = () => { const { id } = useParams(); const [data, setData] = useState({}); + const [selectedTemplate, setSelectedTemplate] = useState(null); + const [templates, setTemplate] = useState(null); const { control, reset, @@ -21,7 +24,7 @@ const Bando = () => { getValues } = useForm(data); const onSubmit = data => console.log(data); - console.log(errors, getValues()); + console.log('data', data); const onPublish = () => { console.log('click onPublish'); @@ -34,8 +37,8 @@ const Bando = () => { const data = 0 === bandoId ? { status: 'draft', - name: null, - description: null + name: '', + description: '' } : { name: 'Bando Innovazione 2024', @@ -48,6 +51,12 @@ const Bando = () => { } setData(data); reset(); + + const templates = [ + { name: 'Il mio template', value: 22 }, + { name: 'Template #11', value: 11 }, + ]; + setTemplate(templates) }, [id]); return ( @@ -62,6 +71,28 @@ const Bando = () => {
+