Skip to content
Snippets Groups Projects
  • insert's avatar
    Fix: Icons collapsing in flex. · 363789c8
    insert authored
    Feature: Remember what channel was opened last.
    Channels: ESC to focus message box / cancel editing.
    363789c8
Forked from Revolt / Revite
339 commits behind the upstream repository.
ConditionalLink.tsx 366 B
import { Link, LinkProps } from "react-router-dom";

type Props = LinkProps & JSX.HTMLAttributes<HTMLAnchorElement> & {
    active: boolean
};

export default function ConditionalLink(props: Props) {
    const { active, ...linkProps } = props;

    if (active) {
        return <a>{ props.children }</a>;
    } else {
        return <Link {...linkProps} />;
    }
}