Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 6981751

Browse files
authored
feat: add external links menu button (#245)
1 parent ae30f47 commit 6981751

5 files changed

Lines changed: 61 additions & 2 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import MoreIcon from '../../icons/ui/MoreIcon';
2+
import DropdownContainer from '../containers/DropdownContainer';
3+
4+
export const ExternalLinks = () => {
5+
const links = [
6+
{
7+
name: 'Report an Issue',
8+
url: 'https://github.com/CircleCI-Public/visual-config-editor/issues/new/choose',
9+
},
10+
{
11+
name: 'Contribute',
12+
url: 'https://github.com/CircleCI-Public/visual-config-editor',
13+
},
14+
];
15+
return (
16+
<DropdownContainer
17+
alignLeft
18+
className="flex flex-1 rounded-md w-10 bg-white items-center justify-center px-2 border border-circle-gray-300 hover:bg-circle-gray-250"
19+
>
20+
<MoreIcon className="w-5 h-6" />
21+
<div className="rounded border border-circle-gray-300 p-2 z-30 bg-white flex flex-col">
22+
{links.map((link) => (
23+
<a
24+
href={link.url}
25+
className="rounded flex w-full hover:bg-circle-gray-250 border-b border-circle-gray-300 p-2"
26+
>
27+
{link.name}
28+
</a>
29+
))}
30+
</div>
31+
</DropdownContainer>
32+
);
33+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ExternalLinks } from "./ExternalLinks";
2+
import PreviewToolbox from "./PreviewToolbox";
3+
4+
export default function HeaderMenu() {
5+
return (
6+
<div className="absolute z-50 flex flex-row p-4 space-x-2">
7+
<PreviewToolbox />
8+
<ExternalLinks />
9+
</div>
10+
);
11+
}

src/components/containers/PreviewToolbox.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export default function PreviewToolbox() {
2424

2525
return (
2626
<DropdownContainer
27-
className="absolute p-2 z-50"
2827
space={-2}
2928
dontCollapse
3029
onClick={() => {

src/components/containers/WorkflowContainer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import ConnectionLine from '../atoms/ConnectionLine';
2121
import Edge from '../atoms/Edge';
2222
import { JobMapping } from '../../mappings/components/JobMapping';
2323
import PreviewToolbox from './PreviewToolbox';
24+
import { ExternalLinks } from './ExternalLinks';
25+
import HeaderMenu from './HeaderMenu';
2426

2527
export interface ElementProps {
2628
className?: string;
@@ -253,7 +255,7 @@ const WorkflowContainer = ({ bgClassName, className }: ElementProps) => {
253255
}
254256
}}
255257
>
256-
<PreviewToolbox />
258+
<HeaderMenu />
257259
<ReactFlow
258260
elements={elements}
259261
className={className}

src/icons/ui/MoreIcon.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { IconProps } from '../IconProps';
2+
3+
const MoreIcon = (props: IconProps) => (
4+
<svg viewBox="0 0 22 20" className={props.className}>
5+
<path
6+
fillRule="evenodd"
7+
clipRule="evenodd"
8+
d="M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
9+
fill={props.color}
10+
/>
11+
</svg>
12+
);
13+
14+
export default MoreIcon;

0 commit comments

Comments
 (0)