ntfy/web/src/components/Pref.js

52 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-12-29 14:20:53 +01:00
import * as React from "react";
export const PrefGroup = (props) => {
return (
<div role="table">
{props.children}
</div>
)
};
export const Pref = (props) => {
2023-01-09 21:40:46 +01:00
const justifyContent = (props.alignTop) ? "normal" : "center";
2022-12-29 14:20:53 +01:00
return (
<div
role="row"
style={{
display: "flex",
flexDirection: "row",
marginTop: "10px",
marginBottom: "20px",
}}
>
<div
role="cell"
id={props.labelId ?? ""}
aria-label={props.title}
style={{
flex: '1 0 40%',
display: 'flex',
flexDirection: 'column',
2023-01-09 21:40:46 +01:00
justifyContent: justifyContent,
2022-12-29 14:20:53 +01:00
paddingRight: '30px'
}}
>
<div><b>{props.title}</b>{props.subtitle && <em> ({props.subtitle})</em>}</div>
{props.description && <div><em>{props.description}</em></div>}
</div>
<div
role="cell"
style={{
flex: '1 0 calc(60% - 50px)',
display: 'flex',
flexDirection: 'column',
2023-01-09 21:40:46 +01:00
justifyContent: justifyContent
2022-12-29 14:20:53 +01:00
}}
>
{props.children}
</div>
</div>
);
};