Skip to content

Commit a247f18

Browse files
committed
add label
1 parent 6f4e9e8 commit a247f18

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

apps/remix-ide/src/app/plugins/templates-selection/templates-selection-plugin.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ export class TemplatesSelectionPlugin extends ViewPlugin {
157157
key={template.name}
158158
title={template.name}
159159
tooltipTitle={template.tooltip}
160-
onClickTitle={template.onClick}
160+
onClick={template.onClick}
161+
onClickLabel={template.onClickLabel}
161162
hScrollable={false}
162163
>
163164
{template.items.map(item => {

apps/remix-ide/src/app/plugins/templates-selection/templates.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,11 @@ export const templates = (intl, plugin) => {
260260
{
261261
name: "Cookbook",
262262
tooltip: "Cookbook is a smart contract search tool. Click here to open cookbook and browse contracts.",
263-
onClick: () => {
264-
plugin.call('manager', 'activatePlugin', 'cookbookdev')
263+
onClick: async () => {
264+
await plugin.call('manager', 'activatePlugin', 'cookbookdev')
265+
plugin.call('menuicons', 'showContent', 'cookbookdev')
265266
},
267+
onClickLabel: 'Open cookbook plugin',
266268
items: [
267269
{ value: "token-sale", displayName: 'Token Sale' },
268270
{ value: "simple-nft-sale", displayName: 'Simple Nft Sale' },

libs/remix-ui/grid-view/src/lib/remix-ui-grid-section.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const _paq = window._paq = window._paq || []
1414
interface RemixUIGridSectionProps {
1515
plugin: any
1616
title?: string
17-
onClickTitle?: () => void
17+
onClick?: () => void
18+
onClickLabel?: string
1819
tooltipTitle?: string
1920
hScrollable: boolean
2021
classList?: string
@@ -64,9 +65,9 @@ export const RemixUIGridSection = (props: RemixUIGridSectionProps) => {
6465
data-id={"remixUIGS" + props.title}
6566
style={{ overflowX: 'auto' }}
6667
>
67-
<div className="d-flex flex-column w-100 remixui_grid_section">
68+
<div className="w-100 remixui_grid_section">
6869
{ props.title && <h6 className='mt-1 mb-0 align-items-left '>{ props.title }</h6> }
69-
70+
{ props.onClick && <span style={{ cursor: 'pointer' }} className='mt-2 btn btn-sm border align-items-left' onClick={() => props.onClick() }>{ props.onClickLabel }</span> }
7071
<div className={(props.hScrollable) ? `d-flex flex-row pb-2 overflow-auto` : `d-flex flex-wrap`}>
7172
{ !hasChildCell(children) && <span> No items found </span>}
7273
{ props.children }

0 commit comments

Comments
 (0)