Merge pull request #339 from webzard-io/feat/form-type

show component type in form
This commit is contained in:
yz-yu 2022-03-09 10:57:21 +08:00 committed by GitHub
commit ae5ee1a623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { flatten } from 'lodash-es';
import { observer } from 'mobx-react-lite';
import { FormControl, FormLabel, Input, Textarea, VStack } from '@chakra-ui/react';
import { FormControl, FormLabel, Input, Textarea, Text, VStack } from '@chakra-ui/react';
import { SchemaField } from '@sunmao-ui/editor-sdk';
import { TSchema } from '@sinclair/typebox';
import { parseType } from '@sunmao-ui/core';
@ -124,6 +124,12 @@ export const ComponentForm: React.FC<Props> = observer(props => {
return (
<ErrorBoundary>
<VStack p="2" spacing="2" background="gray.50" onKeyDown={onKeyDown}>
<FormControl>
<FormLabel>
<strong>Component Type</strong>
</FormLabel>
<Text paddingLeft='3'>{selectedComponent.type}</Text>
</FormControl>
<FormControl>
<FormLabel>
<strong>Component ID</strong>