forked from stackblitz-labs/bolt.diy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Starter template menu in homepage (stackblitz-labs#884)
* added icons and component * updated unocss to add dynamic icons * removed temp logs * updated readme
- Loading branch information
1 parent
8185fd5
commit fc4f89f
Showing
21 changed files
with
215 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import type { Template } from '~/types/template'; | ||
import { STARTER_TEMPLATES } from '~/utils/constants'; | ||
|
||
interface FrameworkLinkProps { | ||
template: Template; | ||
} | ||
|
||
const FrameworkLink: React.FC<FrameworkLinkProps> = ({ template }) => ( | ||
<a | ||
href={`/git?url=https://github.com/${template.githubRepo}.git`} | ||
data-state="closed" | ||
data-discover="true" | ||
className="items-center justify-center " | ||
> | ||
<div | ||
className={`inline-block ${template.icon} w-8 h-8 text-4xl transition-theme opacity-25 hover:opacity-75 transition-all`} | ||
/> | ||
</a> | ||
); | ||
|
||
const StarterTemplates: React.FC = () => { | ||
return ( | ||
<div className="flex flex-col items-center gap-4"> | ||
<span className="text-sm text-gray-500">or start a blank app with your favorite stack</span> | ||
<div className="flex justify-center"> | ||
<div className="flex w-70 flex-wrap items-center justify-center gap-4"> | ||
{STARTER_TEMPLATES.map((template) => ( | ||
<FrameworkLink key={template.name} template={template} /> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StarterTemplates; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface Template { | ||
name: string; | ||
label: string; | ||
description: string; | ||
githubRepo: string; | ||
tags?: string[]; | ||
icon?: string; | ||
} |
Oops, something went wrong.