Skip to content

Commit

Permalink
Merged develop into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fabie37 committed Apr 3, 2024
2 parents 4e3ee65 + 1f46169 commit 81cdb18
Show file tree
Hide file tree
Showing 92 changed files with 5,752 additions and 1,201 deletions.
Binary file modified .DS_Store
Binary file not shown.
150 changes: 75 additions & 75 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,89 +5,89 @@
name: Deploy Next.js site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Runs on pushes targeting the default branch
push:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
group: 'pages'
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
#- name: Setup Pages
#uses: actions/configure-pages@v4
#with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
#static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v4
# with:
# # Automatically inject basePath in your Next.js configuration file and disable
# # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
# #
# # You may remove this line if you want to manage the configuration yourself.
# static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
41 changes: 38 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
node_modules
.next
build/Release
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.vscode
9 changes: 9 additions & 0 deletions .gitmessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
########60 characters#######################################
[JIRA Issue Tag] Subject
########72 characters##################################################
Problem
# Problem, Task, Reason for Commit
Solution
# Solution or List of Changes
Note
# Special instructions, testing steps, rake, etc
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# cannabisclubsberlin.com
# The CCB Project
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).
## The CCB Project
This is the project of Marc, Hector and Fabrizio. This is a webapp to discover new clubs in Berlin.

## Environment Requirements:

- NodeJS v20 (LTS): (https://nodejs.org/en)
- NPM
- NextJS

## Getting Started

First, run the development server:

First, install dependencies:

```bash
npm install
```

Next, run the development server:

```bash
npm run dev
Expand All @@ -18,12 +32,3 @@ 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!
Binary file modified app/.DS_Store
Binary file not shown.
30 changes: 30 additions & 0 deletions app/Components/CookieBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use client';
import React, { useState, useEffect } from 'react';

const CookieBanner: React.FC = () => {
const [showBanner, setShowBanner] = useState<boolean>(false);

useEffect(() => {
const isAccepted = localStorage.getItem('cookiesAccepted');
setShowBanner(!isAccepted);
}, []);

const acceptCookies = () => {
localStorage.setItem('cookiesAccepted', 'true');
setShowBanner(false);
};

if (!showBanner) return null;

return (
<div className='cookie-banner'>
<p>
We use cookies to improve your experience on our site. By
continuing to use our site, you accept our use of cookies.
</p>
<button onClick={acceptCookies}>Accept</button>
</div>
);
};

export default CookieBanner;
19 changes: 19 additions & 0 deletions app/Components/HeadComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useLocale, useTranslations } from 'next-intl';
import Head from 'next/head'

export default function HeadComponent() {
const t = useTranslations('Metadata');
const localActive = useLocale();
return (
<div>
<Head>
<meta charSet="UTF-8"/>
<meta name="subject" content={t("subject")}/>
<meta name="copyright"content="cannabisclubsberlin.com"/>
<meta name="language" content={localActive}/>
<meta name="topic" content={t("topic")}/>
<meta name="url" content="https://cannabisclubsberlin.com"/>
</Head>
</div>
);
}
24 changes: 24 additions & 0 deletions app/[locale]/about/about-content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client"
import ActionButton from '@/app/ui/Home/actionbutton';
import { useLocale, useTranslations } from 'next-intl';

export default function AboutContent() {
const t = useTranslations('AboutPage');
const localActive = useLocale();
return (
<div className='flex flex-col gap-8 md:gap-12 md:mt-30 lg:mt-16'>
<h1 className='font-bold text-4xl md:text-[4rem] opacity-[0.3] text-balance leading-tight'>
{t('headline')}
</h1>
<p>{t('headline_description')}</p>
<p>{t('headline_subdescription')}</p>
<ActionButton
backgroundColor={'#B6CF54'}
textColor={'#ffffff'}
href={`/${localActive}/law`}
>
{t('local_laws_button')}
</ActionButton>
</div>
);
}
11 changes: 11 additions & 0 deletions app/[locale]/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import AboutContent from './about-content';
import { unstable_setRequestLocale } from 'next-intl/server';

export default function About({ params: { locale } }: { params: { locale: string } }) {
unstable_setRequestLocale(locale);
return (
<div className='flex flex-col md:flex-row w-full justify-center md:justify-between items-center h-full'>
<AboutContent />
</div>
);
}
44 changes: 44 additions & 0 deletions app/[locale]/clubs/ClubCard.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
padding: 20px;
margin-bottom: auto;
}

.card {
width: 300px;
border: 1px solid #ccc;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cardNumber {
font-size: 16px;
color: #555;
}

.cardImage {
max-width: 100%;
max-height: 100%;
object-fit: contain;
padding: 5px;
}

.cardContent {
padding: 15px;
}

.cardTitle {
font-size: 20px;
color: #333;
margin: 0 0 10px 0;
}

.cardDescription {
font-size: 16px;
color: #666;
margin: 0;
}
Loading

0 comments on commit 81cdb18

Please sign in to comment.