Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed May 2, 2024
1 parent 8d683f3 commit 096b485
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 263 deletions.
4 changes: 2 additions & 2 deletions apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins
import {OpenAIGpt} from './app/plugins/openaigpt'
import {SolCoder} from './app/plugins/solcoderAI'

import {TemplatesSelection} from './app/plugins/templates-selection'
import { TemplatesSelectionPlugin } from './app/plugins/templates-selection/templates-selection-plugin'

const isElectron = require('is-electron')

Expand Down Expand Up @@ -303,7 +303,7 @@ class AppComponent {

const permissionHandler = new PermissionHandlerPlugin()

const templateSelection = new TemplatesSelection()
const templateSelection = new TemplatesSelectionPlugin()


this.engine.register([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RemixUIGridSection } from '@remix-ui/remix-ui-grid-section'
import { RemixUIGridCell } from '@remix-ui/remix-ui-grid-cell'
import isElectron from 'is-electron'
import type { TemplateGroup } from '@remix-ui/workspace'
import { templates } from './templates'

//@ts-ignore
const _paq = (window._paq = window._paq || [])
Expand All @@ -22,7 +23,7 @@ const profile = {
events: []
}

export class TemplatesSelection extends ViewPlugin {
export class TemplatesSelectionPlugin extends ViewPlugin {
templates: Array<TemplateGroup>
dispatch: React.Dispatch<any> = () => { }
constructor() {
Expand Down Expand Up @@ -77,263 +78,6 @@ export class TemplatesSelection extends ViewPlugin {
upgradeable: transparentRadioRef.current.checked ? transparentRadioRef.current.value : uupsRadioRef.current.checked ? uupsRadioRef.current.value : false
}
*/
this.templates = [
{
name: "Generic",
items: [
{ value: "remixDefault", displayName: window._intl.formatMessage({ id: 'filePanel.basic' }) },
{ value: "blank", displayName: window._intl.formatMessage({ id: 'filePanel.blank' }) }
]
},
{
name: "OpenZeppelin",
items: [
{
value: "ozerc20",
displayName: "ERC20"
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)"
},
{
value: "ozerc1155",
displayName: "ERC1155"
},
{
value: "ozerc20",
displayName: "ERC20",
opts: {
mintable: true
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
mintable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
mintable: true
}
},
{
value: "ozerc20",
displayName: "ERC20",
opts: {
mintable: true,
burnable: true
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
mintable: true,
burnable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
mintable: true,
burnable: true
}
},
{
value: "ozerc20",
displayName: "ERC20",
opts: {
mintable: true,
pausable: true
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
mintable: true,
pausable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
mintable: true,
pausable: true
}
}
]
},
{
name: "OpenZeppelin Proxy",
items: [
{
value: "ozerc20",
displayName: "ERC20",
opts: {
upgradeable: 'uups'
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
upgradeable: 'uups'
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
upgradeable: 'uups'
}
},
{
value: "ozerc20",
displayName: "ERC20",
opts: {
upgradeable: 'uups',
mintable: true
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
upgradeable: 'uups',
mintable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
upgradeable: 'uups',
mintable: true
}
},
{
value: "ozerc20",
displayName: "ERC20",
opts: {
upgradeable: 'uups',
mintable: true,
burnable: true
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
upgradeable: 'uups',
mintable: true,
burnable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
upgradeable: 'uups',
mintable: true,
burnable: true
}
},
{
value: "ozerc20",
displayName: "ERC20",
opts: {
upgradeable: 'uups',
mintable: true,
pausable: true
}
},
{
value: "ozerc721",
displayName: "ERC721 (NFT)",
opts: {
upgradeable: 'uups',
mintable: true,
pausable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
upgradeable: 'uups',
mintable: true,
pausable: true
}
},
{
value: "ozerc1155",
displayName: "ERC1155",
opts: {
upgradeable: 'uups',
mintable: true,
burnable: true,
pausable: true
}
}
]
},
{
name: "OxProject",
items: [
{ value: "zeroxErc20", displayName: "ERC20" }
]
},
{
name: "Gnosis Safe",
items: [
{ value: "gnosisSafeMultisig", displayName: window._intl.formatMessage({ id: 'filePanel.multiSigWallet' }) }
]
},
{
name: "Circom ZKP",
items: [
{ value: "semaphore", displayName: window._intl.formatMessage({ id: 'filePanel.semaphore' }) },
{ value: "hashchecker", displayName: window._intl.formatMessage({ id: 'filePanel.hashchecker' }) },
{ value: "rln", displayName: window._intl.formatMessage({ id: 'filePanel.rln' }) }
]
},
{
name: "Generic ZKP",
items: [
{ value: "sindriScripts", displayName: window._intl.formatMessage({ id: 'filePanel.addscriptsindri' }) },
]
},
{
name: "Uniswap V4",
items: [
{ value: "uniswapV4Template", displayName: window._intl.formatMessage({ id: 'filePanel.uniswapV4Template' }) },
{ value: "breakthroughLabsUniswapv4Hooks", displayName: window._intl.formatMessage({ id: 'filePanel.breakthroughLabsUniswapv4Hooks' }) },
{ value: "uniswapV4HookBookMultiSigSwapHook", displayName: window._intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' }) }
]
},
{
name: "Solidity CREATE2",
items: [
{ value: "contractCreate2Factory", displayName: window._intl.formatMessage({ id: 'filePanel.addcreate2solidityfactory' }) },
{ value: "contractDeployerScripts", displayName: window._intl.formatMessage({ id: 'filePanel.addscriptdeployer' }) }
]
},
{
name: "Contract Verification",
items: [
{ value: "etherscanScripts", displayName: window._intl.formatMessage({ id: 'filePanel.addscriptetherscan' }) },
]
}
]

const createWorkspace = async (item) => {
const defaultName = await this.call('filePanel', 'getAvailableWorkspaceName', item.displayName)

Expand Down Expand Up @@ -366,7 +110,7 @@ export class TemplatesSelection extends ViewPlugin {
}, initGit)
}

const addToExistingWorkspace = async (item) => {
const addToCurrentWorkspace = async (item) => {
this.emit('addTemplateToWorkspaceReducerEvent', item.value, item.opts, false, (e, data) => {
if (e) {
const modal: AppModal = {
Expand Down Expand Up @@ -397,7 +141,7 @@ export class TemplatesSelection extends ViewPlugin {
>
{

this.templates.map(template => {
templates(window._intl).map(template => {
return <RemixUIGridSection
plugin={this}
title={template.name}
Expand All @@ -411,7 +155,7 @@ export class TemplatesSelection extends ViewPlugin {
<div>
{item.displayName}
{JSON.stringify(item.opts)}
<div><button data-id={`create-${item.value}${item.opts ? JSON.stringify(item.opts) : ''}`} onClick={async () => createWorkspace(item)} className="btn btn-secondary" >Create a new workspace</button><button data-id={`add-${item.value}`} onClick={async () => addToExistingWorkspace(item)} className="btn btn-primary" >Add to existing workspace</button></div>
<div><button data-id={`create-${item.value}${item.opts ? JSON.stringify(item.opts) : ''}`} onClick={async () => createWorkspace(item)} className="btn btn-secondary" >Create a new workspace</button><button data-id={`add-${item.value}`} onClick={async () => addToCurrentWorkspace(item)} className="btn btn-primary" >Add to current workspace</button></div>
</div>
</RemixUIGridCell>
})}
Expand Down
Loading

0 comments on commit 096b485

Please sign in to comment.