add cookbook link

pull/5370/head
yann300 5 months ago
parent c8d31e37ab
commit 29801267cc
  1. 5
      apps/remix-ide/src/app/plugins/templates-selection/templates-selection-plugin.tsx
  2. 9
      apps/remix-ide/src/app/plugins/templates-selection/templates.ts
  3. 3
      libs/remix-ui/grid-view/src/lib/remix-ui-grid-section.tsx

@ -151,13 +151,14 @@ export class TemplatesSelectionPlugin extends ViewPlugin {
description="Select a template to create a workspace or to add it to current workspace" description="Select a template to create a workspace or to add it to current workspace"
> >
{ {
templates(window._intl).map(template => { templates(window._intl, this).map(template => {
return <RemixUIGridSection return <RemixUIGridSection
plugin={this} plugin={this}
key={template.name} key={template.name}
title={template.name} title={template.name}
tooltipTitle={template.tooltip}
onClickTitle={template.onClick}
hScrollable={false} hScrollable={false}
header={template.source === 'plugin' ? <button className="btn border" onClick={() => { this.call('manager', 'activatePlugin', template.payload.pluginName) }}>Open Cookbook to load more contracts</button> : ''}
> >
{template.items.map(item => { {template.items.map(item => {
return <RemixUIGridCell return <RemixUIGridCell

@ -1,5 +1,4 @@
export const templates = (intl, plugin) => {
export const templates = (intl) => {
return [ return [
{ {
name: "Generic", name: "Generic",
@ -260,9 +259,9 @@ export const templates = (intl) => {
}, },
{ {
name: "Cookbook", name: "Cookbook",
source: "plugin", tooltip: "Cookbook is a smart contract search tool. Click here to open cookbook and browse contracts.",
payload: { onClick: () => {
pluginName: 'cookbookdev' plugin.call('manager', 'activatePlugin', 'cookbookdev')
}, },
items: [ items: [
{ value: "token-sale", displayName: 'Token Sale' }, { value: "token-sale", displayName: 'Token Sale' },

@ -1,4 +1,5 @@
import React, {useState, useEffect, useContext, useRef, ReactNode} from 'react' // eslint-disable-line import React, {useState, useEffect, useContext, useRef, ReactNode} from 'react' // eslint-disable-line
import { CustomTooltip } from "@remix-ui/helper";
import './remix-ui-grid-section.css' import './remix-ui-grid-section.css'
import FiltersContext from "./filtersContext" import FiltersContext from "./filtersContext"
@ -13,6 +14,8 @@ const _paq = window._paq = window._paq || []
interface RemixUIGridSectionProps { interface RemixUIGridSectionProps {
plugin: any plugin: any
title?: string title?: string
onClickTitle?: () => void
tooltipTitle?: string
hScrollable: boolean hScrollable: boolean
classList?: string classList?: string
styleList?: any styleList?: any

Loading…
Cancel
Save