Fix column type wrong rendering

This commit is contained in:
Joshen Lim committed 2022-05-24 11:05:46 +08:00
1 parent e2ea3a0554
commit 5b88f35540
1 file changed
+12 -4
@@ -25,17 +25,23 @@ const ColumnType: FC<Props> = ({
showLabel = true,
onOptionSelect = () => {},
}) => {
const isNativeDataType = POSTGRES_DATA_TYPES.includes(value)
// @ts-ignore
const availableTypes = POSTGRES_DATA_TYPES.concat(enumTypes.map((type) => type.name))
const isAvailableType = value ? availableTypes.includes(value) : true
if (!isNativeDataType) {
if (!isAvailableType) {
return (
<Input
readOnly
disabled
label="Type"
label={showLabel ? 'Type' : ''}
layout="horizontal"
value={value}
descriptionText="Custom non-native psql data types cannot currently be changed to a different data type via Supabase Studio"
descriptionText={
showLabel
? 'Custom non-native psql data types cannot currently be changed to a different data type via Supabase Studio'
: ''
}
/>
)
}
@@ -61,6 +67,8 @@ const ColumnType: FC<Props> = ({
}
}
console.log('ColumnType', showLabel)
return (
<Listbox
label={showLabel ? 'Type' : ''}