1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-08-24 20:13:51 +02:00
ntfy/web/src/components/Pref.jsx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.1 KiB
React
Raw Normal View History

2022-12-29 14:20:53 +01:00
import * as React from "react";
export const PrefGroup = (props) => <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,
2022-12-29 14:20:53 +01:00
paddingRight: "30px",
}}
>
<div>
<b>{props.title}</b>
{props.subtitle && <em> ({props.subtitle})</em>}
</div>
{props.description && (
2023-05-23 21:13:01 +02:00
<div>
2022-12-29 14:20:53 +01:00
<em>{props.description}</em>
2023-05-23 21:13:01 +02:00
</div>
)}
</div>
<div
2022-12-29 14:20:53 +01:00
role="cell"
2023-05-23 21:13:01 +02:00
style={{
2022-12-29 14:20:53 +01:00
flex: "1 0 calc(60% - 50px)",
display: "flex",
flexDirection: "column",
2023-01-09 21:40:46 +01:00
justifyContent,
2023-05-23 21:13:01 +02:00
}}
>
2022-12-29 14:20:53 +01:00
{props.children}
2023-05-23 21:13:01 +02:00
</div>
</div>
2022-12-29 14:20:53 +01:00
);
};