Skip to content
Snippets Groups Projects
Commit 36868295 authored by Jürgen Voskuhl's avatar Jürgen Voskuhl
Browse files

Eliminate ServiceTag.tsx

parent d7060809
No related branches found
No related tags found
1 merge request!86planning#1203: Standards
Pipeline #56163 failed
import { Tag } from 'types/content/'
import useImgPath from 'shared/use-img-path' import useImgPath from 'shared/use-img-path'
const { getImgPath } = useImgPath() const { getImgPath } = useImgPath()
export default function LifecyclePicture(lifecyclephase:Tag) { type LifecylceOptions = {
/* beim tag 'status' soll das zugehörige Lebenszyklus-Bild ausgegeben werden */ status: string
const imagePath = `/img/standards/lifecycle/${lifecyclephase.value}.svg` }
// Display the image corresponding to the lifecycle phase
export default ({ status } : LifecylceOptions) => {
const imagePath = `/img/standards/lifecycle/${status}.svg`
console.log(status)
return ( return (
<div className="border border-gray-300 rounded-lg overflow-hidden py-2"> <div className="border border-gray-300 rounded-lg overflow-hidden py-2">
{/* Die Next.js Image-Komponente verwendet das "src" Attribut */} {/* Die Next.js Image-Komponente verwendet das "src" Attribut */}
<img <img
src={getImgPath(imagePath)} src={getImgPath(imagePath)}
alt={`Bild für Tag ${lifecyclephase.value}`} alt={`Bild für Tag ${status}`}
width={500} // Breite des Bildes width={500} // Breite des Bildes
height={0} // Höhe des Bildes height={0} // Höhe des Bildes
/> />
......
...@@ -14,6 +14,8 @@ const { getImgPath } = useImgPath() ...@@ -14,6 +14,8 @@ const { getImgPath } = useImgPath()
export default function ({ contentString }) { export default function ({ contentString }) {
const content: ServiceContent = JSON.parse(contentString) const content: ServiceContent = JSON.parse(contentString)
console.log(content.status)
console.log('statusLabel = ' + translateStatusLableValue(content.status))
return ( return (
<div className={'mx-auto max-w-screen-xl it-standard'}> <div className={'mx-auto max-w-screen-xl it-standard'}>
<div className="col-start-1 col-span-12 "> <div className="col-start-1 col-span-12 ">
...@@ -35,11 +37,12 @@ export default function ({ contentString }) { ...@@ -35,11 +37,12 @@ export default function ({ contentString }) {
}} }}
title={content?.name} title={content?.name}
description={content?.text} description={content?.text}
tags = {content.tags}
developer={{ developer={{
name: content?.developer.name, name: content?.developer.name,
link: content?.developer.url, link: content?.developer.url,
}} }}
statusLabel={translateStatusLableValue(content.status)} statusLabel={content.status}
documentationURL={content.docsUrl} documentationURL={content.docsUrl}
sourceURL={content.sourceCodeUrl} sourceURL={content.sourceCodeUrl}
resources={content.childResources} resources={content.childResources}
......
import React, { ReactElement } from 'react' import React, { ReactElement } from 'react'
import { IconBooks } from '@tabler/icons-react' import { IconBooks } from '@tabler/icons-react'
import LifecyclePicture from '@/components/it-standards/LifecyclePicture'
type HeaderOptions = { type HeaderOptions = {
title: string title: string
...@@ -8,10 +9,11 @@ type HeaderOptions = { ...@@ -8,10 +9,11 @@ type HeaderOptions = {
src: string src: string
alt?: string alt?: string
} }
status?: string
children?: ReactElement[] children?: ReactElement[]
} }
export default ({ title, description, img, children }: HeaderOptions) => { export default ({ title, description, img, status, children }: HeaderOptions) => {
return ( return (
<section className="bg-white mt-10 w-full mx-auto relative z-10 lg:pb-32" aria-labelledby="heading"> <section className="bg-white mt-10 w-full mx-auto relative z-10 lg:pb-32" aria-labelledby="heading">
<h2 className="sr-only" id="heading"> <h2 className="sr-only" id="heading">
...@@ -19,6 +21,8 @@ export default ({ title, description, img, children }: HeaderOptions) => { ...@@ -19,6 +21,8 @@ export default ({ title, description, img, children }: HeaderOptions) => {
</h2> </h2>
<div className="flex flex-col bg-white border-r-4"> <div className="flex flex-col bg-white border-r-4">
<div className="flex-1 relative pt-24 px-6 pb-8 md:px-8"> <div className="flex-1 relative pt-24 px-6 pb-8 md:px-8">
{/* Icon + Title */}
<div className="h-32 top-0 p-4 inline-block transform -translate-y-1/2"> <div className="h-32 top-0 p-4 inline-block transform -translate-y-1/2">
<header className={'flex justify-between space-x-6 items-center'}> <header className={'flex justify-between space-x-6 items-center'}>
{img && img.src {img && img.src
...@@ -37,6 +41,13 @@ export default ({ title, description, img, children }: HeaderOptions) => { ...@@ -37,6 +41,13 @@ export default ({ title, description, img, children }: HeaderOptions) => {
</h1> </h1>
</header> </header>
</div> </div>
{/* Life cycle phase */}
<div className="flex">
<LifecyclePicture status = {status} />
</div>
{/* Detailed description */}
<div className="flex flex-col md:flex-row md:items-center"> <div className="flex flex-col md:flex-row md:items-center">
<div <div
className="cms-blog-text text-xl text-gray-800 mt-5 md:flex-1" className="cms-blog-text text-xl text-gray-800 mt-5 md:flex-1"
......
import React from 'react' import React from 'react'
import Link from 'next/link' import Link from 'next/link'
import PageHeaderCard from '@/../pages/standards/components/PageHeaderCard' import PageHeaderCard from '@/../pages/standards/components/PageHeaderCard'
import { decodeEmail } from '@/lib/utils' // import { decodeEmail } from '@/lib/utils'
import { Tag } from 'types/content'
type HeaderOptions = { type HeaderOptions = {
title: string title: string
...@@ -10,6 +11,7 @@ type HeaderOptions = { ...@@ -10,6 +11,7 @@ type HeaderOptions = {
src: string src: string
alt?: string alt?: string
} }
tags: Tag[]
developer: { developer: {
name: string name: string
link: string link: string
...@@ -30,6 +32,7 @@ export function Header({ ...@@ -30,6 +32,7 @@ export function Header({
title, title,
description, description,
img, img,
tags,
developer, developer,
contact, contact,
tosURL, tosURL,
...@@ -39,8 +42,9 @@ export function Header({ ...@@ -39,8 +42,9 @@ export function Header({
issuesURL, issuesURL,
resources, resources,
}: HeaderOptions) { }: HeaderOptions) {
console.log(statusLabel)
return ( return (
<PageHeaderCard title={title} description={description} img={img}> <PageHeaderCard title={title} description={description} img={img} status={statusLabel} >
{developer && ( {developer && (
<div className="sm:col-span-1 text-left"> <div className="sm:col-span-1 text-left">
<dt className="text-sm font-medium text-gray-500">Verantwortlich</dt> <dt className="text-sm font-medium text-gray-500">Verantwortlich</dt>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment