Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add QR code for shared link #13128

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@
"force_re-scan_library_files": "Vynucené prohledání všech souborů knihovny",
"forward": "Dopředu",
"general": "Obecné",
"generate_qr_code": "Vygenerovat QR kod",
"get_help": "Získat pomoc",
"getting_started": "Začínáme",
"go_back": "Přejít zpět",
Expand Down
1 change: 1 addition & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@
"folders_feature_description": "Browsing the folder view for the photos and videos on the file system",
"forward": "Forward",
"general": "General",
"generate_qr_code": "Generate QR code",
"get_help": "Get Help",
"getting_started": "Getting Started",
"go_back": "Go back",
Expand Down
1 change: 1 addition & 0 deletions i18n/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@
"force_re-scan_library_files": "",
"forward": "",
"general": "Všeobecné",
"generate_qr_code": "Vygenerovat QR kod",
"get_help": "",
"getting_started": "",
"go_back": "",
Expand Down
21 changes: 21 additions & 0 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"svelte-i18n": "^4.0.0",
"svelte-local-storage-store": "^0.6.4",
"svelte-maplibre": "^0.9.13",
"svelte-qrcode-image": "^2.0.0-alpha.1",
"thumbhash": "^0.1.1"
},
"volta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import { locale } from '$lib/stores/preferences.store';
import { DateTime, Duration } from 'luxon';
import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte';
import { QRCodeImage } from 'svelte-qrcode-image';

export let onClose: () => void;
export let albumId: string | undefined = undefined;
Expand All @@ -23,6 +24,8 @@
export let onCreated: () => void = () => {};

let sharedLink: string | null = null;
let QRCodeGenerated: boolean;
let QRCodeWidth: number = 376;
let description = '';
let allowDownload = true;
let allowUpload = false;
Expand Down Expand Up @@ -99,6 +102,10 @@
}
};

const generateQRCode = () => {
QRCodeGenerated = true;
};

const handleEditLink = async () => {
if (!editingLink) {
return;
Expand Down Expand Up @@ -218,6 +225,17 @@
number={true}
/>
</div>
<div class="mt-3" id="qrcode">
{#if sharedLink}
{#if !QRCodeGenerated}
<Button size="sm" fullwidth on:click={generateQRCode}>{$t('generate_qr_code')}</Button>
{:else}
<div class="container">
<QRCodeImage text={sharedLink} displayStyle="border-style: dotted;" displayWidth={QRCodeWidth} />
</div>
{/if}
{/if}
</div>
</div>
</div>
</section>
Expand Down
Loading