-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94d61c7
commit 240dcbf
Showing
6 changed files
with
178 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2021 Gitpod GmbH. All rights reserved. | ||
* Licensed under the GNU Affero General Public License (AGPL). | ||
* See License-AGPL.txt in the project root for license information. | ||
*/ | ||
|
||
import ContextMenu, { ContextMenuEntry } from "./ContextMenu" | ||
|
||
export function ItemsList(props: { | ||
children?: React.ReactNode; | ||
className?: string; | ||
}) { | ||
return <div className={`flex flex-col space-y-2 ${props.className || ""}`}> | ||
{props.children} | ||
</div>; | ||
} | ||
|
||
export function Item(props: { | ||
children?: React.ReactNode; | ||
className?: string; | ||
header?: boolean; | ||
}) { | ||
const headerClassName = "text-sm text-gray-400 border-t border-b border-gray-200 dark:border-gray-800"; | ||
const notHeaderClassName = "rounded-xl hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gitpod-kumquat-light"; | ||
return <div className={`flex flex-grow flex-row w-full px-3 py-3 justify-between transition ease-in-out group ${props.header ? headerClassName : notHeaderClassName} ${props.className || ""}`}> | ||
{props.children} | ||
</div>; | ||
} | ||
|
||
export function ItemField(props: { | ||
children?: React.ReactNode; | ||
className?: string; | ||
}) { | ||
return <div className={`flex-grow my-auto mx-1 ${props.className || ""}`}> | ||
{props.children} | ||
</div>; | ||
} | ||
|
||
export function ItemFieldIcon(props: { | ||
children?: React.ReactNode; | ||
className?: string; | ||
}) { | ||
return <div className={`flex self-center w-8 ${props.className || ""}`}> | ||
{props.children} | ||
</div>; | ||
} | ||
|
||
export function ItemFieldContextMenu(props: { | ||
menuEntries?: ContextMenuEntry[]; | ||
className?: string; | ||
}) { | ||
return <div className={`flex self-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md cursor-pointer w-8 ${props.className || ""}`}> | ||
{!props.menuEntries ? null : <ContextMenu menuEntries={props.menuEntries} />} | ||
</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
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
Oops, something went wrong.