From 0bb25765d978e9fc2bb81724f1726b6b8e969399 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 8 Feb 2024 17:08:45 +0100 Subject: [PATCH] style(carte): passe l'UI au DSFR --- app/assets/stylesheets/carte.scss | 5 ---- .../dossiers/geo_area_component.html.haml | 4 ++-- .../dossiers/geo_areas_component.html.haml | 4 ++-- .../MapEditor/components/ImportFileInput.tsx | 7 ++++-- .../MapEditor/components/PointInput.tsx | 24 ++++++++----------- app/javascript/components/MapEditor/index.tsx | 22 ++++++++--------- 6 files changed, 29 insertions(+), 37 deletions(-) diff --git a/app/assets/stylesheets/carte.scss b/app/assets/stylesheets/carte.scss index fa9f9e067..ec8dd3c48 100644 --- a/app/assets/stylesheets/carte.scss +++ b/app/assets/stylesheets/carte.scss @@ -1,11 +1,6 @@ @import "colors"; @import "constants"; -.areas-title { - font-weight: bold; - margin-top: 5px; - margin-bottom: 5px; -} .areas { margin-bottom: 10px; diff --git a/app/components/dossiers/geo_area_component.html.haml b/app/components/dossiers/geo_area_component.html.haml index 99e6f8aef..8498637f2 100644 --- a/app/components/dossiers/geo_area_component.html.haml +++ b/app/components/dossiers/geo_area_component.html.haml @@ -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 = link_to '#', data: { action: 'geo-area#onClick' } do = 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 = link_to '#', data: { action: 'geo-area#onClick' } do = geo_area.label diff --git a/app/components/dossiers/geo_areas_component.html.haml b/app/components/dossiers/geo_areas_component.html.haml index 52f8168f4..bb657eacc 100644 --- a/app/components/dossiers/geo_areas_component.html.haml +++ b/app/components/dossiers/geo_areas_component.html.haml @@ -1,5 +1,5 @@ - if champ.selections_utilisateur.present? - .areas-title Sélections utilisateur + .fr-label Sélections utilisateur .areas %ul - 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. - if champ.cadastres.present? - .areas-title Parcelles cadastrales + .fr-label Parcelles cadastrales .areas %ul - champ.cadastres.each do |geo_area| diff --git a/app/javascript/components/MapEditor/components/ImportFileInput.tsx b/app/javascript/components/MapEditor/components/ImportFileInput.tsx index e6d4bb4cd..68be216e2 100644 --- a/app/javascript/components/MapEditor/components/ImportFileInput.tsx +++ b/app/javascript/components/MapEditor/components/ImportFileInput.tsx @@ -19,8 +19,11 @@ export function ImportFileInput({ useImportFiles(featureCollection, { createFeatures, deleteFeatures }); return ( -
-
diff --git a/app/javascript/components/MapEditor/components/PointInput.tsx b/app/javascript/components/MapEditor/components/PointInput.tsx index c7ef342b0..90eaa2a20 100644 --- a/app/javascript/components/MapEditor/components/PointInput.tsx +++ b/app/javascript/components/MapEditor/components/PointInput.tsx @@ -1,7 +1,6 @@ import React, { useState, useId } from 'react'; import { fire } from '@utils'; import type { Feature } from 'geojson'; -import { PlusIcon, LocationMarkerIcon } from '@heroicons/react/outline'; import CoordinateInput from 'react-coordinate-input'; export function PointInput() { @@ -27,31 +26,29 @@ export function PointInput() { }; return ( - <> -