Skip to content

Commit 94552cd

Browse files
Laurie T. Malauroboquat
Laurie T. Malau
authored andcommitted
[pat] Extract into separate components
1 parent 80a1a4f commit 94552cd

File tree

6 files changed

+464
-412
lines changed

6 files changed

+464
-412
lines changed

components/dashboard/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import { BlockedRepositories } from "./admin/BlockedRepositories";
5757
import { AppNotifications } from "./AppNotifications";
5858
import { publicApiTeamsToProtocol, teamsService } from "./service/public-api";
5959
import { FeatureFlagContext } from "./contexts/FeatureFlagContext";
60-
import { PersonalAccessTokenCreateView } from "./settings/PersonalAccessTokens";
60+
import PersonalAccessTokenCreateView from "./settings/PersonalAccessTokensCreateView";
6161

6262
const Setup = React.lazy(() => import(/* webpackPrefetch: true */ "./Setup"));
6363
const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "./workspaces/Workspaces"));
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License-AGPL.txt in the project root for license information.
5+
*/
6+
7+
interface DateSelectorProps {
8+
title: string;
9+
description: string;
10+
options: { value: string; label: string }[];
11+
value?: string;
12+
onChange: (value: string) => void;
13+
}
14+
15+
function DateSelector(props: DateSelectorProps) {
16+
return (
17+
<div>
18+
<label htmlFor={props.title} className="font-semibold">
19+
{props.title}
20+
</label>
21+
<select name={props.title} value={props.value} onChange={(e) => props.onChange(e.target.value)}>
22+
{props.options.map((o) => (
23+
<option key={o.value} value={o.value}>
24+
{o.label}
25+
</option>
26+
))}
27+
</select>
28+
<p className="text-gray-500 dark:text-gray-400 mt-2">{props.description}</p>
29+
</div>
30+
);
31+
}
32+
33+
export default DateSelector;

0 commit comments

Comments
 (0)