Skip to content

[pat] Extract into separate files #15158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { BlockedRepositories } from "./admin/BlockedRepositories";
import { AppNotifications } from "./AppNotifications";
import { publicApiTeamsToProtocol, teamsService } from "./service/public-api";
import { FeatureFlagContext } from "./contexts/FeatureFlagContext";
import { PersonalAccessTokenCreateView } from "./settings/PersonalAccessTokens";
import PersonalAccessTokenCreateView from "./settings/PersonalAccessTokensCreateView";

const Setup = React.lazy(() => import(/* webpackPrefetch: true */ "./Setup"));
const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "./workspaces/Workspaces"));
Expand Down
33 changes: 33 additions & 0 deletions components/dashboard/src/components/DateSelector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* 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.
*/

interface DateSelectorProps {
title: string;
description: string;
options: { value: string; label: string }[];
value?: string;
onChange: (value: string) => void;
}

function DateSelector(props: DateSelectorProps) {
return (
<div>
<label htmlFor={props.title} className="font-semibold">
{props.title}
</label>
<select name={props.title} value={props.value} onChange={(e) => props.onChange(e.target.value)}>
{props.options.map((o) => (
<option key={o.value} value={o.value}>
{o.label}
</option>
))}
</select>
<p className="text-gray-500 dark:text-gray-400 mt-2">{props.description}</p>
</div>
);
}

export default DateSelector;
Loading