Skip to content

Commit 047e5cd

Browse files
Herwalomfj
andcommitted
parent 2a81314
author Herwal <herwal20@gmail.com> 1727281716 +0200 committer herwal <herwal20@gmail.com> 1727438031 +0200 parent 2a81314 author Herwal <herwal20@gmail.com> 1727281716 +0200 committer herwal <herwal20@gmail.com> 1727437984 +0200 parent 2a81314 author Herwal <herwal20@gmail.com> 1727281716 +0200 committer herwal <herwal20@gmail.com> 1727437815 +0200 parent 2a81314 author Herwal <herwal20@gmail.com> 1727281716 +0200 committer herwal <herwal20@gmail.com> 1727437186 +0200 skjuler private brukere fra andre serverless Style job ads Smaller text Remove image on smaller screen Fix package specifier Fix external link Update dependency eslint to v8.57.1 (#2258) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Update dependency postcss to v8.4.47 (#2259) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Update dependency tailwindcss to v3.4.12 (#2260) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Add dedicated api app (#2255) Display waitlist position (#2268) Only show spot when registration is open Simplify CI (#2269) Remove kaffe (#2270) Center div Fix external link Fix feedback form Update dependency @types/react to v18.3.8 (#2257) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Move docker compose file Refresh data Update dependency typescript to v5.6.2 (#2263) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Remove t3 env (#2272) Add date endpoint Remove date endpoint Update cache New backend, who dis? Add revalidation tags Add message Remove unused env Update fly.toml Made landingpage better by making happenings and posts smaller (#2275) Remove concurrency Nixengh/calendar (#2267) Co-authored-by: Ole Magnus Fon Johnsen <me@omfj.no>
1 parent 2a81314 commit 047e5cd

29 files changed

+951
-298
lines changed

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# --- General
2-
# The number of happenings to show on the front page
3-
#NUM_HAPPENINGS="4"
4-
51
# --- Webhooks
62
# The secret key for the webhooks
73
ADMIN_KEY="foobar"

apps/api/fly.toml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
app = "fly-echo-api"
22
primary_region = "arn"
3+
kill_signal = "SIGINT"
4+
kill_timeout = 5
5+
swap_size_mb = 512
36

4-
[build]
7+
[[services]]
8+
internal_port = 8000
9+
processes = [ "app" ]
10+
protocol = "tcp"
11+
auto_stop_machines = "stop"
12+
auto_start_machines = true
13+
min_machines_running = 1
14+
script_checks = [ ]
515

6-
[http_service]
7-
internal_port = 8000
16+
# [services.concurrency]
17+
# hard_limit = 120
18+
# soft_limit = 100
19+
# type = "requests"
20+
21+
[[services.ports]]
22+
handlers = [ "http" ]
23+
port = 80
824
force_https = true
9-
auto_stop_machines = "stop"
10-
auto_start_machines = true
11-
min_machines_running = 1
12-
processes = ["app"]
1325

14-
[[vm]]
15-
size = "shared-cpu-2x"
16-
memory = "1gb"
17-
cpus = 1
26+
[[services.ports]]
27+
handlers = [ "tls", "http" ]
28+
port = 443

apps/api/src/services/shopping-list.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Hono } from "hono";
22

3-
import { db } from "../lib/db";
3+
import { db } from "@echo-webkom/db/serverless";
4+
45
import { admin } from "../middleware/admin";
56

67
const app = new Hono();

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@radix-ui/react-separator": "1.1.0",
3333
"@radix-ui/react-slot": "1.1.0",
3434
"@radix-ui/react-switch": "1.1.0",
35+
"@radix-ui/react-tabs": "1.1.0",
3536
"@radix-ui/react-toast": "1.2.1",
3637
"@sanity/client": "6.21.3",
3738
"@sanity/image-url": "1.0.2",

apps/web/src/app/(default)/auth/user/[id]/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ export default async function ProfilePage({ params }: { params: { id: string } }
3838
}),
3939
]);
4040

