create more components

pull/1344/head
joseph izang 3 years ago
parent 856838ba55
commit 039b07293d
  1. 30
      apps/remix-ide/src/app/components/plugin-manager-component.js
  2. 7
      libs/remix-ui/plugin-manager/src/customTypes.ts
  3. 24
      libs/remix-ui/plugin-manager/src/lib/components/activeTile.tsx
  4. 5
      libs/remix-ui/plugin-manager/src/lib/components/button.tsx
  5. 45
      libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx
  6. 11
      libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx
  7. 3
      libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx
  8. 19
      libs/remix-ui/plugin-manager/src/types.d.ts

@ -146,22 +146,22 @@ class PluginManagerComponent extends ViewPlugin {
</button>`
return yo`
<article id="remixPluginManagerListItem_${profile.name}" class="list-group-item py-1 mb-1 plugins-list-group-item" title="${displayName}" >
<div class="${css.row} justify-content-between align-items-center mb-2">
<h6 class="${css.displayName} plugin-name">
<div>
${displayName}
${doclink}
${versionWarning}
</div>
${activationButton}
</h6>
<article id="remixPluginManagerListItem_${profile.name}" class="list-group-item py-1 mb-1 plugins-list-group-item" title="${displayName}" >
<div class="${css.row} justify-content-between align-items-center mb-2">
<h6 class="${css.displayName} plugin-name">
<div>
${displayName}
${doclink}
${versionWarning}
</div>
<div class="${css.description} d-flex text-body plugin-text mb-2">
<img src="${profile.icon}" class="mr-1 mt-1 ${css.pluginIcon}" />
<span class="${css.descriptiontext}">${profile.description}</span>
</div>
</article>
${activationButton}
</h6>
</div>
<div class="${css.description} d-flex text-body plugin-text mb-2">
<img src="${profile.icon}" class="mr-1 mt-1 ${css.pluginIcon}" />
<span class="${css.descriptiontext}">${profile.description}</span>
</div>
</article>
`
}

@ -0,0 +1,7 @@
export type PluginManagerSettings = {
openDialog: () => void
onValidation: () => void
clearPermission: (from: any, to: any, method: any) => void
settings: () => HTMLElement
render: () => HTMLElement
}

@ -0,0 +1,24 @@
import React from 'react'
type tileLabel = {
label: 'Active Module' | 'Inactive Modules'
}
interface ActiveTileProps {
inactivesCount?: number
activesCount?: number
tileLabel?: tileLabel
}
function ActiveTile ({ inactivesCount, activesCount, tileLabel }: ActiveTileProps) {
return (
<nav className="plugins-list-header justify-content-between navbar navbar-expand-lg bg-light navbar-light align-items-center">
<span className="navbar-brand plugins-list-title h6 mb-0 mr-2">{tileLabel.label}</span>
<span className="badge badge-primary" style={{ cursor: 'default' }} data-id="pluginManagerComponentInactiveTilesCount">
{tileLabel.label === 'Active Module' ? activesCount : inactivesCount}
</span>
</nav>
)
}
export default ActiveTile

@ -1,14 +1,14 @@
import React, { useState } from 'react'
import React from 'react'
interface ButtonProps {
profileName: string
deactivatePlugin?: (name: string) => {}
activatePlugin?: (name: string) => {}
isActive: boolean
buttonText?: string
}
function Button ({ profileName, deactivatePlugin, buttonText }: ButtonProps) {
const [isActive, toggleIsActive] = useState(false)
const dataId = `pluginManagerComponentDeactivateButton${profileName}`
return (
@ -21,3 +21,4 @@ function Button ({ profileName, deactivatePlugin, buttonText }: ButtonProps) {
</button>
)
}
export default Button

@ -0,0 +1,45 @@
import React from 'react'
import '../remix-ui-plugin-manager.css'
import ''
import Button from './button'
interface PluginCardProps {
profileName: string
displayName: string
docLink: string
versionWarning: string
profileIcon: string
profileDescription: string
}
function PluginCard ({
profileName,
displayName,
docLink,
versionWarning,
profileIcon,
profileDescription
}: PluginCardProps) {
return (
<article className="list-group-item py-1 mb-1 plugins-list-group-item" title={displayName}>
<div className="row justify-content-between align-items-center mb-2">
<h6 className="displayName plugin-name">
<div>
{displayName}
{docLink}
{versionWarning}
</div>
<Button
profileName={profileName}
isActive
/>
</h6>
</div>
<div className="description d-flex text-body plugin-text mb-2">
<img src={profileIcon} className="mr-1 mt-1 pluginIcon" alt="profile icon"/>
<span className="descriptiontext">{profileDescription}</span>
</div>
</article>
)
}
export default PluginCard

@ -0,0 +1,11 @@
import React from 'react'
function RootView () {
return (
<div>
<header></header>
</div>
)
}
export default RootView

@ -1,5 +1,4 @@
import React from 'react'
import * as packageJson from '../../../../../package.json'
import './remix-ui-plugin-manager.css';
@ -14,7 +13,7 @@ export interface RemixUiPluginManagerProps {
kind: 'settings',
location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/plugin_manager.html',
version: packageJson.version
version: string
}
export const RemixUiPluginManager = (props: RemixUiPluginManagerProps) => {

@ -0,0 +1,19 @@
/* eslint-disable camelcase */
declare module 'yo-yo'{
interface yo_yo {
(strings:string[], ...values:any[]):HTMLElement;
update(element:HTMLElement, element2:HTMLElement);
}
var yo:yo_yo
export = yo;
}
declare module 'dom-css'{
interface dom_css{
(element:HTMLElement, css:any):void;
}
var css:dom_css
export = css;
}
Loading…
Cancel
Save