import {Component} from "preact"; import {Data, fromStorage, type StorageValues} from "../../storage/exports.js"; import {Setting, type SettingProps} from "./index.js"; type State = { onSiteNewLabelEnabled: | Awaited | undefined; }; export class UserLabelsSetting extends Component { constructor(props: SettingProps) { super(props); this.state = { onSiteNewLabelEnabled: undefined, }; } async componentDidMount() { this.setState({ onSiteNewLabelEnabled: await fromStorage(Data.OnSiteNewLabel), }); } toggleOnSiteNewLabelEnabled = async () => { const onSiteNewLabelEnabled = this.state.onSiteNewLabelEnabled!; onSiteNewLabelEnabled.value = !onSiteNewLabelEnabled.value; await onSiteNewLabelEnabled.save(); this.setState({onSiteNewLabelEnabled}); }; render() { const {onSiteNewLabelEnabled} = this.state; if (onSiteNewLabelEnabled === undefined) { return; } return (

Adds a way to create customizable labels to users. Wherever a link to a person's profile is available, a [+] will be put next to it. Clicking on that will bring up a dialog to add a new label and clicking on existing labels will bring up the same dialog to edit them.
Or you can use the dedicated{" "} User Label Editor to add, edit, or remove user labels.

View Customizable Values
  • Username: who to apply the label to.
  • Priority: determines the order of labels. If multiple labels have the same priority they will be sorted alphabetically. In the topic listing only the highest priority label will be shown.
  • Color: will set the background color of the label. The foreground color is calculated to be black or white depending on the brightness of the background color.
    Valid values are hex colors or transparent.
    Colors based on your current Tildes theme are also available in the dropdown menu.
  • Text: the text to go in the label. If left empty the label will show as a 12 by 12 pixel square instead.
); } }