Skip to content

Commit

Permalink
spostamento sezione info
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkin committed Jun 6, 2024
1 parent 6c405b4 commit 3ba8699
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 240 deletions.
208 changes: 65 additions & 143 deletions src/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,63 +129,70 @@ export function App() {
}, []);

return (
<ol className="flex flex-col gap-6 mb-12">
{profiles.map((p, i) => (
<ControlsItem key={p} id={p} label={labels[i]}>
<Select
id={p}
ref={(el) => (selectRefs.current[p] = el)}
name={p}
placeholder={`Select a ${labels[i]}...`}
isDisabled={!options[p]?.length}
options={options[p] ?? []}
onChange={(e) => loadOptions(e?.value)}
/>
</ControlsItem>
))}

<ControlsItem key="format" id="format" label="Format">
<Select
id="format"
ref={downloadRef}
name="format"
placeholder="Select a file format..."
isDisabled={!resources.length}
options={resources}
onChange={(e) => setDownloadPath(e?.value ?? '#')}
/>
</ControlsItem>

<li key="download" className="flex flex-col gap-2">
{resources.length && downloadPath !== '#' ? (
<a
className="bg-ored text-oblue-dark font-bold py-2 px-4 rounded inline-flex items-center justify-between"
target="_blank"
href={`${window.API_DOMAIN}${downloadPath}`}
download={`ondata_confini_amministrativi_${downloadPath
.replace(/^\//, '')
.replace(/\//g, '_')}`}>
<span>Download</span>
<svg
className="fill-current w-4 h-4 mr-2"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20">
<path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" />
</svg>
</a>
) : (
<button className="bg-oblue-dark text-oblue-light border-oblue-dark font-bold py-2 px-4 rounded inline-flex items-center justify-between opacity-50 cursor-not-allowed">
<span>Download</span>
<svg
className="fill-current w-4 h-4 mr-2"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20">
<path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" />
</svg>
</button>
)}
</li>
</ol>
<>
<ol className="flex flex-col gap-6">
{profiles.map((p, i) => (
<ControlsItem key={p} id={p} label={labels[i]}>
<Select
id={p}
ref={(el) => (selectRefs.current[p] = el)}
name={p}
placeholder={`Select a ${labels[i]}...`}
isDisabled={!options[p]?.length}
options={options[p] ?? []}
onChange={(e) => loadOptions(e?.value)}
/>
</ControlsItem>
))}
</ol>

{resources.length > 0 && (
<ol className="flex flex-col gap-6">
<ControlsItem key="format" id="format" label="Format">
<Select
id="format"
ref={downloadRef}
name="format"
placeholder="Select a file format..."
isDisabled={!resources.length}
options={resources}
onChange={(e) => setDownloadPath(e?.value ?? '#')}
/>
</ControlsItem>


<li key="download" className="flex flex-col gap-2">
{downloadPath !== '#' ? (
<a
className="bg-ored text-oblue-dark font-bold py-2 px-4 rounded inline-flex items-center justify-between"
target="_blank"
href={`${window.API_DOMAIN}${downloadPath}`}
download={`ondata_confini_amministrativi_${downloadPath
.replace(/^\//, '')
.replace(/\//g, '_')}`}>
<span>Download</span>
<svg
className="fill-current w-4 h-4 mr-2"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20">
<path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" />
</svg>
</a>
) : (
<button className="bg-oblue-dark text-oblue-light border-oblue-dark font-bold py-2 px-4 rounded inline-flex items-center justify-between opacity-50 cursor-not-allowed">
<span>Download</span>
<svg
className="fill-current w-4 h-4 mr-2"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20">
<path d="M13 8V2H7v6H2l8 8 8-8h-5zM0 18h20v2H0v-2z" />
</svg>
</button>
)}
</li>
</ol>
)}
</>
);
}

Expand Down Expand Up @@ -221,92 +228,7 @@ export function App() {

return (
<main className="min-h-screen bg-oblue-light text-oblue-dark flex flex-row justify-center">
<section className="p-6 max-w-sm">
<p className="mb-4">
Questo progetto nasce nel{' '}
<a
rel="noopener noreferrer"
target="_blank"
href="https://github.com/teamdigitale/confini-amministrativi-istat"
className="underline">
novembre del 2019
</a>{' '}
nell'ambito delle attività del{' '}
<a
rel="noopener noreferrer"
target="_blank"
href="https://teamdigitale.governo.it/"
className="underline">
Team per la Trasformazione Digitale
</a>
. Dopo più di un anno di inattività viene preso in mano
dall'
<a
rel="noopener noreferrer"
target="_blank"
href="https://www.ondata.it/"
className="underline">
associazione OnData
</a>{' '}
nel{' '}
<a
rel="noopener noreferrer"
target="_blank"
href="https://github.com/ondata/confini-amministrativi-istat"
className="underline">
marzo del 2021
</a>
. Questa è l'ultima evoluzione del progetto originale
sviluppata nel corso del 2023.
</p>
<p className="mb-4">
La fonte ufficiale delle risorse geografiche è l'
<a
rel="noopener noreferrer"
target="_blank"
href="https://www.istat.it/it/archivio/222527"
className="underline">
ISTAT
</a>
. Altre fonti ufficiali con cui i dati sono arricchiti sono
l'
<a
rel="noopener noreferrer"
target="_blank"
href="https://www.anagrafenazionale.interno.it/"
className="underline">
ANPR
</a>{' '}
e il progetto{' '}
<a
rel="noopener noreferrer"
target="_blank"
href="https://www.agid.gov.it/it/dati/vocabolari-controllati"
className="underline">
OntoPiA
</a>
.
</p>
<p className="mb-12">
Usa i controlli sottostanti per selezionare la risorsa
geografica di interesse. Seleziona il paese, l'edizione dei
dati e il livello di suddivisione amministrativa.
Eventualmente seleziona anche il territorio specifico e la
sotto suddivisione amministrativa. Puoi vedere i confini
amministrativi nella mappa qui a fianco. Ogni territorio è
cliccabile e il tooltip mostra i dati associati. Puoi
scaricare la risorsa geografica selezionata in uno qualsiasi
dei formati supportati. Tutte le risorse qui presenti sono
rilasciate con{' '}
<a
rel="noopener noreferrer"
target="_blank"
href="https://www.agid.gov.it/it/dati/open-data"
className="underline">
licenza Open Data
</a>
.
</p>
<section className="p-6 max-w-sm flex flex-col justify-between">
<Controls />
</section>
<Map />
Expand Down
Loading

0 comments on commit 3ba8699

Please sign in to comment.