forked from Vendicated/Vencord
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'showTimeoutDetails' into sqaaakoi-stable-v2
- Loading branch information
Showing
5 changed files
with
74 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/plugins/showTimeoutDetails/components/TimeoutDetailsRow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Vencord, a Discord client mod | ||
* Copyright (c) 2024 Vendicated and contributors | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
|
||
import { findByPropsLazy } from "@webpack"; | ||
import { Tooltip } from "@webpack/common"; | ||
import { JSXElementConstructor, ReactNode } from "react"; | ||
|
||
const rowClasses = findByPropsLazy("row", "rowIcon", "rowGuildName"); | ||
|
||
export default function TimeoutDetailsRow(props: { | ||
description: ReactNode; | ||
icon: JSXElementConstructor<any>; | ||
children: ReactNode; | ||
condition?: boolean | string; | ||
}) { | ||
if (props.condition === undefined ? !props.children : !props.condition) return null; | ||
return <div className={rowClasses.row}> | ||
<Tooltip text={props.description}> | ||
{p => <props.icon {...p} className={rowClasses.rowIcon} height="24" width="24" />} | ||
</Tooltip> | ||
{props.children} | ||
</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters