From bc761856133c4c3c4fa25807e6f561e899f48d07 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Wed, 13 Nov 2019 19:20:47 +0000 Subject: [PATCH 1/2] Move css imports group to second place --- app/src/frontend/app.tsx | 6 +++--- .../frontend/building/data-components/data-entry-group.tsx | 4 ++-- .../building/edit-history/building-edit-summary.tsx | 4 ++-- .../building/edit-history/category-edit-summary.tsx | 4 ++-- app/src/frontend/building/edit-history/edit-history.tsx | 4 ++-- app/src/frontend/components/tooltip.tsx | 4 ++-- app/src/frontend/header.tsx | 4 ++-- app/src/frontend/map/legend.tsx | 4 ++-- app/src/frontend/map/map.tsx | 6 +++--- app/src/frontend/map/search-box.tsx | 4 ++-- app/src/frontend/pages/about.tsx | 4 ++-- app/tslint.json | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/src/frontend/app.tsx b/app/src/frontend/app.tsx index 64e35c8b..e87202bc 100644 --- a/app/src/frontend/app.tsx +++ b/app/src/frontend/app.tsx @@ -1,6 +1,9 @@ import React, { Fragment } from 'react'; import { Link, Route, Switch } from 'react-router-dom'; +import '../../node_modules/bootstrap/dist/css/bootstrap.min.css'; +import './app.css'; + import Header from './header'; import MapApp from './map-app'; import { Building } from './models/building'; @@ -19,9 +22,6 @@ import MyAccountPage from './user/my-account'; import PasswordReset from './user/password-reset'; import SignUp from './user/signup'; -import '../../node_modules/bootstrap/dist/css/bootstrap.min.css'; -import './app.css'; - interface AppProps { user?: User; diff --git a/app/src/frontend/building/data-components/data-entry-group.tsx b/app/src/frontend/building/data-components/data-entry-group.tsx index de4cd710..b51ad5bf 100644 --- a/app/src/frontend/building/data-components/data-entry-group.tsx +++ b/app/src/frontend/building/data-components/data-entry-group.tsx @@ -1,9 +1,9 @@ import React, { Fragment, useState } from "react"; -import { DownIcon, RightIcon } from "../../components/icons"; - import './data-entry-group.css'; +import { DownIcon, RightIcon } from "../../components/icons"; + interface DataEntryGroupProps { /** Name of the group */ name: string; diff --git a/app/src/frontend/building/edit-history/building-edit-summary.tsx b/app/src/frontend/building/edit-history/building-edit-summary.tsx index b67ffb3f..313adda4 100644 --- a/app/src/frontend/building/edit-history/building-edit-summary.tsx +++ b/app/src/frontend/building/edit-history/building-edit-summary.tsx @@ -1,13 +1,13 @@ import React from 'react'; +import './building-edit-summary.css'; + import { dataFields } from '../../data_fields'; import { arrayToDictionary, parseDate } from '../../helpers'; import { EditHistoryEntry } from '../../models/edit-history-entry'; import { CategoryEditSummary } from './category-edit-summary'; -import './building-edit-summary.css'; - interface BuildingEditSummaryProps { historyEntry: EditHistoryEntry; } diff --git a/app/src/frontend/building/edit-history/category-edit-summary.tsx b/app/src/frontend/building/edit-history/category-edit-summary.tsx index 2c00f211..917af847 100644 --- a/app/src/frontend/building/edit-history/category-edit-summary.tsx +++ b/app/src/frontend/building/edit-history/category-edit-summary.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { FieldEditSummary } from './field-edit-summary'; - import './category-edit-summary.css'; +import { FieldEditSummary } from './field-edit-summary'; + interface CategoryEditSummaryProps { category: string; fields: { diff --git a/app/src/frontend/building/edit-history/edit-history.tsx b/app/src/frontend/building/edit-history/edit-history.tsx index 29dadcfb..c6a160b6 100644 --- a/app/src/frontend/building/edit-history/edit-history.tsx +++ b/app/src/frontend/building/edit-history/edit-history.tsx @@ -1,13 +1,13 @@ import React, { useEffect, useState } from 'react'; +import './edit-history.css'; + import { Building } from '../../models/building'; import { EditHistoryEntry } from '../../models/edit-history-entry'; import ContainerHeader from '../container-header'; import { BuildingEditSummary } from './building-edit-summary'; -import './edit-history.css'; - interface EditHistoryProps { building: Building; } diff --git a/app/src/frontend/components/tooltip.tsx b/app/src/frontend/components/tooltip.tsx index e8402396..631ba720 100644 --- a/app/src/frontend/components/tooltip.tsx +++ b/app/src/frontend/components/tooltip.tsx @@ -1,9 +1,9 @@ import React, { Component } from 'react'; -import { InfoIcon } from './icons'; - import './tooltip.css'; +import { InfoIcon } from './icons'; + interface TooltipProps { text: string; } diff --git a/app/src/frontend/header.tsx b/app/src/frontend/header.tsx index 6ca98615..a41f594f 100644 --- a/app/src/frontend/header.tsx +++ b/app/src/frontend/header.tsx @@ -1,11 +1,11 @@ import React, { Fragment } from 'react'; import { NavLink } from 'react-router-dom'; +import './header.css'; + import { Logo } from './components/logo'; import { User } from './models/user'; -import './header.css'; - interface HeaderProps { user: User; diff --git a/app/src/frontend/map/legend.tsx b/app/src/frontend/map/legend.tsx index c2cdd552..c865a3bd 100644 --- a/app/src/frontend/map/legend.tsx +++ b/app/src/frontend/map/legend.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import './legend.css'; + import { DownIcon, UpIcon } from '../components/icons'; import { Logo } from '../components/logo'; -import './legend.css'; - const LEGEND_CONFIG = { location: { title: 'Location', diff --git a/app/src/frontend/map/map.tsx b/app/src/frontend/map/map.tsx index 4d7a5f1b..d55c5fc7 100644 --- a/app/src/frontend/map/map.tsx +++ b/app/src/frontend/map/map.tsx @@ -2,6 +2,9 @@ import { GeoJsonObject } from 'geojson'; import React, { Component, Fragment } from 'react'; import { AttributionControl, GeoJSON, Map, TileLayer, ZoomControl } from 'react-leaflet-universal'; +import '../../../node_modules/leaflet/dist/leaflet.css'; +import './map.css'; + import { HelpIcon } from '../components/icons'; import { Building } from '../models/building'; @@ -9,9 +12,6 @@ import Legend from './legend'; import SearchBox from './search-box'; import ThemeSwitcher from './theme-switcher'; -import '../../../node_modules/leaflet/dist/leaflet.css'; -import './map.css'; - const OS_API_KEY = 'NVUxtY5r8eA6eIfwrPTAGKrAAsoeI9E9'; interface ColouringMapProps { diff --git a/app/src/frontend/map/search-box.tsx b/app/src/frontend/map/search-box.tsx index da622bba..02945359 100644 --- a/app/src/frontend/map/search-box.tsx +++ b/app/src/frontend/map/search-box.tsx @@ -1,10 +1,10 @@ import { Point } from 'geojson'; import React, { Component } from 'react'; -import { SearchIcon } from '../components/icons'; - import './search-box.css'; +import { SearchIcon } from '../components/icons'; + interface SearchResult { type: string; attributes: { diff --git a/app/src/frontend/pages/about.tsx b/app/src/frontend/pages/about.tsx index 9b923d58..4df578e7 100644 --- a/app/src/frontend/pages/about.tsx +++ b/app/src/frontend/pages/about.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import './about.css'; + import Categories from '../building/categories'; import SupporterLogos from '../components/supporter-logos'; -import './about.css'; - const AboutPage = () => (
diff --git a/app/tslint.json b/app/tslint.json index d6d58ca2..14a0111d 100644 --- a/app/tslint.json +++ b/app/tslint.json @@ -7,7 +7,7 @@ { "grouped-imports": true, "groups": [ - { "name": "css", "match": "\\.css$", "order": 40 }, + { "name": "css", "match": "\\.css$", "order": 15 }, { "name": "parent directories", "match": "^\\.\\.", "order": 20 }, { "name": "current directory", "match": "^\\.", "order": 30 }, { "name": "libraries", "match": ".*", "order": 10 } From 0df2a369f479829f0efc018f6adc52077f3b2ef7 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Wed, 13 Nov 2019 19:23:22 +0000 Subject: [PATCH 2/2] Import library css without relative import path --- app/src/frontend/app.tsx | 2 +- app/src/frontend/map/map.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/app.tsx b/app/src/frontend/app.tsx index e87202bc..684e9617 100644 --- a/app/src/frontend/app.tsx +++ b/app/src/frontend/app.tsx @@ -1,7 +1,7 @@ import React, { Fragment } from 'react'; import { Link, Route, Switch } from 'react-router-dom'; -import '../../node_modules/bootstrap/dist/css/bootstrap.min.css'; +import 'bootstrap/dist/css/bootstrap.min.css'; import './app.css'; import Header from './header'; diff --git a/app/src/frontend/map/map.tsx b/app/src/frontend/map/map.tsx index d55c5fc7..f8c484e4 100644 --- a/app/src/frontend/map/map.tsx +++ b/app/src/frontend/map/map.tsx @@ -2,7 +2,7 @@ import { GeoJsonObject } from 'geojson'; import React, { Component, Fragment } from 'react'; import { AttributionControl, GeoJSON, Map, TileLayer, ZoomControl } from 'react-leaflet-universal'; -import '../../../node_modules/leaflet/dist/leaflet.css'; +import 'leaflet/dist/leaflet.css'; import './map.css'; import { HelpIcon } from '../components/icons';