-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: intergation notification with backend & calendar tutorial
- Loading branch information
Showing
13 changed files
with
224 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use server"; | ||
|
||
import { auth, fetchToAdonis } from "@/lib/auth"; | ||
import type { UserSettingsPayload } from "@/types"; | ||
|
||
export const getCurrentUser = async () => { | ||
const user = await auth(); | ||
if (user == null) { | ||
throw new Error("Not logged in"); | ||
} | ||
return user; | ||
}; | ||
|
||
interface UpdateUserSettingsResponse { | ||
message: string; | ||
user: number; | ||
success: boolean; | ||
} | ||
|
||
export const updateUser = async (payload: UserSettingsPayload) => { | ||
const user = await auth(); | ||
if (user == null) { | ||
throw new Error("Not logged in"); | ||
} | ||
|
||
// Update user | ||
const data = await fetchToAdonis<UpdateUserSettingsResponse>({ | ||
url: "/user", | ||
method: "PATCH", | ||
body: JSON.stringify(payload), | ||
}); | ||
|
||
if (data === null) { | ||
throw new Error("Failed to update user"); | ||
} | ||
|
||
return { success: true }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import Image from "next/image"; | ||
import React from "react"; | ||
|
||
import { Separator } from "@/components/ui/separator"; | ||
|
||
import TutorialImage1 from "/public/assets/tutorial/tutorial-1.png"; | ||
import TutorialImage2 from "/public/assets/tutorial/tutorial-2.jpg"; | ||
import TutorialImage3 from "/public/assets/tutorial/tutorial-3.jpg"; | ||
import TutorialImage4 from "/public/assets/tutorial/tutorial-4.jpg"; | ||
|
||
export default function FAQCalendarPage() { | ||
return ( | ||
<div className="w-full space-y-6"> | ||
<div> | ||
<h3 className="text-lg font-medium">Jak dodać do kalendarza</h3> | ||
<p className="text-sm text-muted-foreground"> | ||
Tutaj znajdziesz krótki tutorial, jak dodać swój plan zajęć do swojego | ||
kalendarza Google | ||
</p> | ||
</div> | ||
<Separator /> | ||
<div className="space-y-3"> | ||
<Title title={"Pobierz plik .ics"} step={1} /> | ||
<p className=""> | ||
Kliknij przycisk "Dodaj do kalendarza (.ics)" | ||
</p> | ||
<Image | ||
src={TutorialImage1} | ||
alt="Tutorial 1" | ||
unoptimized | ||
className="w-full" | ||
/> | ||
</div> | ||
<div className="space-y-3"> | ||
<Title | ||
title={"Przejdź do kalendarza google i kliknij importuj"} | ||
step={2} | ||
/> | ||
<p className=""> | ||
Przejdź na stronę kalendarza Google i kliknij plus w dolnym lewym rogu | ||
> importuj | ||
</p> | ||
<Image | ||
src={TutorialImage2} | ||
alt="Tutorial 1" | ||
unoptimized | ||
className="w-full" | ||
/> | ||
<Image | ||
src={TutorialImage3} | ||
alt="Tutorial 1" | ||
unoptimized | ||
className="w-full" | ||
/> | ||
</div> | ||
<div className="space-y-3"> | ||
<Title title={"Wybierz pobrany plik"} step={3} /> | ||
<p className=""> | ||
Wybierz plik .ics, który pobrałeś wcześniej z naszej strony i kliknij | ||
importuj | ||
</p> | ||
<Image | ||
src={TutorialImage4} | ||
alt="Tutorial 1" | ||
unoptimized | ||
className="w-full" | ||
/> | ||
</div> | ||
<div className="space-y-3"> | ||
<Title title={"Ciesz się zaimportowanymi wydarzeniami"} step={4} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function Title({ title, step }: { title: string; step: number }) { | ||
return ( | ||
<div className="flex items-center gap-3"> | ||
<div className="flex size-10 items-center justify-center rounded-md bg-primary text-lg font-semibold text-white"> | ||
{step}. | ||
</div> | ||
<h1 className="text-lg font-semibold">{title}</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters