Show dismiss button when a specific commit has been selected

This commit is contained in:
Rūdolfs Ošiņš
2024-07-26 15:15:01 +02:00
parent e31ca2d0aa
commit f4c773c81b
3 changed files with 32 additions and 17 deletions
+28 -15
View File
@@ -89,21 +89,34 @@
</style>
<div class="top-header">
<PeerBranchSelector
{peers}
{peer}
{baseRoute}
onCanonical={Boolean(!peer && selectedBranch === project.defaultBranch)}
{project}
{selectedBranch} />
<CommitButton
styleMinWidth="0"
styleWidth="100%"
hideSummaryOnMobile={false}
projectId={project.id}
commit={lastCommit}
baseUrl={node}
styleRoundBorders />
{#if selectedBranch}
<PeerBranchSelector
{peers}
{peer}
{baseRoute}
onCanonical={Boolean(!peer && selectedBranch === project.defaultBranch)}
{project}
{selectedBranch} />
{/if}
<div class="global-flex-item txt-overflow" style:gap="1px">
<CommitButton
styleMinWidth="0"
styleWidth="100%"
hideSummaryOnMobile={false}
projectId={project.id}
commit={lastCommit}
styleRoundBorders={Boolean(selectedBranch)}
baseUrl={node} />
{#if !selectedBranch}
<Link route={baseRoute}>
<Button
variant="not-selected"
styleBorderRadius="0 var(--border-radius-tiny) var(--border-radius-tiny) 0">
<IconSmall name="cross" />
</Button>
</Link>
{/if}
</div>
</div>
<div class="header">
@@ -118,7 +118,9 @@
slot="toggle"
let:expanded
let:toggle
styleBorderRadius="var(--border-radius-tiny) 0 0 var(--border-radius-tiny)"
styleBorderRadius={onCanonical
? "var(--border-radius-tiny)"
: "var(--border-radius-tiny) 0 0 var(--border-radius-tiny)"}
styleWidth="100%"
on:click={toggle}
title="Change branch"
@@ -44,7 +44,7 @@
{styleMinWidth}
styleBorderRadius={styleRoundBorders
? "var(--border-radius-tiny)"
: "0 var(--border-radius-tiny) var(--border-radius-tiny) 0"}>
: "var(--border-radius-tiny) 0 0 var(--border-radius-tiny)"}>
<div class="txt-overflow commit">
<div class="identifier global-commit">
{commitShortId}