-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dashboard] Update design for class settings
- Loading branch information
Showing
3 changed files
with
89 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* Copyright (c) 2022 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. | ||
*/ | ||
|
||
export interface WorkspaceClassProps { | ||
selected: boolean; | ||
additionalStyles?: string; | ||
onClick: () => void; | ||
children?: React.ReactNode; | ||
category: string; | ||
friendlyName: string; | ||
description?: string; | ||
powerUps?: number; | ||
} | ||
|
||
function WorkspaceClass(props: WorkspaceClassProps) { | ||
return ( | ||
<div | ||
className={`rounded-xl px-3 py-3 flex flex-col cursor-pointer group transition ease-in-out ${ | ||
props.selected | ||
? "bg-gray-800 dark:bg-gray-100" | ||
: "bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700" | ||
} ${props.additionalStyles || ""}`} | ||
onClick={props.onClick} | ||
> | ||
<div className="flex items-center"> | ||
<p | ||
className={`w-full pl-1 text-sm font-normal truncate ${ | ||
props.selected ? "text-gray-400 dark:text-gray-400" : "text-gray-400 dark:text-gray-500" | ||
}`} | ||
title={props.category} | ||
> | ||
{props.category} | ||
</p> | ||
<input className="opacity-0" type="radio" checked={props.selected} /> | ||
</div> | ||
<div className="pl-1 grid auto-rows-auto"> | ||
<div | ||
className={`text-xl font-semibold mt-1 mb-4 ${ | ||
props.selected ? "text-gray-100 dark:text-gray-600" : "text-gray-700 dark:text-gray-300" | ||
}`} | ||
> | ||
{props.friendlyName} | ||
</div> | ||
<div | ||
className={`text-sm font-normal truncate w-full ${ | ||
props.selected ? "text-gray-300 dark:text-gray-500" : "text-gray-500 dark:text-gray-400" | ||
}`} | ||
> | ||
{props.description} | ||
</div> | ||
<div className="text-xl font-semibold mt-1 mb-4"> | ||
<svg viewBox="0 -4 50 50" xmlns="http://www.w3.org/2000/svg"> | ||
{Array.from(Array(props.powerUps).keys()).map((i) => { | ||
return <ellipse cx={0.8 + i * 2.5} cy="-3" rx="0.8" ry="0.8" style={{ fill: "#FFB45B" }} />; | ||
})} | ||
</svg> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default WorkspaceClass; |
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