41+
if (!profileOwner.isPublic && !isOwner) {
42+
return (
43+
<div className="max-w-2xl space-y-4">
44+
<Heading level={2}>{`${profileOwner.name?.split(" ")[0]} sin profil`}</Heading>
45+
<Text>Denne brukeren har privat profil.</Text>
46+
</div>
47+
);
48+
}
49+
4150
return (
4251
<div className="max-w-2xl space-y-4">
4352
<Heading level={2}>{`${profileOwner.name?.split(" ")[0]} sin profil`}</Heading>

apps/web/src/app/(default)/for-studenter/arrangementer/page.tsx

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
11
import { Suspense } from "react";
2-
import removeMarkdown from "remove-markdown";
32

4-
import { Calendar } from "@/components/calendar/happening-calendar";
3+
import { Calendar } from "@/components/calendar/calendar";
54
import { Container } from "@/components/container";
65
import {
76
EventFilter,
87
EventFilterSidebar,
98
FilterStatusAndOrderBar,
109
} from "@/components/event-filter";
1110
import { EventsView, type SearchParams } from "@/components/events-view";
12-
import { createHappeningLink } from "@/lib/create-link";
11+
import { happeningsToCalendarEvent, moviesToCalendarEvent } from "@/lib/calendar-event-helpers";
1312
import { fetchAllHappenings } from "@/sanity/happening";
1413
import { fetchMovies } from "@/sanity/movies";
1514

1615
export default async function Page({ searchParams }: { searchParams?: SearchParams }) {
17-
const [happenngs, movies] = await Promise.all([fetchAllHappenings(), fetchMovies()]);
16+
const [happenings, movies] = await Promise.all([fetchAllHappenings(), fetchMovies()]);
1817
if (!searchParams) searchParams = { type: "all" };
1918

2019
// Serialize searchParams to a JSON string as a key for the Suspense component.
2120
// Ensure a stable key by stringifying a sorted object if the order may vary.
2221
const searchParamsKey = JSON.stringify(searchParams, Object.keys(searchParams).sort());
2322

24-
const mappedHappenings = happenngs
25-
.filter((happening) => Boolean(happening.date))
26-
.map((happening) => ({
27-
id: happening._id,
28-
title: happening.title,
29-
date: new Date(happening.date),
30-
endDate: happening.endDate ? new Date(happening.endDate) : undefined,
31-
body: removeMarkdown(happening.body ?? ""),
32-
link: createHappeningLink(happening),
33-
}));
34-
35-
const mappedMovies = movies.map((movie) => ({
36-
id: movie._id,
37-
title: `Film: ${movie.title}`,
38-
date: new Date(movie.date),
39-
endDate: undefined,
40-
body: `Se ${movie.title} med filmklubben!`,
41-
link: movie.link ?? "#",
42-
}));
23+
const calendarEvents = happeningsToCalendarEvent(happenings).concat(
24+
moviesToCalendarEvent(movies),
25+
);
4326

4427
return (
45-
<Container className="space-y-4 py-10">
46-
<Calendar events={mappedHappenings.concat(mappedMovies)} />
28+
<Container layout="larger" className="space-y-4 py-10">
29+
<Calendar events={calendarEvents} type="multi" />
4730
<div className="pb-4 sm:mb-8 sm:border-b-2">
4831
<EventFilter />
4932
</div>

apps/web/src/app/(default)/hjem/_components/_lib/mappers.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

apps/web/src/app/(default)/hjem/_components/bento-box.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Link from "next/link";
2-
import { LuArrowRight as ArrowRight } from "react-icons/lu";
32

43
import { Heading } from "@/components/typography/heading";
54
import { cn } from "@/utils/cn";
@@ -13,21 +12,19 @@ type BentoBoxProps = {
1312

1413
export const BentoBox = ({ title, href, children, className }: BentoBoxProps) => {
1514
return (
16-
<section className={cn("flex flex-col gap-5 rounded-md border-2 p-5", className)}>
15+
<section className={cn("flex flex-col gap-2 rounded-md border-2 p-2", className)}>
1716
{href ? (
1817
<Link
1918
href={href}
20-
className="group mx-auto flex items-center underline-offset-4 hover:underline"
19+
className="group relative mx-auto flex items-center underline-offset-4 hover:underline"
2120
>
22-
<Heading className="text-center font-medium">{title}</Heading>
23-
24-
<ArrowRight className="ml-2 inline h-6 w-6 transition-transform group-hover:translate-x-2" />
21+
<Heading className="text-center text-2xl font-medium">{title}</Heading>
2522
</Link>
2623
) : (
27-
<Heading className="mx-auto text-center text-3xl font-medium">{title}</Heading>
24+
<Heading className="mx-auto text-center text-2xl font-medium">{title}</Heading>
2825
)}
2926

30-
<hr className="border-b-2" />
27+
<hr className="border-b" />
3128

3229
{children}
3330
</section>

apps/web/src/app/(default)/hjem/_components/coming-bedpres.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const ComingHappenings = async ({
2323

2424
return (
2525
<BentoBox title={title} href={href} className={className}>
26-
<ul className="grid grid-cols-1 gap-x-3 gap-y-5 py-4">
26+
<ul className="grid grid-cols-1 gap-x-3">
2727
{happenings.map((happening) => (
2828
<li key={happening._id}>
2929
<HappeningPreview happening={happening} />

apps/web/src/app/(default)/hjem/_components/calendar.tsx renamed to apps/web/src/app/(default)/hjem/_components/fp-calendar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Calendar as EventCalendar } from "@/components/calendar/happening-calendar";
1+
import { Calendar } from "@/components/calendar/calendar";
2+
import { happeningsToCalendarEvent, moviesToCalendarEvent } from "@/lib/calendar-event-helpers";
23
import { fetchAllHappenings } from "@/sanity/happening";
34
import { fetchMovies } from "@/sanity/movies";
4-
import { happeningsToCalendarEvent, moviesToCalendarEvent } from "./_lib/mappers";
55

6-
export const Calendar = async ({ className }: { className?: string }) => {
6+
export const FPCalendar = async ({ className }: { className?: string }) => {
77
const [happenings, movies] = await Promise.all([fetchAllHappenings(), fetchMovies()]);
88

99
const calendarEvents = happeningsToCalendarEvent(happenings).concat(
@@ -12,7 +12,7 @@ export const Calendar = async ({ className }: { className?: string }) => {
1212

1313
return (
1414
<div className={className}>
15-
<EventCalendar events={calendarEvents} />
15+
<Calendar events={calendarEvents} type="week" />
1616
</div>
1717
);
1818
};

0 commit comments

Comments
 (0)