UI Conversion: Use TextArea from antd
Summary: Replaced Text and TextArea components by antd analogues Reviewed By: mweststrate Differential Revision: D28088959 fbshipit-source-id: 87f867f04f34a9b026045b34467a35437d132317
This commit is contained in:
committed by
Facebook GitHub Bot
parent
71d827288f
commit
e1afe9d6b9
@@ -10,20 +10,16 @@
|
|||||||
import {
|
import {
|
||||||
styled,
|
styled,
|
||||||
produce,
|
produce,
|
||||||
Toolbar,
|
|
||||||
ManagedTable,
|
ManagedTable,
|
||||||
Text,
|
|
||||||
Input,
|
|
||||||
colors,
|
colors,
|
||||||
getStringFromErrorLike,
|
getStringFromErrorLike,
|
||||||
Textarea,
|
|
||||||
TableBodyColumn,
|
TableBodyColumn,
|
||||||
TableRows,
|
TableRows,
|
||||||
TableBodyRow,
|
TableBodyRow,
|
||||||
TableRowSortOrder,
|
TableRowSortOrder,
|
||||||
Value,
|
|
||||||
renderValue,
|
renderValue,
|
||||||
TableHighlightedRows,
|
TableHighlightedRows,
|
||||||
|
Value,
|
||||||
} from 'flipper';
|
} from 'flipper';
|
||||||
import React, {KeyboardEvent, ChangeEvent, useState, useCallback} from 'react';
|
import React, {KeyboardEvent, ChangeEvent, useState, useCallback} from 'react';
|
||||||
import {Methods, Events} from './ClientProtocol';
|
import {Methods, Events} from './ClientProtocol';
|
||||||
@@ -44,6 +40,7 @@ import {
|
|||||||
useValue,
|
useValue,
|
||||||
Layout,
|
Layout,
|
||||||
useMemoize,
|
useMemoize,
|
||||||
|
Toolbar,
|
||||||
} from 'flipper-plugin';
|
} from 'flipper-plugin';
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
@@ -53,6 +50,7 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Menu,
|
Menu,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
|
Input,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
ConsoleSqlOutlined,
|
ConsoleSqlOutlined,
|
||||||
@@ -65,8 +63,12 @@ import {
|
|||||||
TableOutlined,
|
TableOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
|
||||||
|
const {TextArea} = Input;
|
||||||
|
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
|
||||||
|
const {Text} = Typography;
|
||||||
|
|
||||||
const PAGE_SIZE = 50;
|
const PAGE_SIZE = 50;
|
||||||
const FAVORITES_LOCAL_STORAGE_KEY = 'plugin-database-favorites-sql-queries';
|
const FAVORITES_LOCAL_STORAGE_KEY = 'plugin-database-favorites-sql-queries';
|
||||||
|
|
||||||
@@ -84,14 +86,6 @@ const ErrorBar = styled.div({
|
|||||||
});
|
});
|
||||||
const QueryHistoryManagedTable = styled(ManagedTable)({paddingLeft: 16});
|
const QueryHistoryManagedTable = styled(ManagedTable)({paddingLeft: 16});
|
||||||
const PageInfoContainer = styled(Layout.Horizontal)({alignItems: 'center'});
|
const PageInfoContainer = styled(Layout.Horizontal)({alignItems: 'center'});
|
||||||
const TableInfoTextArea = styled(Textarea)({
|
|
||||||
width: '98%',
|
|
||||||
height: '100%',
|
|
||||||
marginLeft: '1%',
|
|
||||||
marginTop: '1%',
|
|
||||||
marginBottom: '1%',
|
|
||||||
readOnly: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
type DatabasesPluginState = {
|
type DatabasesPluginState = {
|
||||||
selectedDatabase: number;
|
selectedDatabase: number;
|
||||||
@@ -1211,7 +1205,7 @@ export function Component() {
|
|||||||
</Select>
|
</Select>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
{
|
{
|
||||||
<Textarea
|
<TextArea
|
||||||
style={{
|
style={{
|
||||||
width: '98%',
|
width: '98%',
|
||||||
height: '40%',
|
height: '40%',
|
||||||
@@ -1234,6 +1228,7 @@ export function Component() {
|
|||||||
position="top"
|
position="top"
|
||||||
style={{paddingLeft: 16, paddingTop: 24, paddingBottom: 24}}>
|
style={{paddingLeft: 16, paddingTop: 24, paddingBottom: 24}}>
|
||||||
<Layout.Right>
|
<Layout.Right>
|
||||||
|
<div />
|
||||||
<Layout.Horizontal gap>
|
<Layout.Horizontal gap>
|
||||||
<Button
|
<Button
|
||||||
icon={
|
icon={
|
||||||
@@ -1256,12 +1251,13 @@ export function Component() {
|
|||||||
Choose from previous queries <DownOutlined />
|
Choose from previous queries <DownOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Layout.Horizontal>
|
|
||||||
<Button
|
<Button
|
||||||
|
type="primary"
|
||||||
onClick={onExecuteClicked}
|
onClick={onExecuteClicked}
|
||||||
title={'Execute SQL [Ctrl+Return]'}>
|
title={'Execute SQL [Ctrl+Return]'}>
|
||||||
Execute
|
Execute
|
||||||
</Button>
|
</Button>
|
||||||
|
</Layout.Horizontal>
|
||||||
</Layout.Right>
|
</Layout.Right>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</div>
|
</div>
|
||||||
@@ -1288,8 +1284,16 @@ export function Component() {
|
|||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{state.viewMode === 'tableInfo' ? (
|
{state.viewMode === 'tableInfo' ? (
|
||||||
<TableInfoTextArea
|
<TextArea
|
||||||
value={sqlFormatter.format(state.tableInfo)}
|
value={sqlFormatter.format(state.tableInfo)}
|
||||||
|
style={{
|
||||||
|
width: '98%',
|
||||||
|
height: '98%',
|
||||||
|
marginLeft: 16,
|
||||||
|
marginTop: '1%',
|
||||||
|
marginBottom: '1%',
|
||||||
|
resize: 'vertical',
|
||||||
|
}}
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user