-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enum and env var to conditionally render MUI theme (#564)
Signed-off-by: Jenny <[email protected]>
- Loading branch information
Showing
15 changed files
with
395 additions
and
279 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
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
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
22 changes: 12 additions & 10 deletions
22
...rontend/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.tsx
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 |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import React from 'react'; | ||
import { FormGroup, TextInput } from '@patternfly/react-core'; | ||
import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset'; | ||
import { isMUITheme } from '~/shared/utilities/const'; | ||
|
||
type PrefilledModelRegistryFieldProps = { | ||
mrName?: string; | ||
}; | ||
|
||
const PrefilledModelRegistryField: React.FC<PrefilledModelRegistryFieldProps> = ({ mrName }) => ( | ||
<FormGroup className="form-group-disabled" label="Model registry" isRequired fieldId="mr-name"> | ||
<FormFieldset | ||
component={ | ||
<TextInput isDisabled isRequired type="text" id="mr-name" name="mr-name" value={mrName} /> | ||
} | ||
field="Model Registry" | ||
/> | ||
</FormGroup> | ||
); | ||
const PrefilledModelRegistryField: React.FC<PrefilledModelRegistryFieldProps> = ({ mrName }) => { | ||
const mrNameInput = ( | ||
<TextInput isDisabled isRequired type="text" id="mr-name" name="mr-name" value={mrName} /> | ||
); | ||
|
||
return ( | ||
<FormGroup className="form-group-disabled" label="Model registry" isRequired fieldId="mr-name"> | ||
{isMUITheme() ? <FormFieldset component={mrNameInput} field="Model Registry" /> : mrNameInput} | ||
</FormGroup> | ||
); | ||
}; | ||
|
||
export default PrefilledModelRegistryField; |
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
Oops, something went wrong.