Changes
Co-authored-by: wolfoftyreso-debug <250630591+wolfoftyreso-debug@users.noreply.github.com>
This commit is contained in:
+22
-26
@@ -9,7 +9,7 @@ import { useToast } from "@/hooks/use-toast";
|
|||||||
import { supabase } from "@/integrations/supabase/client";
|
import { supabase } from "@/integrations/supabase/client";
|
||||||
import Header from "@/components/Header";
|
import Header from "@/components/Header";
|
||||||
import { Save, Package } from "lucide-react";
|
import { Save, Package } from "lucide-react";
|
||||||
import { useShopifyProducts } from "@/hooks/useShopifyProducts";
|
|
||||||
|
|
||||||
// Validate Stockholm postal codes (100 00 - 199 99)
|
// Validate Stockholm postal codes (100 00 - 199 99)
|
||||||
const isStockholmPostalCode = (postalCode: string) => {
|
const isStockholmPostalCode = (postalCode: string) => {
|
||||||
@@ -71,7 +71,7 @@ const Account = () => {
|
|||||||
const { user, loading: authLoading, signOut } = useAuth();
|
const { user, loading: authLoading, signOut } = useAuth();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { products, isLoading: productsLoading } = useShopifyProducts("product_type:Abonnemang");
|
|
||||||
|
|
||||||
const hasChanges =
|
const hasChanges =
|
||||||
profile.company_name !== originalProfile.company_name ||
|
profile.company_name !== originalProfile.company_name ||
|
||||||
@@ -302,30 +302,26 @@ const Account = () => {
|
|||||||
<h2 className="font-serif text-xl">Mitt abonnemang</h2>
|
<h2 className="font-serif text-xl">Mitt abonnemang</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{productsLoading ? (
|
<div className="space-y-4">
|
||||||
<p className="text-muted-foreground text-sm">Laddar abonnemang...</p>
|
<p className="text-muted-foreground text-sm">
|
||||||
) : (
|
Du har för närvarande inget aktivt abonnemang.
|
||||||
<div className="space-y-4">
|
</p>
|
||||||
<p className="text-muted-foreground text-sm">
|
<Button
|
||||||
Du har för närvarande inget aktivt abonnemang.
|
variant="outline"
|
||||||
</p>
|
onClick={() => {
|
||||||
<Button
|
navigate("/");
|
||||||
variant="outline"
|
setTimeout(() => {
|
||||||
onClick={() => {
|
const element = document.getElementById("abonnemang");
|
||||||
navigate("/");
|
if (element) {
|
||||||
setTimeout(() => {
|
element.scrollIntoView({ behavior: "smooth" });
|
||||||
const element = document.getElementById("abonnemang");
|
}
|
||||||
if (element) {
|
}, 100);
|
||||||
element.scrollIntoView({ behavior: "smooth" });
|
}}
|
||||||
}
|
className="w-full"
|
||||||
}, 100);
|
>
|
||||||
}}
|
Beställ abonnemang
|
||||||
className="w-full"
|
</Button>
|
||||||
>
|
</div>
|
||||||
Beställ abonnemang
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="text-center mt-6">
|
<div className="text-center mt-6">
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user