add "browse more template"

pull/5042/head
yann300 4 months ago committed by Aniket
parent e721365efe
commit 64c7abbb9a
  1. 17
      libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx

@ -25,7 +25,7 @@ type WorkspaceTemplate = {
workspaceTitle: string workspaceTitle: string
description: string description: string
projectLogo: string projectLogo: string
templateName: string templateName?: string
} }
const workspaceTemplates: WorkspaceTemplate[] = [ const workspaceTemplates: WorkspaceTemplate[] = [
@ -71,6 +71,12 @@ const workspaceTemplates: WorkspaceTemplate[] = [
projectLogo: 'assets/img/gnosissafeLogo.png', projectLogo: 'assets/img/gnosissafeLogo.png',
templateName: 'gnosisSafeMultisig', templateName: 'gnosisSafeMultisig',
}, },
{
gsID: 'browseTemplate',
workspaceTitle: 'Browse More Templates...',
description: 'Browse templates',
projectLogo: '',
},
] ]
function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) { function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) {
@ -164,8 +170,13 @@ function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) {
<button <button
key={index} key={index}
className={index === 0 ? 'btn btn-primary border p-2 text-nowrap mr-3 mb-2' : index === workspaceTemplates.length - 1 ? 'btn border p-2 text-nowrap mr-2 mb-2' : 'btn border p-2 text-nowrap mr-3 mb-3'} className={index === 0 ? 'btn btn-primary border p-2 text-nowrap mr-3 mb-2' : index === workspaceTemplates.length - 1 ? 'btn border p-2 text-nowrap mr-2 mb-2' : 'btn border p-2 text-nowrap mr-3 mb-3'}
onClick={(e) => { onClick={async (e) => {
createWorkspace(template.templateName) if (template.gsID === 'browseTemplate') {
await plugin.call('manager', 'activatePlugin', 'templateSelection')
plugin.call('tabs' as any, 'focus', 'templateSelection')
} else {
createWorkspace(template.templateName)
}
}} }}
data-id={`homeTabGetStarted${template.templateName}`} data-id={`homeTabGetStarted${template.templateName}`}
> >

Loading…
Cancel
Save