Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Change Safe App name TextField from readonly to disabled #3366

Merged
merged 2 commits into from
Jan 25, 2022
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
19 changes: 17 additions & 2 deletions src/routes/safe/components/Apps/components/AddAppForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useState, ReactElement, useCallback, useEffect } from 'react'
import { useHistory } from 'react-router-dom'
import styled from 'styled-components'
import { SafeApp } from 'src/routes/safe/components/Apps/types'

import GnoForm from 'src/components/forms/GnoForm'
import Img from 'src/components/layout/Img'
import { Modal } from 'src/components/Modal'
Expand All @@ -19,6 +18,22 @@ const FORM_ID = 'add-apps-form'
const StyledTextFileAppName = styled(TextField)`
&& {
width: 385px;
.MuiFormLabel-root {
&.Mui-disabled {
color: rgba(0, 0, 0, 0.54);
&.Mui-error {
color: ${(props) => props.theme.colors.error};
}
}
}
.MuiInputBase-root {
.MuiFilledInput-input {
color: rgba(0, 0, 0, 0.54);
}
&:before {
border-bottom-style: inset;
}
}
}
`

Expand Down Expand Up @@ -141,7 +156,7 @@ const AddApp = ({ appList, closeModal, onAddApp }: AddAppProps): ReactElement =>
)}
<StyledTextFileAppName
label="App name"
readOnly
disabled
meta={{ error: fetchError }}
value={isLoading ? 'Loading...' : appInfo.name === DEFAULT_APP_INFO.name ? '' : appInfo.name}
onChange={() => {}}
Expand Down