style(carte): passe l'UI au DSFR
This commit is contained in:
parent
b1203faa69
commit
0bb25765d9
6 changed files with 29 additions and 37 deletions
|
@ -1,11 +1,6 @@
|
||||||
@import "colors";
|
@import "colors";
|
||||||
@import "constants";
|
@import "constants";
|
||||||
|
|
||||||
.areas-title {
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.areas {
|
.areas {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
%li{ class: editing ? 'mb-1' : 'flex column mb-2', data: { controller: 'geo-area', geo_area_id_value: geo_area.id } }
|
%li{ class: editing ? 'fr-mb-1w' : 'flex column fr-mb-2w', data: { controller: 'geo-area', geo_area_id_value: geo_area.id } }
|
||||||
- if editing
|
- if editing
|
||||||
= link_to '#', data: { action: 'geo-area#onClick' } do
|
= link_to '#', data: { action: 'geo-area#onClick' } do
|
||||||
= geo_area.label
|
= geo_area.label
|
||||||
= text_field_tag :description, geo_area.description, data: { action: 'focus->geo-area#onFocus input->geo-area#onInput', geo_area_target: 'description' }, placeholder: 'Description', class: 'no-margin', id: "geo_area_#{geo_area.id}_description"
|
= text_field_tag :description, geo_area.description, data: { action: 'focus->geo-area#onFocus input->geo-area#onInput', geo_area_target: 'description' }, placeholder: 'Description', class: 'fr-input', id: "geo_area_#{geo_area.id}_description"
|
||||||
- else
|
- else
|
||||||
= link_to '#', data: { action: 'geo-area#onClick' } do
|
= link_to '#', data: { action: 'geo-area#onClick' } do
|
||||||
= geo_area.label
|
= geo_area.label
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- if champ.selections_utilisateur.present?
|
- if champ.selections_utilisateur.present?
|
||||||
.areas-title Sélections utilisateur
|
.fr-label Sélections utilisateur
|
||||||
.areas
|
.areas
|
||||||
%ul
|
%ul
|
||||||
- champ.selections_utilisateur.slice(0, 20).each do |geo_area|
|
- champ.selections_utilisateur.slice(0, 20).each do |geo_area|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
et #{champ.selections_utilisateur.size - 20} autres points, lignes ou polygones.
|
et #{champ.selections_utilisateur.size - 20} autres points, lignes ou polygones.
|
||||||
|
|
||||||
- if champ.cadastres.present?
|
- if champ.cadastres.present?
|
||||||
.areas-title Parcelles cadastrales
|
.fr-label Parcelles cadastrales
|
||||||
.areas
|
.areas
|
||||||
%ul
|
%ul
|
||||||
- champ.cadastres.each do |geo_area|
|
- champ.cadastres.each do |geo_area|
|
||||||
|
|
|
@ -19,8 +19,11 @@ export function ImportFileInput({
|
||||||
useImportFiles(featureCollection, { createFeatures, deleteFeatures });
|
useImportFiles(featureCollection, { createFeatures, deleteFeatures });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="file-import" style={{ marginBottom: '10px' }}>
|
<div className="file-import fr-mb-3w">
|
||||||
<button className="button send primary" onClick={addInputFile}>
|
<button
|
||||||
|
className="fr-btn fr-btn--secondary fr-btn--icon-left fr-icon-add-circle-line"
|
||||||
|
onClick={addInputFile}
|
||||||
|
>
|
||||||
Ajouter un fichier GPX ou KML
|
Ajouter un fichier GPX ou KML
|
||||||
</button>
|
</button>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { useState, useId } from 'react';
|
import React, { useState, useId } from 'react';
|
||||||
import { fire } from '@utils';
|
import { fire } from '@utils';
|
||||||
import type { Feature } from 'geojson';
|
import type { Feature } from 'geojson';
|
||||||
import { PlusIcon, LocationMarkerIcon } from '@heroicons/react/outline';
|
|
||||||
import CoordinateInput from 'react-coordinate-input';
|
import CoordinateInput from 'react-coordinate-input';
|
||||||
|
|
||||||
export function PointInput() {
|
export function PointInput() {
|
||||||
|
@ -27,31 +26,29 @@ export function PointInput() {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="fr-input-group fr-mt-3w">
|
||||||
<label
|
<label className="fr-label" htmlFor={inputId}>
|
||||||
className="areas-title mt-1"
|
|
||||||
htmlFor={inputId}
|
|
||||||
style={{ fontSize: '16px' }}
|
|
||||||
>
|
|
||||||
Ajouter un point sur la carte
|
Ajouter un point sur la carte
|
||||||
|
<span className="fr-hint-text">
|
||||||
|
Exemple : 43°48'06"N 006°14'59"E
|
||||||
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<div className="flex align-center mt-1 mb-2">
|
<div className="flex flex-gap-1 fr-mt-1w">
|
||||||
{navigator.geolocation ? (
|
{navigator.geolocation ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="button mr-1"
|
className="fr-btn fr-btn--secondary fr-icon-map-pin-2-line"
|
||||||
onClick={getCurrentPosition}
|
onClick={getCurrentPosition}
|
||||||
title="Afficher votre position sur la carte"
|
title="Afficher votre position sur la carte"
|
||||||
>
|
>
|
||||||
<span className="sr-only">
|
<span className="sr-only">
|
||||||
Afficher votre position sur la carte
|
Afficher votre position sur la carte
|
||||||
</span>
|
</span>
|
||||||
<LocationMarkerIcon className="icon-size-big" aria-hidden />
|
|
||||||
</button>
|
</button>
|
||||||
) : null}
|
) : null}
|
||||||
<CoordinateInput
|
<CoordinateInput
|
||||||
id={inputId}
|
id={inputId}
|
||||||
className="m-0 mr-1"
|
className="fr-input"
|
||||||
value={value}
|
value={value}
|
||||||
onChange={(value: string, { dd }: { dd: [number, number] }) => {
|
onChange={(value: string, { dd }: { dd: [number, number] }) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
|
@ -71,7 +68,7 @@ export function PointInput() {
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="button"
|
className="fr-btn fr-icon-add-circle-line"
|
||||||
onClick={addPoint}
|
onClick={addPoint}
|
||||||
disabled={!feature}
|
disabled={!feature}
|
||||||
title="Ajouter le point avec les coordonnées saisies sur la carte"
|
title="Ajouter le point avec les coordonnées saisies sur la carte"
|
||||||
|
@ -79,9 +76,8 @@ export function PointInput() {
|
||||||
<span className="sr-only">
|
<span className="sr-only">
|
||||||
Ajouter le point avec les coordonnées saisies sur la carte
|
Ajouter le point avec les coordonnées saisies sur la carte
|
||||||
</span>
|
</span>
|
||||||
<PlusIcon className="icon-size-big" aria-hidden />
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,7 @@ export default function MapEditor({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<p className="fr-hint-text fr-mb-2w">
|
||||||
<p style={{ marginBottom: '20px' }}>
|
|
||||||
Besoin d'aide ?
|
Besoin d'aide ?
|
||||||
<a
|
<a
|
||||||
href="https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/cartographie"
|
href="https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/cartographie"
|
||||||
|
@ -47,7 +46,6 @@ export default function MapEditor({
|
||||||
consulter les tutoriels video
|
consulter les tutoriels video
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
{error && <FlashMessage message={error} level="alert" fixed={true} />}
|
{error && <FlashMessage message={error} level="alert" fixed={true} />}
|
||||||
|
|
||||||
<ImportFileInput featureCollection={featureCollection} {...actions} />
|
<ImportFileInput featureCollection={featureCollection} {...actions} />
|
||||||
|
|
Loading…
Reference in a new issue