Skip to content

Commit

Permalink
Fixed useEffect and updated Favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaufderheyde committed Mar 14, 2024
1 parent 19335e3 commit 35235fb
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 189 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified .next/cache/webpack/client-development/0.pack.gz
Binary file not shown.
Binary file modified .next/cache/webpack/client-development/1.pack.gz
Binary file not shown.
Binary file modified .next/cache/webpack/client-development/index.pack.gz
Binary file not shown.
Binary file modified .next/cache/webpack/client-development/index.pack.gz.old
Binary file not shown.
Binary file modified .next/cache/webpack/server-development/0.pack.gz
Binary file not shown.
Binary file modified .next/cache/webpack/server-development/index.pack.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion .next/server/app-paths-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/page": "app/page.js",
"/contact/page": "app/contact/page.js",
"/clubs/page": "app/clubs/page.js",
"/contact/page": "app/contact/page.js",
"/imprint/page": "app/imprint/page.js",
"/termsofuse/page": "app/termsofuse/page.js"
}
6 changes: 3 additions & 3 deletions .next/server/app/page.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .next/server/webpack-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("077af1c0de9e4dfe")
/******/ __webpack_require__.h = () => ("8841f76e65e67a9f")
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
Expand Down
15 changes: 15 additions & 0 deletions .next/trace

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions README copy.md

This file was deleted.

27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
# cannabisclubsberlin.com
Main repository for cannabisclubsberlin.com, berlincannabisclubs.de and berlincannabisclubs.info

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
66 changes: 0 additions & 66 deletions about.html

This file was deleted.

Binary file added app/.DS_Store
Binary file not shown.
18 changes: 8 additions & 10 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import HeaderComponent from "../components/HeaderComponent";

