diff --git a/src/plugins/seamammals/index.js b/src/plugins/seamammals/index.js new file mode 100644 index 000000000..dd98fdbda --- /dev/null +++ b/src/plugins/seamammals/index.js @@ -0,0 +1,65 @@ +/** + * Copyright 2018-present Facebook. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * @format + * @flow strict-local + */ + +import {Text, Panel, ManagedDataInspector, createTablePlugin} from 'flipper'; + +type Id = number; + +type Row = { + id: Id, + title: string, + url: string, +}; + +function buildRow(row: Row) { + return { + columns: { + title: { + value: {row.title}, + filterValue: row.title, + }, + url: { + value: {row.url}, + filterValue: row.url, + }, + }, + key: row.id, + copyText: JSON.stringify(row), + filterValue: `${row.title} ${row.url}`, + }; +} + +function renderSidebar(row: Row) { + return ( + + + + ); +} + +const columns = { + title: { + value: 'Title', + }, + url: { + value: 'URL', + }, +}; + +const columnSizes = { + title: '15%', + url: 'flex', +}; + +export default createTablePlugin({ + method: 'newRow', + columns, + columnSizes, + renderSidebar, + buildRow, +}); diff --git a/src/plugins/seamammals/package.json b/src/plugins/seamammals/package.json new file mode 100644 index 000000000..d6380299e --- /dev/null +++ b/src/plugins/seamammals/package.json @@ -0,0 +1,11 @@ +{ + "name": "sea-mammals", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "icon": "apps", + "title": "Sea Mammals", + "bugs": { + "email": "realpassy@fb.com" + } + }