Skip to content

Commit

Permalink
Merge pull request #243 from h8570rg/develop
Browse files Browse the repository at this point in the history
Prd
  • Loading branch information
h8570rg authored Dec 28, 2024
2 parents 41fccf8 + 6f1ec0d commit c0e87ad
Show file tree
Hide file tree
Showing 89 changed files with 3,748 additions and 4,556 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
GOOGLE_CLIENT_ID: "dummy"
GOOGLE_SECRET: "dummy"
OPENAI_API_KEY: "dummy"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: supabase/setup-cli@v1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
Expand All @@ -19,7 +19,7 @@ jobs:
OPENAI_API_KEY: "dummy"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: supabase/setup-cli@v1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
Expand All @@ -19,7 +19,7 @@ jobs:
OPENAI_API_KEY: "dummy"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: supabase/setup-cli@v1

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"rockn",
"signup",
"svgr",
"toastify",
"tseslint",
"workos"
]
}
6 changes: 3 additions & 3 deletions app/(auth)/(routes)/login/(components)/LoginForm/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function signInEmail(

const { email, password } = validatedFields.data;

const supabase = createClient();
const supabase = await createClient();

const { error } = await supabase.auth.signInWithPassword({
email,
Expand All @@ -63,7 +63,7 @@ export async function signInEmail(
* @see https://supabase.com/docs/guides/auth/server-side/oauth-with-pkce-flow-for-ssr?queryGroups=environment&environment=server
*/
export async function signInWithGoogle() {
const supabase = createClient();
const supabase = await createClient();
const { data } = await supabase.auth.signInWithOAuth({
provider: "google",
options: {
Expand All @@ -77,7 +77,7 @@ export async function signInWithGoogle() {
}

export async function signInAnonymously() {
const supabase = createClient();
const supabase = await createClient();
await supabase.auth.signInAnonymously();

redirect("/matches");
Expand Down
4 changes: 2 additions & 2 deletions app/(auth)/(routes)/login/(components)/LoginForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useFormState } from "react-dom";
import { useActionState } from "react";
import { Button } from "@/components/Button";
import { Input } from "@/components/Input";
import { signInEmail } from "./actions";
Expand All @@ -9,7 +9,7 @@ import { signInEmail } from "./actions";
* @see https://supabase.com/docs/guides/auth/server-side/nextjs
*/
export function LoginForm({ className }: { className?: string }) {
const [state, formAction] = useFormState(signInEmail, {});
const [state, formAction] = useActionState(signInEmail, {});

return (
<form className={className} action={formAction} noValidate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export function SocialProviders({ className }: { className?: string }) {
);
return;
}
signInWithGoogle();
signInWithGoogle().catch((e) => {
throw e;
});
};

return (
Expand All @@ -25,7 +27,7 @@ export function SocialProviders({ className }: { className?: string }) {
fullWidth
className="flex items-center justify-center gap-3"
variant="bordered"
onClick={handleGoogleClick}
onPress={handleGoogleClick}
>
<GoogleIcon className="w-5" />
<span>Google でログイン</span>
Expand All @@ -35,7 +37,7 @@ export function SocialProviders({ className }: { className?: string }) {
<Button
fullWidth
variant="bordered"
onClick={() => alert("開発中です、しばらくお待ちください")}
onPress={() => alert("開発中です、しばらくお待ちください")}
>
<span>ログインせずに始める</span>
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function updateProfile(

const { name, displayId } = validatedFields.data;

const { updateUserProfile } = serverServices();
const { updateUserProfile } = await serverServices();

const result = await updateUserProfile({
name,
Expand All @@ -62,7 +62,7 @@ export async function updateProfile(
}

export async function signOut() {
const supabase = createClient();
const supabase = await createClient();

await supabase.auth.signOut();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import classNames from "classnames";
import { useFormState } from "react-dom";
import { useActionState } from "react";
import { Button } from "@/components/Button";
import { Input } from "@/components/Input";
import {
Expand All @@ -18,7 +18,7 @@ export function RegisterForm({
className?: string;
userId: string;
}) {
const [state, formAction] = useFormState(
const [state, formAction] = useActionState(
updateProfile.bind(null, userId),
{},
);
Expand Down
2 changes: 1 addition & 1 deletion app/(auth)/(routes)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const metadata: Metadata = {
};

export default async function RegisterPage() {
const { getUserProfile } = serverServices();
const { getUserProfile } = await serverServices();
const user = await getUserProfile();

if (user.name && user.displayId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function signUp(

const { email, password } = validatedFields.data;

const supabase = createClient();
const supabase = await createClient();

const { error } = await supabase.auth.signUp({
email,
Expand Down
4 changes: 2 additions & 2 deletions app/(auth)/(routes)/sign-up/(components)/SignUpForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import classNames from "classnames";
import { useFormState } from "react-dom";
import { useActionState } from "react";
import { Button } from "@/components/Button";
import { Input } from "@/components/Input";
import { signUp } from "./actions";
Expand All @@ -10,7 +10,7 @@ import { signUp } from "./actions";
* @see https://supabase.com/docs/guides/auth/server-side/nextjs
*/
export function SignUpForm({ className }: { className?: string }) {
const [state, formAction] = useFormState(signUp, {});
const [state, formAction] = useActionState(signUp, {});

return (
<form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { redirect } from "next/navigation";
import { createClient } from "@/lib/utils/supabase/server";

export async function signOut() {
const supabase = createClient();
const supabase = await createClient();

await supabase.auth.signOut();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useRouter } from "next/navigation";
import { DropdownMenu, DropdownItem } from "@/components/Dropdown";
import { signOut } from "./actions";

export function NavbarAvatarMenu({
export function AppbarAvatarMenu({
name,
displayId,
}: {
Expand All @@ -20,7 +20,9 @@ export function NavbarAvatarMenu({
router.push("/friends");
break;
case "signOut":
signOut();
signOut().catch((e) => {
throw e;
});
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { redirect } from "next/navigation";
import { Avatar } from "@/components/Avatar";
import { Dropdown, DropdownTrigger } from "@/components/Dropdown";
import { serverServices } from "@/lib/services/server";
import { NavbarAvatarMenu } from "./Menu";
import { AppbarAvatarMenu } from "./Menu";

export async function NavbarAvatar() {
const { getUserProfile } = serverServices();
export async function AppbarAvatar() {
const { getUserProfile } = await serverServices();
const [profile] = await Promise.all([getUserProfile()]);

// TODO: isUnregisteredで扱う。ts制御
Expand All @@ -18,7 +18,7 @@ export async function NavbarAvatar() {
<DropdownTrigger>
<Avatar as="button" className="transition-transform" size="sm" />
</DropdownTrigger>
<NavbarAvatarMenu name={profile.name} displayId={profile.displayId} />
<AppbarAvatarMenu name={profile.name} displayId={profile.displayId} />
</Dropdown>
);
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {
Navbar as NextUINavbar,
NavbarBrand,
NavbarContent,
} from "@nextui-org/react";
import { Suspense } from "react";
import { Link } from "@/components/Link";
import Logo from "@/components/Logo";
import { Navbar, NavbarBrand, NavbarContent } from "@/components/Navbar";
import { Skeleton } from "@/components/Skeleton";
import { NavbarAvatar } from "./Avatar";
import { AppbarAvatar } from "./Avatar";

export default function Navbar() {
export default function Appbar() {
return (
<NextUINavbar shouldHideOnScroll>
<Navbar shouldHideOnScroll>
<NavbarContent>
<NavbarBrand>
<Link color="foreground" href="/matches">
Expand All @@ -21,9 +17,9 @@ export default function Navbar() {
</NavbarContent>
<NavbarContent as="div" justify="end">
<Suspense fallback={<Skeleton className="size-8 rounded-full" />}>
<NavbarAvatar />
<AppbarAvatar />
</Suspense>
</NavbarContent>
</NextUINavbar>
</Navbar>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ function isVersionGreater(v1: string, v2: string) {
}

function setLastVersion() {
localStorage.setItem("lastVersion", packageJson.version);
if (typeof window !== "undefined") {
window.localStorage.setItem("lastVersion", packageJson.version);
}
}

function ReleaseNotesModal() {
const lastVersion = localStorage.getItem("lastVersion");
const lastVersion =
typeof window !== "undefined"
? window.localStorage.getItem("lastVersion")
: undefined;

const newVersions = Object.entries(versionComponents).filter(([v]) =>
lastVersion ? isVersionGreater(v, lastVersion) : v === "0.1.0",
Expand Down
11 changes: 11 additions & 0 deletions app/(main)/(components)/ReleaseNotes/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client";

import dynamic from "next/dynamic";

const ReleaseNotesModal = dynamic(() => import("./ReleaseNotesModal"), {
ssr: false,
});

export function ReleaseNotes() {
return <ReleaseNotesModal />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { redirect } from "next/navigation";
import { serverServices } from "@/lib/services/server";

export async function addFriends(profileId: string) {
const { addFriends } = serverServices();
const { addFriends } = await serverServices();

await addFriends({ profileId });

Expand Down
4 changes: 2 additions & 2 deletions app/(main)/(routes)/friends/(components)/AddButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function AddButton() {

return (
<>
<Button variant="light" isIconOnly onClick={addModal.onOpen}>
<Button variant="light" isIconOnly onPress={addModal.onOpen}>
<Icon name="personAdd" className="size-5 fill-current" />
</Button>
<Modal
Expand Down Expand Up @@ -101,7 +101,7 @@ export function AddButton() {
color="primary"
size="sm"
type="submit"
onClick={handleAdd}
onPress={handleAdd}
>
追加
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { revalidatePath } from "next/cache";
import { serverServices } from "@/lib/services/server";

export async function deleteFriends(profileId: string) {
const { deleteFriends } = serverServices();
const { deleteFriends } = await serverServices();

await deleteFriends({ profileId });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import { deleteFriends } from "./actions";
export function FriendMenu({ profileId }: { profileId: string }) {
function handleAction(key: unknown) {
if (key === "delete") {
deleteFriends(profileId);
deleteFriends(profileId).catch((e) => {
throw e;
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/(main)/(routes)/friends/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AddButton } from "./(components)/AddButton";
import { FriendMenu } from "./(components)/FriendMenu";

export default async function FriendsPage() {
const { getFriends } = serverServices();
const { getFriends } = await serverServices();

const friends = await getFriends();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function createMatch(

const { incline, customIncline, ...restData } = validatedFields.data;

const { createMatch } = serverServices();
const { createMatch } = await serverServices();

const { id } = await createMatch({
incline: incline === "custom" ? customIncline : incline,
Expand Down
Loading

0 comments on commit c0e87ad

Please sign in to comment.