export default function About() {
useEffect(() => {
// Assuming you're using Next.js for SPA and React for UI,
// check for "index.html" in URL might not be directly applicable.
// Adjust the logic based on your routing setup if needed.
if (typeof window !== 'undefined' && window.location.pathname === '/') {
// Handles smooth scrolling for '.nav-links a' and '.btn'
const handleSmoothScroll = (selector: string) => {
const links = document.querySelectorAll(selector);
links.forEach(link => {
link.addEventListener('click', function (this: HTMLAnchorElement, e: MouseEvent) {
link.addEventListener('click', function(e: Event) {
e.preventDefault();
const href = this.getAttribute('href');
const clickedElement = e.currentTarget as HTMLAnchorElement; // Safe cast since we know the context
const href = clickedElement.getAttribute('href');
if (href && href.startsWith('#')) {
const targetSection = document.querySelector(href);
const targetSection = document.querySelector(href) as HTMLElement; // Type assertion
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth',
Expand All @@ -28,12 +25,13 @@ export default function About() {
});
});
};

// Initialize smooth scroll for both sets of links
// Example usage
handleSmoothScroll('.nav-links a');
handleSmoothScroll('.btn');
}
}, []);
}, []); // Assuming no dependencies


return (
<div>
Expand Down
17 changes: 7 additions & 10 deletions app/clubs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import HeaderComponent from "../components/HeaderComponent";

export default function Clubs() {
useEffect(() => {
// Assuming you're using Next.js for SPA and React for UI,
// check for "index.html" in URL might not be directly applicable.
// Adjust the logic based on your routing setup if needed.
if (typeof window !== 'undefined' && window.location.pathname === '/') {
// Handles smooth scrolling for '.nav-links a' and '.btn'
const handleSmoothScroll = (selector: string) => {
const links = document.querySelectorAll(selector);
links.forEach(link => {
link.addEventListener('click', function (this: HTMLAnchorElement, e: MouseEvent) {
link.addEventListener('click', function(e: Event) {
e.preventDefault();
const href = this.getAttribute('href');
const clickedElement = e.currentTarget as HTMLAnchorElement; // Safe cast since we know the context
const href = clickedElement.getAttribute('href');
if (href && href.startsWith('#')) {
const targetSection = document.querySelector(href);
const targetSection = document.querySelector(href) as HTMLElement; // Type assertion
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth',
Expand All @@ -28,12 +25,12 @@ export default function Clubs() {
});
});
};

// Initialize smooth scroll for both sets of links
// Example usage
handleSmoothScroll('.nav-links a');
handleSmoothScroll('.btn');
}
}, []);
}, []); // Assuming no dependencies

return (
<div>
Expand Down
17 changes: 7 additions & 10 deletions app/contact/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import HeaderComponent from "../components/HeaderComponent";

export default function Contact() {
useEffect(() => {
// Assuming you're using Next.js for SPA and React for UI,
// check for "index.html" in URL might not be directly applicable.
// Adjust the logic based on your routing setup if needed.
if (typeof window !== 'undefined' && window.location.pathname === '/') {
// Handles smooth scrolling for '.nav-links a' and '.btn'
const handleSmoothScroll = (selector: string) => {
const links = document.querySelectorAll(selector);
links.forEach(link => {
link.addEventListener('click', function (this: HTMLAnchorElement, e: MouseEvent) {
link.addEventListener('click', function(e: Event) {
e.preventDefault();
const href = this.getAttribute('href');
const clickedElement = e.currentTarget as HTMLAnchorElement; // Safe cast since we know the context
const href = clickedElement.getAttribute('href');
if (href && href.startsWith('#')) {
const targetSection = document.querySelector(href);
const targetSection = document.querySelector(href) as HTMLElement; // Type assertion
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth',
Expand All @@ -28,12 +25,12 @@ export default function Contact() {
});
});
};

// Initialize smooth scroll for both sets of links
// Example usage
handleSmoothScroll('.nav-links a');
handleSmoothScroll('.btn');
}
}, []);
}, []); // Assuming no dependencies

return (
<div>
Expand Down
Binary file modified app/favicon.ico
Binary file not shown.
Binary file added app/favicon.webp
Binary file not shown.
17 changes: 7 additions & 10 deletions app/imprint/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import HeaderComponent from "../components/HeaderComponent";

export default function Imprint() {
useEffect(() => {
// Assuming you're using Next.js for SPA and React for UI,
// check for "index.html" in URL might not be directly applicable.
// Adjust the logic based on your routing setup if needed.
if (typeof window !== 'undefined' && window.location.pathname === '/') {
// Handles smooth scrolling for '.nav-links a' and '.btn'
const handleSmoothScroll = (selector: string) => {
const links = document.querySelectorAll(selector);
links.forEach(link => {
link.addEventListener('click', function (this: HTMLAnchorElement, e: MouseEvent) {
link.addEventListener('click', function(e: Event) {
e.preventDefault();
const href = this.getAttribute('href');
const clickedElement = e.currentTarget as HTMLAnchorElement; // Safe cast since we know the context
const href = clickedElement.getAttribute('href');
if (href && href.startsWith('#')) {
const targetSection = document.querySelector(href);
const targetSection = document.querySelector(href) as HTMLElement; // Type assertion
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth',
Expand All @@ -28,12 +25,12 @@ export default function Imprint() {
});
});
};

// Initialize smooth scroll for both sets of links
// Example usage
handleSmoothScroll('.nav-links a');
handleSmoothScroll('.btn');
}
}, []);
}, []); // Assuming no dependencies

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "./globals.css";
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Cannabis Clubs Berlin",
description: "Your number one spot for all cannabis related information in Berlin, Germany!",
};

export default function RootLayout({
Expand Down
18 changes: 7 additions & 11 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@ import Image from "next/image";
import React, { useEffect } from 'react';
import HeadComponent from "./components/HeadComponent";
import FooterComponent from "./components/FooterComponent";
import HeaderComponent from "./components/HeaderComponent";
import HeaderHomeComponent from "./components/HeaderHomeComponent";
import Link from "next/link";

export default function Home() {
useEffect(() => {
// Assuming you're using Next.js for SPA and React for UI,
// check for "index.html" in URL might not be directly applicable.
// Adjust the logic based on your routing setup if needed.
if (typeof window !== 'undefined' && window.location.pathname === '/') {
// Handles smooth scrolling for '.nav-links a' and '.btn'
const handleSmoothScroll = (selector: string) => {
const links = document.querySelectorAll(selector);
links.forEach(link => {
link.addEventListener('click', function (this: HTMLAnchorElement, e: MouseEvent) {
link.addEventListener('click', function(e: Event) {
e.preventDefault();
const href = this.getAttribute('href');
const clickedElement = e.currentTarget as HTMLAnchorElement; // Safe cast since we know the context
const href = clickedElement.getAttribute('href');
if (href && href.startsWith('#')) {
const targetSection = document.querySelector(href);
const targetSection = document.querySelector(href) as HTMLElement; // Type assertion
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth',
Expand All @@ -31,12 +27,12 @@ export default function Home() {
});
});
};

// Initialize smooth scroll for both sets of links
// Example usage
handleSmoothScroll('.nav-links a');
handleSmoothScroll('.btn');
}
}, []);
}, []); // Assuming no dependencies

return (
<div>
Expand Down
Loading

0 comments on commit 35235fb

Please sign in to comment.