mirror of
https://github.com/KevinMidboe/planetposen-frontend.git
synced 2025-10-29 13:10:12 +00:00
Resolved all eslint issues
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { fade, fly, slide } from 'svelte/transition';
|
||||
import type IOrderValidationError from '$lib/interfaces/IOrderValidationError';
|
||||
import { fly, slide } from 'svelte/transition';
|
||||
|
||||
export let errors: string[] = [];
|
||||
let currentCard = 0;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import ProductTile from './ProductTile.svelte';
|
||||
import Button from './Button.svelte';
|
||||
// import Button from './Button.svelte';
|
||||
import type { IProduct } from '$lib/interfaces/IProduct';
|
||||
import LinkArrow from './LinkArrow.svelte';
|
||||
|
||||
export let products: IProduct[];
|
||||
export let title: string;
|
||||
export let textColor: string = 'black';
|
||||
export let backgroundColor: string = 'white';
|
||||
export let textColor = 'black';
|
||||
export let backgroundColor = 'white';
|
||||
|
||||
let galleryStyles = `background-color: ${backgroundColor}; color: ${textColor}`;
|
||||
</script>
|
||||
|
||||
@@ -80,7 +80,7 @@ color: ${product?.primary_color === '#231B1D' ? '#f3efeb' : '#37301e'}`;
|
||||
if (entries[0]?.isIntersecting) {
|
||||
const target = entries[0]?.target as HTMLElement;
|
||||
const targetIndex = Number(target?.dataset?.index);
|
||||
if (targetIndex === NaN) return;
|
||||
if (isNaN(targetIndex)) return;
|
||||
|
||||
selected = targetIndex;
|
||||
updateHeight();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
let dragOver: boolean = false;
|
||||
let dragOver = false;
|
||||
let fileInput: HTMLInputElement;
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
@@ -23,7 +23,7 @@
|
||||
await uploadImage(file);
|
||||
}
|
||||
|
||||
setTimeout(() => (fileInput.value = ''), 3000);
|
||||
setTimeout(() => resetUploadInput, 3000);
|
||||
}
|
||||
|
||||
function resetUploadInput() {
|
||||
@@ -80,20 +80,21 @@
|
||||
// uploadImage(file)
|
||||
}
|
||||
|
||||
function onFileDrop(event: Event) {
|
||||
const { files } = event?.dataTransfer;
|
||||
function onFileDrop(event: DragEvent) {
|
||||
const files: FileList | undefined = event?.dataTransfer?.files;
|
||||
if (files) {
|
||||
fileInput.files = files;
|
||||
}
|
||||
}
|
||||
|
||||
$: hasFiles = fileInput?.files?.length > 0 || false;
|
||||
$: hasFiles = (fileInput?.files && fileInput?.files?.length > 0) || false;
|
||||
</script>
|
||||
|
||||
<div
|
||||
id="drop_zone"
|
||||
class="{dragOver ? 'highlighted' : ''}"
|
||||
on:click="{() => fileInput.click()}"
|
||||
on:keypress="{(e) => e.code === 'Enter' && fileInput.click()}"
|
||||
on:drop|preventDefault="{onFileDrop}"
|
||||
on:dragover|preventDefault="{() => (dragOver = true)}"
|
||||
on:dragenter|preventDefault="{() => (dragOver = true)}"
|
||||
@@ -118,8 +119,11 @@
|
||||
<span>Files found to upload:</span>
|
||||
|
||||
<div class="thumbnails">
|
||||
{#each fileInput.files || [] as file}
|
||||
<img src="{window.URL.createObjectURL(file)}" />
|
||||
{#each fileInput.files || [] as file, index}
|
||||
<img
|
||||
src="{window.URL.createObjectURL(file)}"
|
||||
alt="{`Upload asset thumbnail number ${index + 1}`}"
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
export let pointLeft: boolean = false;
|
||||
export let pointLeft = false;
|
||||
let defaultRoute = '/shop';
|
||||
|
||||
function navigateBack() {
|
||||
|
||||
@@ -3,8 +3,8 @@ import { loadStripe } from '@stripe/stripe-js/pure';
|
||||
import type {
|
||||
ConfirmCardPaymentData,
|
||||
PaymentIntentResult,
|
||||
Stripe,
|
||||
StripeError
|
||||
Stripe
|
||||
// StripeError
|
||||
} from '@stripe/stripe-js';
|
||||
|
||||
let stripeInstance: Stripe;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import FrontTextImageBubble from '$lib/components/FrontTextImageBubble.svelte';
|
||||
// import FrontProductGallery from '$lib/components/FrontProductGallery.svelte';
|
||||
import type IFrontTextImage from '$lib/interfaces/IFrontTextImage';
|
||||
import type { IProduct } from '$lib/interfaces/IProduct';
|
||||
// import type { IProduct } from '$lib/interfaces/IProduct';
|
||||
import type IFrontText from '$lib/interfaces/IFrontText';
|
||||
|
||||
const textImages: Array<IFrontTextImage> = [
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
import { buildApiUrl } from '$lib/utils/apiUrl';
|
||||
import type { StripeCardElement } from '@stripe/stripe-js/types';
|
||||
import type ICustomer from '$lib/interfaces/ICustomer';
|
||||
import type IOrderValidationError from '$lib/interfaces/IOrderValidationError';
|
||||
import type {
|
||||
IOrderCreateDTO,
|
||||
IOrderCreateResponse,
|
||||
@@ -44,7 +43,7 @@
|
||||
|
||||
function handleSubmitOrderError(error: IOrderCreateUnsuccessfullResponse) {
|
||||
console.log('got error from order api!', error, error?.validationErrors);
|
||||
const { success, validationErrors } = error;
|
||||
const { validationErrors } = error;
|
||||
|
||||
if (!validationErrors || validationErrors?.length == 0) {
|
||||
errors.push('Ukjent feil ved plassering av ordre.');
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
import PaymentDetails from './PaymentDetails.svelte';
|
||||
import CustomerDetails from './CustomerDetails.svelte';
|
||||
import TrackingDetails from './TrackingDetails.svelte';
|
||||
import ShipmentProgress from '$lib/components/ShipmentProgress.svelte';
|
||||
import type { IOrder } from '$lib/interfaces/IOrder';
|
||||
import type { PageServerData } from './$types';
|
||||
|
||||
|
||||
@@ -49,10 +49,9 @@
|
||||
else updateShipment();
|
||||
}
|
||||
|
||||
let edit: boolean = false;
|
||||
let edit = false;
|
||||
let trackingCode: string = shipping?.tracking_code;
|
||||
let trackingLink: string = shipping?.tracking_link;
|
||||
let courier: string = shipping?.courier;
|
||||
let selectedCourier: any = shipping?.courier_id;
|
||||
let couriers: ICourier[];
|
||||
</script>
|
||||
@@ -63,7 +62,7 @@
|
||||
{#if shipping}
|
||||
<ul class="property-list">
|
||||
<li>
|
||||
<span class="label" for="courier">Tracking company</span>
|
||||
<label class="label" for="courier">Tracking company</label>
|
||||
{#if !edit}
|
||||
<span>{shipping.courier}</span>
|
||||
{:else if couriers?.length > 0}
|
||||
|
||||
Reference in New Issue
Block a user