Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
73d0c4ef
Commit
73d0c4ef
authored
Jul 07, 2021
by
joseph izang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename activeTile to moduleHeading. add changes to pluginCard
parent
09c01b04
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
27 deletions
+41
-27
plugin-manager-component.js
.../remix-ide/src/app/components/plugin-manager-component.js
+1
-0
button.tsx
libs/remix-ui/plugin-manager/src/lib/components/button.tsx
+7
-9
moduleHeading.tsx
...ix-ui/plugin-manager/src/lib/components/moduleHeading.tsx
+0
-0
pluginCard.tsx
...remix-ui/plugin-manager/src/lib/components/pluginCard.tsx
+25
-13
rootView.tsx
libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx
+6
-4
remix-ui-plugin-manager.tsx
...mix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx
+1
-0
types.d.ts
libs/remix-ui/plugin-manager/src/types.d.ts
+1
-1
No files found.
apps/remix-ide/src/app/components/plugin-manager-component.js
View file @
73d0c4ef
...
...
@@ -151,6 +151,7 @@ class PluginManagerComponent extends ViewPlugin {
engine
=
{
this
.
engine
}
activesCount
=
{
3
}
inactivesCount
=
{
4
}
isActive
=
{()
=>
false
}
actives
=
{[]}
inactives
=
{[]}
/>
,
...
...
libs/remix-ui/plugin-manager/src/lib/components/button.tsx
View file @
73d0c4ef
import
React
from
'react'
import
React
,
{
useContext
}
from
'react'
import
{
PluginManagerContext
}
from
'../contexts/pluginmanagercontext'
interface
ButtonProps
{
profileName
:
string
deactivatePlugin
?:
(
name
:
string
)
=>
{}
activatePlugin
?:
(
name
:
string
)
=>
{}
isActive
:
boolean
buttonText
?:
string
buttonText
:
'Activate'
|
'Deactivate'
}
function
Button
({
profileName
,
deactivatePlugin
,
buttonText
}:
ButtonProps
)
{
const
dataId
=
`pluginManagerComponentDeactivateButton
${
profileName
}
`
function
Button
({
buttonText
}:
ButtonProps
)
{
const
{
profile
,
deActivatePlugin
,
activatePlugin
}
=
useContext
(
PluginManagerContext
)
const
dataId
=
`pluginManagerComponentDeactivateButton
${
profile
.
name
}
`
return
(
<
button
onClick=
{
()
=>
deactivatePlugin
(
profileN
ame
)
}
onClick=
{
buttonText
===
'Activate'
?
()
=>
activatePlugin
(
profile
.
name
)
:
()
=>
deActivatePlugin
(
profile
.
n
ame
)
}
className=
"btn btn-secondary btn-sm"
data
-
id=
{
dataId
}
>
...
...
libs/remix-ui/plugin-manager/src/lib/components/
activeTile
.tsx
→
libs/remix-ui/plugin-manager/src/lib/components/
moduleHeading
.tsx
View file @
73d0c4ef
File moved
libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx
View file @
73d0c4ef
import
React
,
{
useContext
}
from
'react'
import
React
,
{
useContext
,
useState
}
from
'react'
import
{
PluginManagerContext
}
from
'../contexts/pluginmanagercontext'
import
'../remix-ui-plugin-manager.css'
import
Button
from
'./button'
...
...
@@ -13,25 +13,37 @@ interface PluginCardProps {
// eslint-disable-next-line no-empty-pattern
function
PluginCard
()
{
const
{
profile
}
=
useContext
(
PluginManagerContext
)
const
{
profile
,
isActive
}
=
useContext
(
PluginManagerContext
)
const
[
displayName
]
=
useState
<
string
>
((
profile
.
displayName
)
?
profile
.
displayName
:
profile
.
name
)
const
[
docLink
]
=
useState
<
JSX
.
Element
>
((
profile
.
documentation
)
?
(
<
a
href=
{
profile
.
documentation
}
className=
"px-1"
title=
"link to documentation"
target=
"_blank"
rel=
"noreferrer"
>
<
i
aria
-
hidden=
"true"
className=
"fas fa-book"
/>
</
a
>
)
:
null
)
const
[
versionWarning
]
=
useState
<
JSX
.
Element
>
((
profile
.
version
&&
profile
.
version
.
match
(
/
\b(\w
*alpha
\w
*
)\b
/g
))
?
(
<
small
title=
"Version Alpha"
className=
"remixui_versionWarning plugin-version"
>
alpha
</
small
>
)
:
(
profile
.
version
&&
profile
.
version
.
match
(
/
\b(\w
*beta
\w
*
)\b
/g
))
?
(
<
small
title=
"Version Beta"
className=
"remixui_versionWarning plugin-version"
>
beta
</
small
>
)
:
null
)
return
(
<
article
className=
"list-group-item py-1 mb-1 plugins-list-group-item"
title=
"PLuginCardTitle"
>
<
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"
>
<
h6
className=
"
remixui_
displayName plugin-name"
>
<
div
>
{
profile
.
displayName
}
{
profile
.
docLink
}
{
profile
.
versionWarning
}
{
displayName
}
{
docLink
}
{
versionWarning
}
</
div
>
{
isActive
(
profile
.
name
)
?
(
<
Button
profileName=
"Sample Profil
e"
isActive
/>
buttonText=
"Deactivat
e"
/>)
:
<
Button
buttonText=
"Activate"
/>
}
</
h6
>
</
div
>
<
div
className=
"description d-flex text-body plugin-text mb-2"
>
<
img
src=
""
className=
"mr-1 mt-1
pluginIcon"
alt=
"profile icon"
/>
<
span
className=
"descriptiontext"
>
{
profile
.
description
}
</
span
>
<
div
className=
"
remixui_
description d-flex text-body plugin-text mb-2"
>
<
img
src=
{
profile
.
icon
}
className=
"mr-1 mt-1 remixui_
pluginIcon"
alt=
"profile icon"
/>
<
span
className=
"
remixui_
descriptiontext"
>
{
profile
.
description
}
</
span
>
</
div
>
</
article
>
)
...
...
libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx
View file @
73d0c4ef
import
React
from
'react'
import
ActiveTile
from
'./activeTile'
import
ListGroupItem
from
'./listGroupItem'
import
ModuleHeading
from
'./moduleHeading'
interface
RootViewProps
{
localPluginButtonText
:
string
...
...
@@ -30,11 +30,13 @@ function RootView ({ localPluginButtonText }: RootViewProps) {
<
div
id=
"pluginManager"
data
-
id=
"pluginManagerComponentPluginManager"
>
<
header
className=
"form-group remixui_pluginSearch plugins-header py-3 px-4 border-bottom"
data
-
id=
"pluginManagerComponentPluginManagerHeader"
>
<
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=
"remixui_pluginSearchButton btn bg-transparent text-dark border-0 mt-2 text-underline"
data
-
id=
"pluginManagerComponentPluginSearchButton"
>
Connect to a Local Plugin
</
button
>
</
header
>
<
section
data
-
id=
"pluginManagerComponentPluginManagerSection"
>
<
ActiveTile
headingLabel=
"Active Modules"
/>
<
ActiveTile
headingLabel=
"Inactive Modules"
/>
<
ModuleHeading
headingLabel=
"Active Modules"
/>
<
ModuleHeading
headingLabel=
"Inactive Modules"
/>
<
ListGroupItem
/>
</
section
>
</
div
>
...
...
libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx
View file @
73d0c4ef
...
...
@@ -6,6 +6,7 @@ import './remix-ui-plugin-manager.css'
export
const
RemixUiPluginManager
=
(
props
:
RemixUiPluginManagerProps
)
=>
{
console
.
log
(
'current state of appmanager'
,
props
.
appManager
)
console
.
log
(
'The state of props '
,
props
)
return
(
// <PluginManagerContextProvider props={props}>
// <RootView
...
...
libs/remix-ui/plugin-manager/src/types.d.ts
View file @
73d0c4ef
...
...
@@ -70,7 +70,7 @@ export interface PluginManagerContextProviderProps {
inactives
:
Profile
[]
activatePlugin
:
(
name
:
string
)
=>
void
deActivatePlugin
:
(
name
:
string
)
=>
void
isActive
:
(
name
:
string
)
=>
any
isActive
:
(
name
:
string
)
=>
boolean
openLocalPlugin
:
()
=>
Promise
<
void
>
filterPlugins
:
()
=>
void
profile
:
Profile
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment