Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tramvai template #8073

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/common/src/templates/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
UnibitIcon,
DocusaurusIcon,
SolidIcon,
TramvaiIcon,
} from '@codesandbox/template-icons';

import {
Expand Down Expand Up @@ -62,6 +63,7 @@ import {
TemplateType,
remix,
solid,
tramvai,
} from '.';

export default function getIcon(theme: TemplateType) {
Expand Down Expand Up @@ -126,6 +128,8 @@ export default function getIcon(theme: TemplateType) {
return RemixIcon;
case solid.name:
return SolidIcon;
case tramvai.name:
return TramvaiIcon;

default:
return ReactIcon;
Expand Down
7 changes: 6 additions & 1 deletion packages/common/src/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import docusaurus from './docusaurus';
import esmReact from './esmodule-react';
import remix from './remix';
import solid from './solid';
import tramvai from './tramvai';

export {
adonis,
Expand Down Expand Up @@ -66,6 +67,7 @@ export {
unibit,
remix,
solid,
tramvai,
};

export type TemplateType =
Expand Down Expand Up @@ -101,7 +103,8 @@ export type TemplateType =
| 'babel-repl'
| 'esm-react'
| 'remix-starter'
| 'solid';
| 'solid'
| 'tramvai';

export default function getDefinition(theme?: TemplateType | null) {
switch (theme) {
Expand Down Expand Up @@ -171,6 +174,8 @@ export default function getDefinition(theme?: TemplateType | null) {
return remix;
case solid.name:
return solid;
case tramvai.name:
return tramvai;
default:
return react;
}
Expand Down
17 changes: 17 additions & 0 deletions packages/common/src/templates/tramvai.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Template from './template';
import { decorateSelector } from '../utils/decorate-selector';

export default new Template(
'tramvai',
'Tramvai',
'https://tramvai.dev/',
'github.com/tramvaijs/tramvai-sandbox',
decorateSelector(() => '#ffdd2d'),
{
distDir: 'dist',
showOnHomePage: true,
main: true,
popular: true,
showCube: false,
}
);
17 changes: 17 additions & 0 deletions packages/template-icons/src/TramvaiIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { SVGIcon, ISVGIconProps } from './SVGIcon';

export const TramvaiIcon: React.FC<ISVGIconProps> = ({ ...props }) => (
<SVGIcon {...props}>
<style>{'.st0{fill-rule:evenodd;clip-rule:evenodd}.st1{fill:#fff}'}</style>
<path
d="M80.8 100.6h-61C8.9 100.6 0 91.7 0 80.8v-61C0 8.9 8.9 0 19.8 0h60.9c11 0 19.8 8.9 19.8 19.8v60.9c.1 11-8.8 19.9-19.7 19.9z"
style={{
fillRule: 'evenodd',
clipRule: 'evenodd',
fill: '#ffdd2d',
}}
/>
<path d="M53 58.8c0 2.2 2.3 2.6 4.2 2.6 1.7 0 2.8-.1 3.8-.3v9.1c-2.2.4-5.9.6-8.1.6-6.8 0-11.5-2.3-11.5-10.9V43.8h-4.6v-9.2h4.6v-8.2H53v8.2h8v9.2h-8v15z" />
</SVGIcon>
);