From f6c060f3288f772e94509002d7b329a1b546b974 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 13 Jun 2024 23:57:34 +0200 Subject: [PATCH] add cookbook* --- .../templates-selection-plugin.tsx | 3 +- .../plugins/templates-selection/templates.ts | 18 +++++++ .../src/lib/remix-ui-grid-section.tsx | 1 + .../workspace/src/lib/utils/constants.ts | 54 +++++++++++++++++++ 4 files changed, 75 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/plugins/templates-selection/templates-selection-plugin.tsx b/apps/remix-ide/src/app/plugins/templates-selection/templates-selection-plugin.tsx index 6df97e60b6..d8b70d5557 100644 --- a/apps/remix-ide/src/app/plugins/templates-selection/templates-selection-plugin.tsx +++ b/apps/remix-ide/src/app/plugins/templates-selection/templates-selection-plugin.tsx @@ -157,7 +157,8 @@ export class TemplatesSelectionPlugin extends ViewPlugin { key={template.name} title={template.name} hScrollable={false} - > + header={template.source === 'plugin' ? : ''} + > {template.items.map(item => { return { } ] }, + { + name: "Cookbook", + source: "plugin", + payload: { + pluginName: 'cookbookdev' + }, + items: [ + { value: "token-sale", displayName: 'Token Sale' }, + { value: "simple-nft-sale", displayName: 'Simple Nft Sale' }, + { value: "Azuki-ERC721A-NFT-Sale-basic", displayName: 'Azuki ERC721A NFT Sale basic' }, + { value: "Azuki-ERC721A-ERC721A", displayName: 'Azuki ERC721A' }, + { value: "token-staking-with-infinite-rewards", displayName: 'Token Staking with infinite rewards' }, + { value: "nft-staking-with-infinite-rewards", displayName: 'Nft Staking with infinite rewards' }, + { value: "basic-dao", displayName: 'Basic DAO' }, + { value: "soulbound-nft", displayName: 'Soulbound Nft' }, + { value: "multi-collection-nft-with-burnable-nfts-and-pausable-transfers", displayName: 'Multi collection nft with burnable nfts and pausable transfers' }, + ] + }, { name: "OxProject", items: [ diff --git a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-section.tsx b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-section.tsx index a3cb8b15c0..d6d861f3b9 100644 --- a/libs/remix-ui/grid-view/src/lib/remix-ui-grid-section.tsx +++ b/libs/remix-ui/grid-view/src/lib/remix-ui-grid-section.tsx @@ -63,6 +63,7 @@ export const RemixUIGridSection = (props: RemixUIGridSectionProps) => { >
{ props.title &&
{ props.title }
} +
{ !hasChildCell(children) && No items found } { props.children } diff --git a/libs/remix-ui/workspace/src/lib/utils/constants.ts b/libs/remix-ui/workspace/src/lib/utils/constants.ts index fcde9c1830..f0d150afb1 100644 --- a/libs/remix-ui/workspace/src/lib/utils/constants.ts +++ b/libs/remix-ui/workspace/src/lib/utils/constants.ts @@ -34,6 +34,60 @@ export const TEMPLATE_METADATA: Record = { name: 'cookbookdev', endpoint: 'openPattern', params: ['Uniswap-V4-HookBook-MultiSigSwapHook', true] + }, + 'token-sale': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['token-sale'] + }, + 'simple-nft-sale': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['simple-nft-sale'] + }, + 'Azuki-ERC721A-NFT-Sale-basic': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['Azuki-ERC721A-NFT-Sale-basic'] + }, + 'Azuki-ERC721A-ERC721A': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['Azuki-ERC721A-ERC721A'] + }, + 'token-staking-with-infinite-rewards': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['token-staking-with-infinite-rewards'] + }, + 'nft-staking-with-infinite-rewards': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['nft-staking-with-infinite-rewards'] + }, + 'basic-dao': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['basic-dao'] + }, + 'soulbound-nft': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['soulbound-nft'] + }, + 'multi-collection-nft-with-burnable-nfts-and-pausable-transfers': { + type: 'plugin', + name: 'cookbookdev', + endpoint: 'openContract', + params: ['multi-collection-nft-with-burnable-nfts-and-pausable-transfers'] } }