Changing Popup style to have a border that matches the theme.

This commit is contained in:
Roland 2025-01-22 17:48:44 -07:00
parent e4f490b90a
commit bf36568e13
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
3 changed files with 14 additions and 9 deletions

View file

@ -730,16 +730,16 @@ export function HelpPopup({
content,
position = 'left center',
iconSize = 'small',
header = ''
header = '',
iconStyle = {marginLeft: '0.25em', marginRight: '0.25em', border: '1px solid grey'},
}) {
const trigger = <Icon circular link name={icon} size={iconSize} style={iconStyle}/>;
return <Popup
content={content}
size={size}
position={position}
header={header || null}
trigger={<Icon circular link name={icon} size={iconSize}
style={{marginLeft: '0.25em', marginRight: '0.25em'}}
/>}
trigger={trigger}
/>
}
@ -752,8 +752,9 @@ export function HelpHeader({
popupPosition = null,
for_ = null,
required = false,
...props
}) {
return <div className='inline-header'>
return <div className='inline-header' {...props}>
<label htmlFor={for_}>
<Header as={headerSize}>{headerContent} {required && <RequiredAsterisk/>}</Header>
</label>

View file

@ -269,8 +269,7 @@ export function Placeholder(props) {
export function Popup(props) {
const {i} = useContext(ThemeContext);
props = {...i, ...props};
return <SPopup {...props}/>
return <SPopup {...i} style={{border: '1px solid grey'}} {...props}/>
}
export function Progress(props) {

View file

@ -1,6 +1,6 @@
import {Accordion, Header, Progress, Segment, Statistic, StatisticGroup, Table} from "../Theme";
import React, {useContext} from "react";
import {humanBandwidth, humanFileSize, LoadStatistic, useTitle} from "../Common";
import {HelpHeader, humanBandwidth, humanFileSize, LoadStatistic, useTitle} from "../Common";
import {ProgressPlaceholder} from "../Placeholder";
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
import {Media, SettingsContext, StatusContext, ThemeContext} from "../../contexts/contexts";
@ -281,7 +281,12 @@ export function StatusPage() {
</Media>
<Segment>
<SizedHeader>Drive Bandwidth</SizedHeader>
<HelpHeader
headerSize='h2'
headerContent='Drive Bandwidth'
popupContent='Inaccurate during startup. Becomes more accurate as the system is used.'
style={{marginBottom: '1em'}}
/>
{!_.isEmpty(diskBandwidthStats) ?
Object.entries(diskBandwidthStats).map(([name, disk]) => <DiskBandwidth key={name} {...disk}/>)
: <ProgressPlaceholder/>}