add listgroupitem component

pull/1344/head
joseph izang 3 years ago
parent 3f939f61a3
commit 38320e2bc4
  1. 13
      libs/remix-ui/plugin-manager/src/customTypes.ts
  2. 21
      libs/remix-ui/plugin-manager/src/lib/components/listGroupItem.tsx
  3. 29
      libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx
  4. 20
      libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx
  5. 3
      nx.json

@ -5,3 +5,16 @@ export type PluginManagerSettings = {
settings: () => HTMLElement settings: () => HTMLElement
render: () => HTMLElement render: () => HTMLElement
} }
export type Profile = {
name: 'pluginManager',
displayName: 'Plugin manager',
methods: [],
events: [],
icon: 'assets/img/pluginManager.webp',
description: 'Start/stop services, modules and plugins',
kind: 'settings',
location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/plugin_manager.html',
version: string
}

@ -0,0 +1,21 @@
import React from 'react'
import { Profile } from '../../customTypes'
interface ListGroupItemProps {
activeProfiles: Profile[]
inactiveProfiles: Profile[]
renderItem: (profile: Profile) => void
}
function ListGroupItem ({ activeProfiles, inactiveProfiles, renderItem }: ListGroupItemProps) {
return (
<div className="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile">
{ activeProfiles.length > 0
? activeProfiles.map(profile => renderItem(profile))
: inactiveProfiles.map(profile => renderItem(profile))
}
</div>
)
}
export default ListGroupItem

@ -1,23 +1,38 @@
import React from 'react' import React from 'react'
import { Profile } from '../../customTypes'
import ActiveTile from './activeTile' import ActiveTile from './activeTile'
import ListGroupItem from './listGroupItem'
interface RowViewProps { interface RootViewProps {
localPluginButtonText: string localPluginButtonText: string
activeProfiles: Profile[]
inactiveProfiles?: Profile[]
filterPlugins: () => void
openLocalPlugins: () => void
renderItem: (profile: Profile) => void
} }
function RootView () { function RootView ({
localPluginButtonText,
activeProfiles,
inactiveProfiles,
filterPlugins,
openLocalPlugins,
renderItem
}: RootViewProps) {
return ( return (
<div id="pluginManager" data-id="pluginManagerComponentPluginManager"> <div id="pluginManager" data-id="pluginManagerComponentPluginManager">
<header className="form-group pluginSearch plugins-header py-3 px-4 border-bottom" data-id="pluginManagerComponentPluginManagerHeader"> <header className="form-group pluginSearch plugins-header py-3 px-4 border-bottom" data-id="pluginManagerComponentPluginManagerHeader">
<input type="text" className="form-control" placeholder="Search" data-id="pluginManagerComponentSearchInput" /> <input type="text" className="form-control" placeholder="Search" data-id="pluginManagerComponentSearchInput" />
<button className="btn btn-secondary text-dark border-0" data-id="pluginManagerComponentPluginSearchButton">Connect to a Local Plugin</button> <button className="btn btn-secondary text-dark border-0" data-id="pluginManagerComponentPluginSearchButton">{localPluginButtonText}</button>
</header> </header>
<section data-id="pluginManagerComponentPluginManagerSection"> <section data-id="pluginManagerComponentPluginManagerSection">
<ActiveTile /> <ActiveTile />
<div className="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile"> <ListGroupItem
activeProfiles={activeProfiles}
</div> inactiveProfiles={inactiveProfiles}
renderItem={renderItem}
/>
</section> </section>
</div> </div>
) )

@ -1,19 +1,9 @@
import React from 'react' import React from 'react'
import './remix-ui-plugin-manager.css'
import './remix-ui-plugin-manager.css';
/* eslint-disable-next-line */ /* eslint-disable-next-line */
export interface RemixUiPluginManagerProps { export interface RemixUiPluginManagerProps {
name: 'pluginManager',
displayName: 'Plugin manager',
methods: [],
events: [],
icon: 'assets/img/pluginManager.webp',
description: 'Start/stop services, modules and plugins',
kind: 'settings',
location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/plugin_manager.html',
version: string
} }
export const RemixUiPluginManager = (props: RemixUiPluginManagerProps) => { export const RemixUiPluginManager = (props: RemixUiPluginManagerProps) => {
@ -21,7 +11,7 @@ export const RemixUiPluginManager = (props: RemixUiPluginManagerProps) => {
<div> <div>
<h1>Welcome to remix-ui-plugin-manager!</h1> <h1>Welcome to remix-ui-plugin-manager!</h1>
</div> </div>
); )
}; }
export default RemixUiPluginManager; export default RemixUiPluginManager

@ -108,8 +108,5 @@
"remix-ui-plugin-manager": { "remix-ui-plugin-manager": {
"tags": [] "tags": []
} }
"remix-ui-settings": {
"tags": []
}
} }
} }

Loading…
Cancel
Save