Skip to content
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

fix(frontend): made api key input read only to fix warnings #1657

Merged
merged 1 commit into from
Dec 24, 2024
Merged
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
6 changes: 3 additions & 3 deletions frontend/dashboard/app/components/create_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export enum CreateAppStatus {
//
// If only teamId is passed in, it will show
// the UI for new app creation first and show following app setup steps after
// successfull app creation.
// successfull app creation.
//
// If existingAppName and existingApiKey are passed in, it will skip the new app
// creation UI and only show the following app setup steps with the api key and
Expand Down Expand Up @@ -82,7 +82,7 @@ const CreateApp: React.FC<CreateAppProps> = ({ teamId, existingAppName = null, e
<div className="py-4" />
<p className="font-display font-regular text-xl max-w-6xl">API key</p>
<div className="flex flex-row items-center">
<input id="api-key-input" type="text" value={existingApiKey !== null ? existingApiKey : data.api_key.key} className="w-96 border border-black rounded-md outline-none focus-visible:outline-yellow-300 py-2 px-4 font-sans placeholder:text-neutral-400" />
<input id="api-key-input" readOnly={true} type="text" value={existingApiKey !== null ? existingApiKey : data.api_key.key} className="w-96 border border-black rounded-md outline-none focus-visible:outline-yellow-300 py-2 px-4 font-sans placeholder:text-neutral-400" />
<button className="m-4 outline-none flex justify-center hover:bg-yellow-200 active:bg-yellow-300 focus-visible:bg-yellow-200 border border-black rounded-md font-display transition-colors duration-100 py-2 px-4" onClick={() => navigator.clipboard.writeText(existingApiKey !== null ? existingApiKey : data.api_key.key)}>Copy</button>
</div>
</div>
Expand All @@ -91,4 +91,4 @@ const CreateApp: React.FC<CreateAppProps> = ({ teamId, existingAppName = null, e
);
};

export default CreateApp;
export default CreateApp;
Loading