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

feature/OP-58/Link-NLDS #335

Merged
merged 4 commits into from
Sep 27, 2023
Merged
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
5 changes: 2 additions & 3 deletions pwa/src/components/applicationCard/ApplicationCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

.titleLink {
font-size: var(--web-app-font-size-lg);
--denhaag-link-icon-gap: var(--web-app-size-xs);
}

.titleLink > :first-child > span > svg {
.titleLink > span > svg {
width: var(--web-app-font-size-lg);
height: var(--web-app-font-size-lg);
}

.titleLink > :first-child {
.titleLink > span {
display: flex;
}

Expand Down
29 changes: 17 additions & 12 deletions pwa/src/components/applicationCard/ApplicationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";
import * as styles from "./ApplicationCard.module.css";
import { DataBadge, Icon, Paragraph } from "@utrecht/component-library-react/dist/css-module";
import { DataBadge, Icon, Link, Paragraph } from "@utrecht/component-library-react/dist/css-module";
import { useTranslation } from "react-i18next";
import { Link } from "../../components";
import { IconArrowRight } from "@tabler/icons-react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faHouse, faLaptopCode } from "@fortawesome/free-solid-svg-icons";
import { TOOLTIP_ID } from "../../layout/Layout";
import { CardHeader, CardHeaderTitle, CardWrapper } from "@conduction/components";
import { navigate } from "gatsby-link";

export interface ApplicationCardProps {
title: {
Expand All @@ -25,17 +25,15 @@ export const ApplicationCard: React.FC<ApplicationCardProps> = ({ title, descrip
const { t } = useTranslation();

return (
<CardWrapper className={styles.container}>
<CardWrapper className={styles.container} onClick={() => navigate(title.href)}>
<CardHeader className={styles.cardHeader}>
<CardHeaderTitle>
<div className={styles.titleLink}>
<Link to={title.href}>
<Icon className="utrecht-icon--conduction-start">
<IconArrowRight />
</Icon>
{title.label}
</Link>
</div>
<Link className={styles.titleLink} onClick={() => navigate(title.href)}>
<Icon>
<IconArrowRight />
</Icon>
{title.label}
</Link>
</CardHeaderTitle>
</CardHeader>
<Paragraph className={styles.description}>{description}</Paragraph>
Expand All @@ -48,7 +46,14 @@ export const ApplicationCard: React.FC<ApplicationCardProps> = ({ title, descrip
</DataBadge>
)}
{tags.githubLink && (
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="Demo" onClick={() => open(tags.githubLink)}>
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="Demo"
onClick={(e) => {
e.stopPropagation();
open(tags.githubLink);
}}
>
<FontAwesomeIcon icon={faLaptopCode} />
{t("Demo")}
</DataBadge>
Expand Down
4 changes: 0 additions & 4 deletions pwa/src/components/categoryCard/CategoryCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
height: var(--web-app-font-size-lg);
}

.icon {
margin-inline-end: var(--web-app-size-xs);
}

.titleLink > span {
display: flex;
}
Expand Down
10 changes: 5 additions & 5 deletions pwa/src/components/categoryCard/CategoryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";
import * as styles from "./CategoryCard.module.css";
import { Icon, Paragraph } from "@utrecht/component-library-react/dist/css-module";
import { Link } from "../link/Link";
import { Icon, Link, Paragraph } from "@utrecht/component-library-react/dist/css-module";
import { CardHeader, CardHeaderTitle, CardWrapper } from "@conduction/components";
import { navigate } from "gatsby-link";

export interface CategoryCardProps {
title: {
Expand All @@ -16,11 +16,11 @@ export interface CategoryCardProps {

export const CategoryCard: React.FC<CategoryCardProps> = ({ title, description, icon, domain }) => {
return (
<CardWrapper className={styles.container}>
<CardWrapper className={styles.container} onClick={() => navigate(title.href)}>
<CardHeader>
<CardHeaderTitle>
<Link className={styles.titleLink} to={title.href}>
<Icon className={styles.icon}>{icon}</Icon>
<Link className={styles.titleLink} onClick={() => navigate(title.href)}>
<Icon>{icon}</Icon>
{title.label}
</Link>
</CardHeaderTitle>
Expand Down
5 changes: 2 additions & 3 deletions pwa/src/components/componentCard/ComponentCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

.title {
font-size: var(--web-app-font-size-lg);
--denhaag-link-icon-gap: var(--web-app-size-xs);
}

.title > :first-child > span > svg {
.title > span > svg {
width: var(--web-app-font-size-lg);
height: var(--web-app-font-size-lg);
}

.title > :first-child {
.title > span {
display: flex;
}

Expand Down
30 changes: 19 additions & 11 deletions pwa/src/components/componentCard/ComponentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ export const ComponentCard: React.FC<ComponentCardProps> = ({ title, layer, cate
});

return (
<CardWrapper className={styles.container}>
<CardWrapper className={styles.container} onClick={() => navigate(title.href)}>
<CardHeader>
<CardHeaderTitle>
<div className={styles.title}>
<Link onClick={() => navigate(title.href)}>
<Icon className="utrecht-icon--conduction-start">
<IconArrowRight />
</Icon>
{title.label}
</Link>
</div>
<Link className={styles.title} onClick={() => navigate(title.href)}>
<Icon>
<IconArrowRight />
</Icon>
{title.label}
</Link>
</CardHeaderTitle>
</CardHeader>

Expand Down Expand Up @@ -110,7 +108,10 @@ export const ComponentCard: React.FC<ComponentCardProps> = ({ title, layer, cate
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="Organisatie"
onClick={() => open(tags?.organization?.website)}
onClick={(e) => {
e.stopPropagation();
open(tags?.organization?.website);
}}
>
<FontAwesomeIcon icon={faHouse} />
{tags.organization.name}
Expand All @@ -125,7 +126,14 @@ export const ComponentCard: React.FC<ComponentCardProps> = ({ title, layer, cate
</DataBadge>
)}
{tags.githubLink && (
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="GitHub" onClick={() => open(tags.githubLink)}>
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="GitHub"
onClick={(e) => {
e.stopPropagation();
open(tags.githubLink);
}}
>
<GitHubLogo />
{t("Repository")}
</DataBadge>
Expand Down
1 change: 0 additions & 1 deletion pwa/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from "./applicationCard/ApplicationCard";
export * from "./buttonLink/ButtonLink";
export * from "./categoryCard/CategoryCard";
export * from "./componentCard/ComponentCard";
export * from "./link/Link";
export * from "./organizationCard/OrganizationCard";
export * from "./pagination/pagination";
export * from "./resultsDisplaySwitch/ResultsDisplaySwitch";
47 changes: 0 additions & 47 deletions pwa/src/components/link/Link.tsx

This file was deleted.

73 changes: 39 additions & 34 deletions pwa/src/components/organizationCard/OrganizationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as React from "react";
import * as styles from "./OrganizationCard.module.css";
import { DataBadge, Icon, Paragraph } from "@utrecht/component-library-react/dist/css-module";
import { DataBadge, Icon, Link, Paragraph } from "@utrecht/component-library-react/dist/css-module";
import { navigate } from "gatsby";
import _ from "lodash";
import { IconArrowRight } from "@tabler/icons-react";
import { useTranslation } from "react-i18next";
import clsx from "clsx";
import { Link } from "../../components";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBuilding, faGlobe, faHouseLaptop, faRepeat, faUserCog } from "@fortawesome/free-solid-svg-icons";
import { GitHubLogo } from "../../assets/svgs/GitHub";
Expand Down Expand Up @@ -47,18 +46,19 @@ export const OrganizationCard: React.FC<OrganizationCardProps> = ({
const { t } = useTranslation();

return (
<CardWrapper className={clsx([styles.container, layoutClassName && layoutClassName])}>
<CardWrapper
className={clsx([styles.container, layoutClassName && layoutClassName])}
onClick={() => navigate(title.href)}
>
<CardHeader className={styles.header}>
remko48 marked this conversation as resolved.
Show resolved Hide resolved
<div className={styles.headerContent}>
<CardHeaderTitle>
<div className={styles.titleLink}>
<Link to={title.href}>
<Icon className="utrecht-icon--conduction-start">
<IconArrowRight />
</Icon>
{title.label}
</Link>
</div>
<Link className={styles.titleLink} onClick={() => navigate(title.href)}>
<Icon>
<IconArrowRight />
</Icon>
{title.label}
</Link>
</CardHeaderTitle>

<Paragraph className={styles.description}>{description}</Paragraph>
Expand All @@ -72,59 +72,64 @@ export const OrganizationCard: React.FC<OrganizationCardProps> = ({
</CardHeader>

<div className={styles.tagsContainer}>
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="Organisatie type"
onClick={() => navigate(title.href)}
>
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="Organisatie type">
<FontAwesomeIcon icon={faBuilding} />

{t(_.upperFirst(type ? type : "Unknown"))}
</DataBadge>

<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="Aantal eigen componenten"
onClick={() => navigate(title.href)}
>
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="Aantal eigen componenten">
<FontAwesomeIcon icon={faHouseLaptop} />
{components.owned}
</DataBadge>

<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="Aantal ondersteunde componenten"
onClick={() => navigate(title.href)}
>
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="Aantal ondersteunde componenten">
<FontAwesomeIcon icon={faUserCog} />
{components.supported}
</DataBadge>

<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="Aantal gebruikte componenten"
onClick={() => navigate(title.href)}
>
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="Aantal gebruikte componenten">
<FontAwesomeIcon icon={faRepeat} />
{components.used}
</DataBadge>

{website && (
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content={website} onClick={() => open(website)}>
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content={website}
onClick={(e) => {
e.stopPropagation();
open(website);
}}
>
<FontAwesomeIcon icon={faGlobe} />
Website
</DataBadge>
)}

{gitHub && (
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="GitHub" onClick={() => open(gitHub)}>
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="GitHub"
onClick={(e) => {
e.stopPropagation();
open(gitHub);
}}
>
<GitHubLogo />
{t("GitHub")}
</DataBadge>
)}

{gitLab && (
<DataBadge data-tooltip-id={TOOLTIP_ID} data-tooltip-content="GitLab" onClick={() => open(gitLab)}>
<DataBadge
data-tooltip-id={TOOLTIP_ID}
data-tooltip-content="GitLab"
onClick={(e) => {
e.stopPropagation();
open(gitLab);
}}
>
<GitLabLogo />
{t("GitLab")}
</DataBadge>
Expand Down
8 changes: 0 additions & 8 deletions pwa/src/pages/documentation/api.tsx

This file was deleted.

18 changes: 18 additions & 0 deletions pwa/src/services/getStatusColor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const getStatusColor = (status: string): string => {
switch (status) {
case "Concept":
return "warning";
case "Development":
return "warning";
case "Beta":
return "warning";
case "Bruikbaar":
return "safe";
case "Stable":
return "safe";
case "Obsolete":
return "danger";
default:
return "";
}
};
Loading
Loading