add cookbook link

pull/5147/head
yann300 5 months ago
parent a9195e29c3
commit 8757ff9f3a
  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"
>
{
templates(window._intl).map(template => {
templates(window._intl, this).map(template => {
return <RemixUIGridSection
plugin={this}
key={template.name}
title={template.name}
tooltipTitle={template.tooltip}
onClickTitle={template.onClick}
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 => {
return <RemixUIGridCell

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

@ -1,4 +1,5 @@
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 FiltersContext from "./filtersContext"
@ -13,6 +14,8 @@ const _paq = window._paq = window._paq || []
interface RemixUIGridSectionProps {
plugin: any
title?: string
onClickTitle?: () => void
tooltipTitle?: string
hScrollable: boolean
classList?: string
styleList?: any

Loading…
Cancel
Save