diff --git a/external/lang b/external/lang index 9406c734..03b206f6 160000 --- a/external/lang +++ b/external/lang @@ -1 +1 @@ -Subproject commit 9406c734ca2cb7b65eefcf926d9e829f9a2056d7 +Subproject commit 03b206f608b071eb26a099657d9619d32f2bb264 diff --git a/src/components/common/Tooltip.tsx b/src/components/common/Tooltip.tsx index 9bf320e5..86be55cc 100644 --- a/src/components/common/Tooltip.tsx +++ b/src/components/common/Tooltip.tsx @@ -1,3 +1,5 @@ +import { Text } from "preact-i18n"; +import styled from "styled-components"; import { Children } from "../../types/Preact"; import Tippy, { TippyProps } from '@tippyjs/react'; @@ -17,3 +19,24 @@ export default function Tooltip(props: Props) { ); } + +const PermissionTooltipBase = styled.div` + display: flex; + align-items: center; + flex-direction: column; + + code { + font-family: 'Fira Mono'; + } +`; + +export function PermissionTooltip(props: Omit & { permission: string }) { + const { permission, ...tooltipProps } = props; + + return ( + + + { permission } + } {...tooltipProps} /> + ) +} diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 404e48e1..a8bd6302 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -1,6 +1,6 @@ import { ulid } from "ulid"; import { Text } from "preact-i18n"; -import Tooltip from "../Tooltip"; +import Tooltip, { PermissionTooltip } from "../Tooltip"; import { Channel } from "revolt.js"; import styled from "styled-components"; import { defer } from "../../../lib/defer"; @@ -90,9 +90,9 @@ function MessageBox({ channel, draft, dispatcher }: Props) { return ( - Permissions Required
Send messages
} placement="top"> + -
+