pull/2353/head
Aniket-Engg 3 years ago
parent fd200fda73
commit bd974c9535
  1. 6
      libs/remix-ui/workspace/src/lib/actions/workspace.ts
  2. 1
      libs/remix-ui/workspace/src/lib/templates/index.ts
  3. 2
      libs/remix-ui/workspace/src/lib/templates/remixDefault.ts

@ -5,7 +5,7 @@ import { addInputFieldSuccess, createWorkspaceError, createWorkspaceRequest, cre
import { checkSlash, checkSpecialChars } from '@remix-ui/helper'
import { JSONStandardInput } from '../types'
import { examples } from '../templates/examples'
import { remixDefault } from '../templates'
import { QueryParams } from '@remix-project/remix-lib'
@ -153,9 +153,9 @@ export const loadWorkspacePreset = async (template: 'gist-template' | 'code-temp
case 'remixDefault':
// creates a new workspace and populates it with default project template.
// insert example contracts
for (const file in examples) {
for (const file in remixDefault) {
try {
await workspaceProvider.set(examples[file].name, examples[file].content)
await workspaceProvider.set(remixDefault[file].name, remixDefault[file].content)
} catch (error) {
console.error(error)
}

@ -0,0 +1 @@
export { default as remixDefault } from './remixDefault'

@ -392,7 +392,7 @@ For now, modules supported by Remix are ethers, web3, swarmgw, chai, remix and h
For unsupported modules, an error like this will be thrown: '<module_name> module require is not supported by Remix IDE will be shown.'
`
export const examples = {
export default {
storage: { name: 'contracts/1_Storage.sol', content: storage },
owner: { name: 'contracts/2_Owner.sol', content: owner },
ballot: { name: 'contracts/3_Ballot.sol', content: ballot },
Loading…
Cancel
Save