Skip to content

Commit b12b40c

Browse files
committed
Make publish button available on mobile
Fix #508
1 parent 3860e1a commit b12b40c

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/lib/components/assets/list/primary-sidebar.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
3434
<div role="none" class="primary-sidebar">
3535
{#if $isSmallScreen}
36-
<h2>{$_('assets')}</h2>
36+
<header>
37+
<h2>{$_('assets')}</h2>
38+
</header>
3739
<QuickSearchBar
3840
onclick={(event) => {
3941
event.preventDefault();

src/lib/components/common/page-container.svelte

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,18 @@
5252
background-color: var(--sui-primary-background-color);
5353
}
5454
55-
h2 {
55+
// Mobile header
56+
header {
5657
display: flex;
5758
align-items: center;
58-
padding: 0 20px;
59+
justify-content: space-between;
60+
padding: 0 10px;
5961
height: var(--sui-primary-toolbar-size);
60-
font-size: var(--sui-font-size-x-large);
62+
63+
h2 {
64+
padding: 0 10px;
65+
font-size: var(--sui-font-size-x-large);
66+
}
6167
}
6268
6369
.sui.search-bar {

src/lib/components/contents/list/primary-sidebar.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { _, locale as appLocale } from 'svelte-i18n';
55
66
import SingletonOption from '$lib/components/contents/list/singleton-option.svelte';
7+
import PublishButton from '$lib/components/global/toolbar/items/publish-button.svelte';
78
import QuickSearchBar from '$lib/components/global/toolbar/items/quick-search-bar.svelte';
89
import { goto } from '$lib/services/app/navigation';
910
import { siteConfig } from '$lib/services/config';
@@ -20,7 +21,10 @@
2021
2122
<div role="none" class="primary-sidebar">
2223
{#if $isSmallScreen}
23-
<h2>{$_('contents')}</h2>
24+
<header>
25+
<h2>{$_('contents')}</h2>
26+
<PublishButton />
27+
</header>
2428
<QuickSearchBar
2529
onclick={(event) => {
2630
event.preventDefault();

src/lib/components/global/toolbar/items/publish-button.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
import { backend, isLastCommitPublished } from '$lib/services/backends';
66
import { skipCIConfigured } from '$lib/services/backends/git/shared/integration';
7+
import { isSmallScreen } from '$lib/services/user/env';
78
import { prefs } from '$lib/services/user/prefs';
89
910
const { deployHookURL } = $derived($prefs);
@@ -47,6 +48,7 @@
4748
{#if $skipCIConfigured}
4849
<Button
4950
variant="secondary"
51+
size={$isSmallScreen ? 'small' : 'medium'}
5052
label={$_('publish_changes')}
5153
disabled={!canPublish}
5254
onclick={() => publish()}

0 commit comments

Comments
 (0)