Combining information messages into <InfoMessage/>.

This commit is contained in:
Roland 2023-08-23 20:14:23 -06:00
parent 7c238f5dfa
commit 81e661d14c
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
3 changed files with 40 additions and 26 deletions

View file

@ -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 <Message info icon>
<SIcon name='question'/>
<Message.Content>
{children}
</Message.Content>
</Message>
}

View file

@ -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 <Message info icon>
<SIcon name='question'/>
<Message.Content>
<Message.Header>
Where do I get map files?
</Message.Header>
return <InfoMessage>
<Message.Header>
Where do I get map files?
</Message.Header>
<p>You can download map files from&nbsp;
<a href='https://download.geofabrik.de/'>https://download.geofabrik.de/</a>
</p>
<p>You can download map files from&nbsp;
<a href='https://download.geofabrik.de/'>https://download.geofabrik.de/</a>
</p>
<p><b>Download only the areas you need</b>. Large regions like all of Asia, or the entire
planet are most likely <b>too large</b> and won't render quickly. It is recommend to only
import files less than 1GB on a Raspberry Pi.</p>
<p><b>Download only the areas you need</b>. Large regions like all of Asia, or the entire
planet are most likely <b>too large</b> and won't render quickly. It is recommend to only
import files less than 1GB on a Raspberry Pi.</p>
<p>Only <b>*.osm.pbf</b> files are supported!</p>
<p>Only <b>*.osm.pbf</b> files are supported!</p>
<p>Place downloaded map files into <b>map/pbf</b> so they can be imported here.</p>
</Message.Content>
</Message>
<p>Place downloaded map files into <b>map/pbf</b> so they can be imported here.</p>
</InfoMessage>
}
function SlowImportMessage() {

View file

@ -32,6 +32,7 @@ import {
APIButton,
encodeMediaPath,
humanFileSize,
InfoMessage,
normalizeEstimate,
PageContainer,
Paginator,
@ -315,16 +316,13 @@ export const ZimSearchView = ({estimates}) => {
}
const ViewerMessage = () => {
return <Message info icon>
<SIcon name='hand point right'/>
<Message.Content>
<p>More Zim files are available from the full Kiwix library&nbsp;
<a href='https://download.kiwix.org/'>https://download.kiwix.org/</a>
</p>
return <InfoMessage>
<p>More Zim files are available from the full Kiwix library&nbsp;
<a href='https://download.kiwix.org/'>https://download.kiwix.org/</a>
</p>
<p>You can view your Zim files using the Kiwix app, or at <a href={VIEWER_URL}>{VIEWER_URL}</a></p>
</Message.Content>
</Message>
<p>You can view your Zim files using the Kiwix app, or at <a href={VIEWER_URL}>{VIEWER_URL}</a></p>
</InfoMessage>
}
const ZimCatalogItemRow = ({item, subscriptions, iso_639_codes, fetchSubscriptions}) => {