mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* Migrate shared preferences * Remove unused import * Migrate org name form * Update TeamSettings * Convert user settings * Fix inital default values * Update snapshots * Fix CI errors * Fix failing Ci * Update snapshots * Large spacing * Move use Form for OrgSettings and add FieldSet * Remove snapshots * Add snapshots * Remove unused prop
30 lines
762 B
TypeScript
30 lines
762 B
TypeScript
import React, { FC } from 'react';
|
|
import { Input, Field, FieldSet, Button, Form } from '@grafana/ui';
|
|
|
|
export interface Props {
|
|
orgName: string;
|
|
onSubmit: (orgName: string) => void;
|
|
}
|
|
|
|
interface FormDTO {
|
|
orgName: string;
|
|
}
|
|
|
|
const OrgProfile: FC<Props> = ({ onSubmit, orgName }) => {
|
|
return (
|
|
<Form defaultValues={{ orgName }} onSubmit={({ orgName }: FormDTO) => onSubmit(orgName)}>
|
|
{({ register }) => (
|
|
<FieldSet label="Organization profile">
|
|
<Field label="Organization name">
|
|
<Input name="orgName" type="text" ref={register({ required: true })} />
|
|
</Field>
|
|
|
|
<Button type="submit">Update organization name</Button>
|
|
</FieldSet>
|
|
)}
|
|
</Form>
|
|
);
|
|
};
|
|
|
|
export default OrgProfile;
|