Skip to content

Commit 8b9d4e3

Browse files
committed
끝이 아닐까
1 parent f89a3cd commit 8b9d4e3

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
lines changed

src/components/CreatePost.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export const CreatePost = () => {
128128
<form onSubmit={handleSubmit(onClickAddKakomonPost)}>
129129
<FormControl isInvalid={Boolean(errors.title)}>
130130
<FormLabel htmlFor="title" fontWeight="bold">
131-
<Badge colorScheme='red' mr="3px">必須</Badge>
131+
<Badge colorScheme="red" mr="3px">
132+
必須
133+
</Badge>
132134
タイトル
133135
</FormLabel>
134136
<Input
@@ -144,7 +146,9 @@ export const CreatePost = () => {
144146
</FormControl>
145147
<FormControl isInvalid={Boolean(errors.name)}>
146148
<FormLabel htmlFor="name" fontWeight="bold" mt="15px">
147-
<Badge colorScheme='red' mr="3px">必須</Badge>
149+
<Badge colorScheme="red" mr="3px">
150+
必須
151+
</Badge>
148152
カカオID又はニックネーム
149153
</FormLabel>
150154
<Input
@@ -160,7 +164,9 @@ export const CreatePost = () => {
160164
</FormControl>
161165
<FormControl isInvalid={Boolean(errors.description)}>
162166
<FormLabel htmlFor="description" fontWeight="bold" mt="15px">
163-
<Badge colorScheme='red' mr="3px">必須</Badge>
167+
<Badge colorScheme="red" mr="3px">
168+
必須
169+
</Badge>
164170
過去問詳細
165171
</FormLabel>
166172
<Textarea
@@ -341,7 +347,7 @@ export const CreatePost = () => {
341347
{kakomonPost.description}
342348
</Td>
343349
<Td>
344-
<Button
350+
<Button
345351
bgColor="gray.500"
346352
color="white"
347353
border="2px"
@@ -359,6 +365,7 @@ export const CreatePost = () => {
359365
style={{ marginLeft: "8px" }}
360366
/>
361367
</Button>
368+
362369
</Td>
363370
</Tr>
364371
))}

src/components/SignIn.tsx

+13-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@ import { FcGoogle } from "react-icons/fc";
2121
import { FaGithub } from "react-icons/fa";
2222
import { FaDoorOpen } from "react-icons/fa6";
2323
import { useNavigate } from "react-router-dom";
24+
import { useEffect } from "react";
25+
26+
27+
const preloadImage = (url: string) => {
28+
const img = new Image();
29+
img.src = url;
30+
};
2431

2532
export const SignIn = () => {
2633
const { auth } = firebaseServices;
2734
const navigate = useNavigate();
35+
2836
const signInWithGoogle = (): Promise<UserCredential> => {
2937
const provider = new GoogleAuthProvider();
3038
return signInWithPopup(auth, provider).then((result) => {
@@ -33,7 +41,6 @@ export const SignIn = () => {
3341
return result;
3442
});
3543
};
36-
3744
const signInWithGithub = (): Promise<UserCredential> => {
3845
const provider = new GithubAuthProvider();
3946
return signInWithPopup(auth, provider).then((result) => {
@@ -42,10 +49,14 @@ export const SignIn = () => {
4249
return result;
4350
});
4451
};
52+
53+
useEffect(() => {
54+
preloadImage("https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3279945/533e08f0-f2da-d547-bfcc-276c3123c0ec.jpeg");
55+
}, []);
56+
4557
return (
4658
<>
4759
<Center h="100vh" position="relative" overflow="hidden">
48-
{/* 別のやり方で画像表示できる気がする(chakraの公式docみる) */}
4960
<Box
5061
position="absolute"
5162
top="0"

src/components/layout/MainLayout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const SidebarContent = ({
128128
alignItems="center"
129129
justifyContent="space-between"
130130
bgColor="blue.300"
131-
bgGradient="linear(to-r, blackAlpha.700, blue.600, cyan.500)"
131+
bgGradient="linear(to-r, blackAlpha.700, blue.400)"
132132
>
133133
<Text
134134
fontSize="2xl"
@@ -175,7 +175,7 @@ const SidebarContent = ({
175175
<AlertDialogOverlay>
176176
<AlertDialogContent>
177177
<AlertDialogHeader fontSize="lg" fontWeight="bold">
178-
サインアウトページ
178+
サインアウト確認
179179
</AlertDialogHeader>
180180

181181
<AlertDialogBody>本当にサインアウトしますか?</AlertDialogBody>

src/lib/supabasefunctions.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,17 @@ export const getUserInfo = async (userId:number) => {
5858
// ユーザー情報を追加する関数
5959
export const addUser = async (name: string, subjectName: number, kakaoId: string, description: string) => {
6060
const { data, error } = await supabase
61-
.from("user")
62-
.insert({ name, kakao_id: kakaoId, description, subject_id: subjectName })
63-
.select('id')
64-
.single();
61+
.from("user")
62+
.insert({ name, kakao_id: kakaoId, description, subject_id: subjectName })
63+
.select('id')
64+
.single();
6565
if (error) {
66-
console.error('Error adding user:', error);
67-
throw error; // 必要に応じてエラーを再スロー
66+
console.error('Error adding user:', error);
67+
throw error;
6868
}
69-
70-
// 追加したユーザーの id を返す
7169
return data.id;
72-
};
73-
70+
};
71+
7472

7573
// 科目とユーザーの中間テーブルにデータを追加する関数
7674
export const addUserToSubject = async (subjectId:number,userId: number) => {

0 commit comments

Comments
 (0)