diff --git a/readme.md b/readme.md index cabc761..2a606d6 100644 --- a/readme.md +++ b/readme.md @@ -130,6 +130,7 @@ Can have as many categories as you like. - **iconColor**: optional, hex code or [Tailwind color](https://tailwindcss.com/docs/background-color) (do not prefix with `bg-`). Only used as the fill color for Material Design icons. - **iconBubble**: optional, defaults to `true`, when `false` the bubble and shadow are removed from the icon - **iconAspect**: optional, defaults to `"square"`, can set to `"width"` or `"height"` to constrain the icon to the width or height of the icon, respectively +- **newWindow**: optional, set to `true` or `false` to override the environment variable `NEWWINDOW` ## Template @@ -147,7 +148,8 @@ Can have as many categories as you like. "iconBG": "#fff", "iconColor": "#000", "iconBubble": false, - "iconAspect": "width" + "iconAspect": "width", + "newWindow": false } ] } diff --git a/src/components/anchor.tsx b/src/components/anchor.tsx index 3344dee..2d5304c 100644 --- a/src/components/anchor.tsx +++ b/src/components/anchor.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { is } from "../shared/is"; import { NEWWINDOW } from "../variables"; interface IProps { @@ -6,10 +7,17 @@ interface IProps { title?: string; className?: string; children?: React.ReactNode; + newWindow?: boolean; } -export const Anchor: React.FunctionComponent = ({ uri, children, title, className }) => { - if (NEWWINDOW) { +export const Anchor: React.FunctionComponent = ({ uri, children, title, className, newWindow }) => { + let newWindowLocal = NEWWINDOW; + + if (!is.null(newWindow)) { + newWindowLocal = newWindow as boolean; + } + + if (newWindowLocal) { return ( {children} diff --git a/src/components/icon.tsx b/src/components/icon.tsx index c5a361d..32f7775 100644 --- a/src/components/icon.tsx +++ b/src/components/icon.tsx @@ -33,6 +33,7 @@ interface IProps { iconBubble?: boolean; iconAspect?: IconAspect; uri?: string; + newWindow?: boolean; } export const Icon: React.FunctionComponent = ({ @@ -44,11 +45,12 @@ export const Icon: React.FunctionComponent = ({ iconBubble, iconColor, iconAspect, + newWindow, }) => { if (is.null(icon)) { if (!is.null(uri)) { return ( - + ); @@ -59,7 +61,7 @@ export const Icon: React.FunctionComponent = ({ if (!is.null(uri)) { return ( - + = ({ service, index }) => { - const { name, uri, description, icon, iconBG, iconBubble, iconColor, iconAspect } = service; + const { name, uri, description, icon, iconBG, iconBubble, iconColor, iconAspect, newWindow } = service; return (
  • @@ -39,16 +39,21 @@ const Service: React.FunctionComponent = ({ service, index }) => iconBG={iconBG} iconBubble={iconBubble} iconAspect={iconAspect} + newWindow={newWindow} /> )}

    - {name} + + {name} +

    {!is.null(description) && (

    - {description} + + {description} +

    )}
    diff --git a/src/shared/types.ts b/src/shared/types.ts index 0cbc9ae..e433b0e 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -14,6 +14,8 @@ export interface IService { iconBG?: string; iconBubble?: boolean; iconAspect?: IconAspect; + + newWindow?: boolean; } export type IconAspect = "square" | "width" | "height"; diff --git a/version b/version index 314c3d7..ab67981 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.5 \ No newline at end of file +1.1.6 \ No newline at end of file