Skip to content

Commit

Permalink
ability to hide icon in starter theme
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed May 13, 2021
1 parent 3f78b54 commit 670db1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/Field.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import tw from "twin.macro";

export const Field = tw.div`
flex items-center space-x-4
flex items-center
`;

export const Label = tw.label`
w-24
w-24 mr-4
`;
15 changes: 12 additions & 3 deletions src/layouts/starterLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const Component: LayoutComponent = ({ config }) => {
const iconURL = `https://devicons.railway.app/${name}?variant=${
theme === "light" ? "dark" : "light"
}`;
const hideIcon = gString(config, "Icon") === "Hide";

console.log({ iconURL });

Expand All @@ -72,9 +73,11 @@ const Component: LayoutComponent = ({ config }) => {
<RLogo config={config} />

<div className="content">
<div className="dicon-wrapper">
<img className="dicon" src={iconURL} />
</div>
{!hideIcon && (
<div className="dicon-wrapper">
<img className="dicon" src={iconURL} />
</div>
)}

<h1>
Deploy <span className="em">{name}</span> on Railway
Expand Down Expand Up @@ -102,6 +105,12 @@ export const starterLayout: ILayout = {
placeholder: "Starter title",
},
{ name: "URL", type: "text", placeholder: "GitHub repo URL" },
{
name: "Icon",
type: "select",
options: ["Show", "Hide"],
default: "Show",
},
],
getCSS,
Component,
Expand Down

0 comments on commit 670db1c

Please sign in to comment.