add "browse more template"

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

@ -25,7 +25,7 @@ type WorkspaceTemplate = {
workspaceTitle: string
description: string
projectLogo: string
templateName: string
templateName?: string
}
const workspaceTemplates: WorkspaceTemplate[] = [
@ -71,6 +71,12 @@ const workspaceTemplates: WorkspaceTemplate[] = [
projectLogo: 'assets/img/gnosissafeLogo.png',
templateName: 'gnosisSafeMultisig',
},
{
gsID: 'browseTemplate',
workspaceTitle: 'Browse More Templates...',
description: 'Browse templates',
projectLogo: '',
},
]
function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) {
@ -164,8 +170,13 @@ function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) {
<button
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'}
onClick={(e) => {
onClick={async (e) => {
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}`}
>

Loading…
Cancel
Save