Skip to content

Commit

Permalink
client: added kubernetes docs links (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
MDybek authored Nov 30, 2024
1 parent f68a7ab commit e90b48c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions client/src/components/KindTag/KindTag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
padding: 5px 7px;
transition: 0.1s;
cursor: pointer;
text-decoration: none;
color: inherit;

&:hover {
filter: brightness(1.2);
Expand Down
10 changes: 6 additions & 4 deletions client/src/components/KindTag/KindTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import kubernetesDSLogo from 'assets/kubernetes-ds-icon.svg';
import kubernetesSTSLogo from 'assets/kubernetes-sts-icon.svg';
import kubernetesLogo from 'assets/kubernetes-logo-icon.svg';
import kubernetesNode from 'assets/kubernetes-node-icon.svg';
import { KUBERNETES_LINKS } from 'links/kubernetesLinks';

interface KindTagProps {
name: string;
Expand All @@ -18,12 +19,13 @@ const KindTag = ({ name }: KindTagProps) => {
};

const selectedLogo = logoMap[name] || kubernetesLogo;
const link = KUBERNETES_LINKS[name] || '#';

return (
<div className="kind-tag">
<img src={selectedLogo} width="24px" height="24px" className="kind-tag__logo" />
<div className="kind-tag__name">{name}</div>
</div>
<a href={link} target="_blank" rel="noopener noreferrer" className="kind-tag">
<img src={selectedLogo} width="24px" height="24px" className="kind-tag__logo" />
<div className="kind-tag__name">{name}</div>
</a>
);
};

Expand Down
6 changes: 6 additions & 0 deletions client/src/links/kubernetesLinks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const KUBERNETES_LINKS: Record<string, string> = {
Deployment: 'https://kubernetes.io/docs/concepts/workloads/controllers/deployment/',
DaemonSet: 'https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/',
StatefulSet: 'https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/',
Node: 'https://kubernetes.io/docs/concepts/architecture/nodes/',
};
1 change: 1 addition & 0 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@lib/*": ["lib/*"],
"@assets/*": ["assets/*"],
"@messages/*": ["messages/*"],
"@links/*": ["links/*"],
}
},
"include": ["src"],
Expand Down
1 change: 1 addition & 0 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default defineConfig({
global: '/src/global',
types: '/src/types',
messages: '/src/messages',
links: '/src/links',
},
},
});

0 comments on commit e90b48c

Please sign in to comment.