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 11 commits into
base: main
Choose a base branch
from
7 changes: 7 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": "^1.0.0",
"thumbhash": "^0.1.1"
},
"volta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import { locale } from '$lib/stores/preferences.store';
import { DateTime, Duration } from 'luxon';
import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte';
import QrCode from "svelte-qrcode"


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

let sharedLink: string | null = null;
let showQRCode: boolean | null = false;
danieldietzler marked this conversation as resolved.
Show resolved Hide resolved
let description = '';
let allowDownload = true;
let allowUpload = false;
Expand Down Expand Up @@ -94,6 +97,8 @@
});
sharedLink = makeSharedLinkUrl($serverConfig.externalDomain, data.key);
onCreated();
showQRCode = true;

danieldietzler marked this conversation as resolved.
Show resolved Hide resolved
} catch (error) {
handleError(error, $t('errors.failed_to_create_shared_link'));
}
Expand Down Expand Up @@ -218,6 +223,13 @@
number={true}
/>
</div>
<div class="mt-3" id="qrcode">
{#if showQRCode}
<div class="container">
<QrCode value="{sharedLink}" size="376"/>
</div>
{/if}
</div>
</div>
</div>
</section>
Expand Down
Loading
Loading