feat: disable updating file size limit if free tier

This commit is contained in:
Beng Eu committed 2022-03-02 14:27:14 +08:00
1 parent bd56d496f7
commit 063fbda2cc
1 file changed
+9 -1
@@ -33,6 +33,7 @@ const StorageSettings: FC<any> = ({ projectRef }) => {
const StorageConfig = ({ config, projectRef }: any) => {
const { ui } = useStore()
const { isFreeTier } = config
const [updates, setUpdates] = useState(config)
const updateConfig = async (updatedConfig: any) => {
@@ -72,7 +73,14 @@ const StorageConfig = ({ config, projectRef }: any) => {
onSubmit={(model: any) => updateConfig(model)}
onReset={() => setUpdates(config)}
>
<AutoField name="fileSizeLimit" showInlineError errorMessage="Must be a number." />
<AutoField
disabled={isFreeTier}
name="fileSizeLimit"
showInlineError
errorMessage={`Must be a number up to ${new Intl.NumberFormat('en-US').format(
STORAGE_FILE_SIZE_LIMIT_MAX
)} bytes.`}
/>
</SchemaFormPanel>
</div>
)