Use VSCodeLink for links in header

This commit is contained in:
Koen Vlaswinkel
2022-09-14 16:11:20 +02:00
parent 2cdded9cca
commit 0ad44a3fe2
3 changed files with 17 additions and 35 deletions

View File

@@ -1,25 +0,0 @@
import styled from 'styled-components';
export const LinkButton = styled.button`
/* Remove button styling */
background: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
text-decoration: none;
padding-right: 1em;
color: var(--vscode-textLink-foreground);
border: 1px solid transparent;
&:hover, &:active {
color: var(--vscode-textLink-activeForeground);
text-decoration: underline;
}
&:focus,
&:focus-visible {
border: 1px solid var(--vscode-focusBorder);
}
`;

View File

@@ -1,7 +1,7 @@
import { VSCodeLink } from '@vscode/webview-ui-toolkit/react';
import styled from 'styled-components';
import { LinkButton } from './LinkButton';
export const LinkIconButton = styled(LinkButton)`
export const LinkIconButton = styled(VSCodeLink)`
svg {
margin-right: 0.3em;
}

View File

@@ -29,6 +29,11 @@ const HeaderWrapper = styled.div`
max-width: 100%;
`;
const HeaderButtons = styled.div`
display: flex;
gap: 1em;
`;
const ActionsWrapper = styled.div`
margin-left: auto;
display: flex;
@@ -53,14 +58,16 @@ export const VariantAnalysisHeader = ({
<Wrapper>
<HeaderWrapper>
<ViewTitle>{queryName}</ViewTitle>
<LinkIconButton onClick={onOpenQueryClick}>
<FileCodeIcon size={16} />
{queryFileName}
</LinkIconButton>
<LinkIconButton onClick={onViewQueryClick}>
<CodeSquareIcon size={16} />
View query
</LinkIconButton>
<HeaderButtons>
<LinkIconButton onClick={onOpenQueryClick}>
<FileCodeIcon size={16} />
{queryFileName}
</LinkIconButton>
<LinkIconButton onClick={onViewQueryClick}>
<CodeSquareIcon size={16} />
View query
</LinkIconButton>
</HeaderButtons>
</HeaderWrapper>
<ActionsWrapper>
{status === VariantAnalysisStatus.InProgress && (