milestone 23 s3: convert features/settings/ReadOnlyConfigBanner.tsx to stylex
This commit is contained in:
@@ -50,9 +50,6 @@ const styles = stylex.create({
|
|||||||
paddingInline: "0.75rem",
|
paddingInline: "0.75rem",
|
||||||
paddingBlock: "0.5rem",
|
paddingBlock: "0.5rem",
|
||||||
},
|
},
|
||||||
mono: {
|
|
||||||
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
||||||
},
|
|
||||||
right: {
|
right: {
|
||||||
textAlign: "right",
|
textAlign: "right",
|
||||||
},
|
},
|
||||||
@@ -134,7 +131,7 @@ export default function ClientsPage() {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{clients.map((client) => (
|
{clients.map((client) => (
|
||||||
<tr key={client.id} {...stylex.props(styles.bodyRow)}>
|
<tr key={client.id} {...stylex.props(styles.bodyRow)}>
|
||||||
<td {...stylex.props(styles.cell, styles.mono)}>{client.ip}</td>
|
<td {...stylex.props(styles.cell, shared.mono)}>{client.ip}</td>
|
||||||
<td {...stylex.props(styles.cell)}>
|
<td {...stylex.props(styles.cell)}>
|
||||||
{client.name === "" ? (
|
{client.name === "" ? (
|
||||||
<span {...stylex.props(styles.dash)}>—</span>
|
<span {...stylex.props(styles.dash)}>—</span>
|
||||||
|
|||||||
@@ -73,9 +73,6 @@ const styles = stylex.create({
|
|||||||
paddingBlock: "0.5rem",
|
paddingBlock: "0.5rem",
|
||||||
paddingRight: "1rem",
|
paddingRight: "1rem",
|
||||||
},
|
},
|
||||||
mono: {
|
|
||||||
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
||||||
},
|
|
||||||
emptyCell: {
|
emptyCell: {
|
||||||
paddingBlock: "1rem",
|
paddingBlock: "1rem",
|
||||||
color: colors.textMuted,
|
color: colors.textMuted,
|
||||||
@@ -284,9 +281,9 @@ export default function RecordsTab() {
|
|||||||
</td>
|
</td>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<td {...stylex.props(styles.cell, styles.mono)}>{record.name}</td>
|
<td {...stylex.props(styles.cell, shared.mono)}>{record.name}</td>
|
||||||
<td {...stylex.props(styles.cell)}>{record.rtype}</td>
|
<td {...stylex.props(styles.cell)}>{record.rtype}</td>
|
||||||
<td {...stylex.props(styles.cell, styles.mono)}>{record.value}</td>
|
<td {...stylex.props(styles.cell, shared.mono)}>{record.value}</td>
|
||||||
<td {...stylex.props(styles.cell)}>{record.ttl}</td>
|
<td {...stylex.props(styles.cell)}>{record.ttl}</td>
|
||||||
<td {...stylex.props(styles.actionCell)}>
|
<td {...stylex.props(styles.actionCell)}>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -69,9 +69,6 @@ const styles = stylex.create({
|
|||||||
paddingBlock: "0.5rem",
|
paddingBlock: "0.5rem",
|
||||||
paddingRight: "1rem",
|
paddingRight: "1rem",
|
||||||
},
|
},
|
||||||
mono: {
|
|
||||||
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
||||||
},
|
|
||||||
emptyCell: {
|
emptyCell: {
|
||||||
paddingBlock: "1rem",
|
paddingBlock: "1rem",
|
||||||
color: colors.textMuted,
|
color: colors.textMuted,
|
||||||
@@ -248,8 +245,8 @@ export default function ZonesTab() {
|
|||||||
</td>
|
</td>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<td {...stylex.props(styles.cell, styles.mono)}>{zone.zone}</td>
|
<td {...stylex.props(styles.cell, shared.mono)}>{zone.zone}</td>
|
||||||
<td {...stylex.props(styles.cell, styles.mono)}>{zone.resolver}</td>
|
<td {...stylex.props(styles.cell, shared.mono)}>{zone.resolver}</td>
|
||||||
<td {...stylex.props(styles.actionCell)}>
|
<td {...stylex.props(styles.actionCell)}>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -1,5 +1,22 @@
|
|||||||
|
import * as stylex from "@stylexjs/stylex";
|
||||||
|
import { styles as shared } from "@/ui/styles";
|
||||||
|
import { colors } from "@/ui/tokens.stylex";
|
||||||
import { useAuthority } from "./authority";
|
import { useAuthority } from "./authority";
|
||||||
|
|
||||||
|
const styles = stylex.create({
|
||||||
|
banner: {
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomStyle: "solid",
|
||||||
|
borderBottomColor: colors.warnBorder,
|
||||||
|
backgroundColor: colors.warnSurface,
|
||||||
|
color: colors.warnText,
|
||||||
|
paddingInline: "1rem",
|
||||||
|
paddingBlock: "0.5rem",
|
||||||
|
fontSize: "0.875rem",
|
||||||
|
lineHeight: "1.25rem",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File authority is a standing condition, not an event, so this banner has no
|
* File authority is a standing condition, not an event, so this banner has no
|
||||||
* dismiss button: it stays up for as long as the process runs from a file.
|
* dismiss button: it stays up for as long as the process runs from a file.
|
||||||
@@ -8,12 +25,9 @@ export default function ReadOnlyConfigBanner() {
|
|||||||
const authority = useAuthority();
|
const authority = useAuthority();
|
||||||
if (authority?.mode !== "managed_file") return null;
|
if (authority?.mode !== "managed_file") return null;
|
||||||
return (
|
return (
|
||||||
<div
|
<div role="status" {...stylex.props(styles.banner)}>
|
||||||
role="status"
|
Configuration is managed by <code {...stylex.props(shared.mono)}>{authority.path}</code>. Edit the file and
|
||||||
className="border-b border-amber-300 bg-amber-50 px-4 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100"
|
restart nxdns to change it; the server rejects edits made here.
|
||||||
>
|
|
||||||
Configuration is managed by <code className="font-mono">{authority.path}</code>. Edit the file and restart
|
|
||||||
nxdns to change it; the server rejects edits made here.
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ export const styles = stylex.create({
|
|||||||
color: colors.dangerText,
|
color: colors.dangerText,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** For a value the operator reads character by character: a domain, an IP, a URL. */
|
||||||
|
mono: {
|
||||||
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
||||||
|
},
|
||||||
/** Visible to a screen reader only; the element keeps its place in the a11y tree. */
|
/** Visible to a screen reader only; the element keeps its place in the a11y tree. */
|
||||||
srOnly: {
|
srOnly: {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
|
|||||||
Reference in New Issue
Block a user