From 81e661d14ccca64848cf0d885a0771425b36dd6b Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 23 Aug 2023 20:14:23 -0600 Subject: [PATCH] Combining information messages into . --- app/src/components/Common.js | 10 +++++++++ app/src/components/Map.js | 40 +++++++++++++++++++++--------------- app/src/components/Zim.js | 16 +++++++-------- 3 files changed, 40 insertions(+), 26 deletions(-) diff --git a/app/src/components/Common.js b/app/src/components/Common.js index 96bb52b6..b6bb1afc 100644 --- a/app/src/components/Common.js +++ b/app/src/components/Common.js @@ -5,6 +5,7 @@ import { Card, Confirm, Container, + Icon as SIcon, IconGroup, Input, Label, @@ -1401,4 +1402,13 @@ export function APIButton({ ); return button; +} + +export function InfoMessage({children}) { + return + + + {children} + + } \ No newline at end of file diff --git a/app/src/components/Map.js b/app/src/components/Map.js index 7148a524..d1e7dfc2 100644 --- a/app/src/components/Map.js +++ b/app/src/components/Map.js @@ -1,5 +1,14 @@ import React, {useContext} from "react"; -import {APIButton, HelpPopup, humanFileSize, PageContainer, TabLinks, useTitle, WROLModeMessage} from "./Common"; +import { + APIButton, + HelpPopup, + humanFileSize, + InfoMessage, + PageContainer, + TabLinks, + useTitle, + WROLModeMessage +} from "./Common"; import {Route, Routes} from "react-router-dom"; import {getMapImportStatus, importMapFiles} from "../api"; import { @@ -59,26 +68,23 @@ function DockerMapImportWarning() { } function DownloadMessage() { - return - - - - Where do I get map files? - + return + + Where do I get map files? + -

You can download map files from  - https://download.geofabrik.de/ -

+

You can download map files from  + https://download.geofabrik.de/ +

-

Download only the areas you need. Large regions like all of Asia, or the entire - planet are most likely too large and won't render quickly. It is recommend to only - import files less than 1GB on a Raspberry Pi.

+

Download only the areas you need. Large regions like all of Asia, or the entire + planet are most likely too large and won't render quickly. It is recommend to only + import files less than 1GB on a Raspberry Pi.

-

Only *.osm.pbf files are supported!

+

Only *.osm.pbf files are supported!

-

Place downloaded map files into map/pbf so they can be imported here.

-
-
+

Place downloaded map files into map/pbf so they can be imported here.

+
} function SlowImportMessage() { diff --git a/app/src/components/Zim.js b/app/src/components/Zim.js index 2656f6e2..12f4be7c 100644 --- a/app/src/components/Zim.js +++ b/app/src/components/Zim.js @@ -32,6 +32,7 @@ import { APIButton, encodeMediaPath, humanFileSize, + InfoMessage, normalizeEstimate, PageContainer, Paginator, @@ -315,16 +316,13 @@ export const ZimSearchView = ({estimates}) => { } const ViewerMessage = () => { - return - - -

More Zim files are available from the full Kiwix library  - https://download.kiwix.org/ -

+ return +

More Zim files are available from the full Kiwix library  + https://download.kiwix.org/ +

-

You can view your Zim files using the Kiwix app, or at {VIEWER_URL}

-
-
+

You can view your Zim files using the Kiwix app, or at {VIEWER_URL}

+ } const ZimCatalogItemRow = ({item, subscriptions, iso_639_codes, fetchSubscriptions}) => {