-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Fix code formatting issues and add translation language select component" #25
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,80 +1,80 @@ | ||
import type { Config } from "tailwindcss" | ||
import type { Config } from "tailwindcss"; | ||
|
||
const config = { | ||
darkMode: ["class"], | ||
content: [ | ||
'./pages/**/*.{ts,tsx}', | ||
'./components/**/*.{ts,tsx}', | ||
'./app/**/*.{ts,tsx}', | ||
'./src/**/*.{ts,tsx}', | ||
darkMode: ["class"], | ||
content: [ | ||
"./pages/**/*.{ts,tsx}", | ||
"./components/**/*.{ts,tsx}", | ||
"./app/**/*.{ts,tsx}", | ||
"./src/**/*.{ts,tsx}", | ||
], | ||
prefix: "", | ||
theme: { | ||
container: { | ||
center: true, | ||
padding: "2rem", | ||
screens: { | ||
"2xl": "1400px", | ||
}, | ||
}, | ||
extend: { | ||
colors: { | ||
border: "hsl(var(--border))", | ||
input: "hsl(var(--input))", | ||
ring: "hsl(var(--ring))", | ||
background: "hsl(var(--background))", | ||
foreground: "hsl(var(--foreground))", | ||
primary: { | ||
DEFAULT: "hsl(var(--primary))", | ||
foreground: "hsl(var(--primary-foreground))", | ||
}, | ||
secondary: { | ||
DEFAULT: "hsl(var(--secondary))", | ||
foreground: "hsl(var(--secondary-foreground))", | ||
}, | ||
destructive: { | ||
DEFAULT: "hsl(var(--destructive))", | ||
foreground: "hsl(var(--destructive-foreground))", | ||
}, | ||
muted: { | ||
DEFAULT: "hsl(var(--muted))", | ||
foreground: "hsl(var(--muted-foreground))", | ||
}, | ||
accent: { | ||
DEFAULT: "hsl(var(--accent))", | ||
foreground: "hsl(var(--accent-foreground))", | ||
}, | ||
popover: { | ||
DEFAULT: "hsl(var(--popover))", | ||
foreground: "hsl(var(--popover-foreground))", | ||
}, | ||
card: { | ||
DEFAULT: "hsl(var(--card))", | ||
foreground: "hsl(var(--card-foreground))", | ||
}, | ||
}, | ||
borderRadius: { | ||
lg: "var(--radius)", | ||
md: "calc(var(--radius) - 2px)", | ||
sm: "calc(var(--radius) - 4px)", | ||
}, | ||
keyframes: { | ||
"accordion-down": { | ||
from: { height: "0" }, | ||
to: { height: "var(--radix-accordion-content-height)" }, | ||
}, | ||
"accordion-up": { | ||
from: { height: "var(--radix-accordion-content-height)" }, | ||
to: { height: "0" }, | ||
}, | ||
}, | ||
animation: { | ||
"accordion-down": "accordion-down 0.2s ease-out", | ||
"accordion-up": "accordion-up 0.2s ease-out", | ||
}, | ||
}, | ||
}, | ||
plugins: [require("tailwindcss-animate")], | ||
} satisfies Config | ||
prefix: "", | ||
theme: { | ||
container: { | ||
center: true, | ||
padding: "2rem", | ||
screens: { | ||
"2xl": "1400px", | ||
}, | ||
}, | ||
extend: { | ||
colors: { | ||
border: "hsl(var(--border))", | ||
input: "hsl(var(--input))", | ||
ring: "hsl(var(--ring))", | ||
background: "hsl(var(--background))", | ||
foreground: "hsl(var(--foreground))", | ||
primary: { | ||
DEFAULT: "hsl(var(--primary))", | ||
foreground: "hsl(var(--primary-foreground))", | ||
}, | ||
secondary: { | ||
DEFAULT: "hsl(var(--secondary))", | ||
foreground: "hsl(var(--secondary-foreground))", | ||
}, | ||
destructive: { | ||
DEFAULT: "hsl(var(--destructive))", | ||
foreground: "hsl(var(--destructive-foreground))", | ||
}, | ||
muted: { | ||
DEFAULT: "hsl(var(--muted))", | ||
foreground: "hsl(var(--muted-foreground))", | ||
}, | ||
accent: { | ||
DEFAULT: "hsl(var(--accent))", | ||
foreground: "hsl(var(--accent-foreground))", | ||
}, | ||
popover: { | ||
DEFAULT: "hsl(var(--popover))", | ||
foreground: "hsl(var(--popover-foreground))", | ||
}, | ||
card: { | ||
DEFAULT: "hsl(var(--card))", | ||
foreground: "hsl(var(--card-foreground))", | ||
}, | ||
}, | ||
borderRadius: { | ||
lg: "var(--radius)", | ||
md: "calc(var(--radius) - 2px)", | ||
sm: "calc(var(--radius) - 4px)", | ||
}, | ||
keyframes: { | ||
"accordion-down": { | ||
from: { height: "0" }, | ||
to: { height: "var(--radix-accordion-content-height)" }, | ||
}, | ||
"accordion-up": { | ||
from: { height: "var(--radix-accordion-content-height)" }, | ||
to: { height: "0" }, | ||
}, | ||
}, | ||
animation: { | ||
"accordion-down": "accordion-down 0.2s ease-out", | ||
"accordion-up": "accordion-up 0.2s ease-out", | ||
}, | ||
}, | ||
}, | ||
plugins: [require("tailwindcss-animate")], | ||
} satisfies Config; | ||
|
||
export default config | ||
export default config; |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { Form } from '@remix-run/react' | ||
import { FaGoogle } from 'react-icons/fa' | ||
import { Button } from "~/components/ui/button" | ||
import { Form } from "@remix-run/react"; | ||
import { FaGoogle } from "react-icons/fa"; | ||
import { Button } from "~/components/ui/button"; | ||
|
||
export const GoogleForm = () => { | ||
return ( | ||
<Form method="POST" className="w-full"> | ||
<Button | ||
type="submit" | ||
name="_action" | ||
value="SignInWithGoogle" | ||
variant="outline" | ||
className="w-full" | ||
> | ||
<FaGoogle className="mr-2 h-4 w-4" /> | ||
Sign In with Google | ||
</Button> | ||
</Form> | ||
) | ||
} | ||
return ( | ||
<Form method="POST" className="w-full"> | ||
<Button | ||
type="submit" | ||
name="_action" | ||
value="SignInWithGoogle" | ||
variant="outline" | ||
className="w-full" | ||
> | ||
<FaGoogle className="mr-2 h-4 w-4" /> | ||
Sign In with Google | ||
</Button> | ||
</Form> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,38 +1,46 @@ | ||
import { Link } from '@remix-run/react' | ||
import { useLoaderData } from '@remix-run/react' | ||
import type { User } from '@prisma/client' | ||
import type { User } from "@prisma/client"; | ||
import { Link } from "@remix-run/react"; | ||
|
||
interface LoaderData { | ||
user: User | null | ||
} | ||
type UserWithoutPassword = Omit<User, "password">; | ||
|
||
export function Header() { | ||
const { user } = useLoaderData<LoaderData>() | ||
interface HeaderProps { | ||
user: UserWithoutPassword | null; | ||
} | ||
|
||
return ( | ||
<header className="bg-white shadow-sm"> | ||
<div className="max-w-7xl mx-auto py-4 px-4 sm:px-6 lg:px-8 flex justify-between items-center"> | ||
<h1 className="text-3xl font-bold text-gray-900">EveEve</h1> | ||
<nav> | ||
{user ? ( | ||
<div className="flex items-center space-x-4"> | ||
<span className="text-gray-700">ようこそ、{user.name}さん!</span> | ||
<Link to="/auth/logout" className="text-blue-600 hover:text-blue-800 font-medium"> | ||
ログアウト | ||
</Link> | ||
</div> | ||
) : ( | ||
<div className="space-x-4"> | ||
<Link to="/auth/login" className="text-blue-600 hover:text-blue-800 font-medium"> | ||
ログイン | ||
</Link> | ||
<Link to="/auth/signup" className="text-blue-600 hover:text-blue-800 font-medium"> | ||
サインアップ | ||
</Link> | ||
</div> | ||
)} | ||
</nav> | ||
</div> | ||
</header> | ||
) | ||
} | ||
export function Header({ user }: HeaderProps) { | ||
return ( | ||
<header className="bg-white shadow-sm"> | ||
<div className="max-w-7xl mx-auto py-4 px-4 sm:px-6 lg:px-8 flex justify-between items-center"> | ||
<h1 className="text-3xl font-bold text-gray-900">EveEve</h1> | ||
<nav> | ||
{user ? ( | ||
<div className="flex items-center space-x-4"> | ||
<span className="text-gray-700">ようこそ、{user.name}さん!</span> | ||
<Link | ||
to="/auth/logout" | ||
className="text-blue-600 hover:text-blue-800 font-medium" | ||
> | ||
ログアウト | ||
</Link> | ||
</div> | ||
) : ( | ||
<div className="space-x-4"> | ||
<Link | ||
to="/auth/login" | ||
className="text-blue-600 hover:text-blue-800 font-medium" | ||
> | ||
ログイン | ||
</Link> | ||
<Link | ||
to="/auth/signup" | ||
className="text-blue-600 hover:text-blue-800 font-medium" | ||
> | ||
サインアップ | ||
</Link> | ||
</div> | ||
)} | ||
</nav> | ||
</div> | ||
</header> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,59 +1,59 @@ | ||
import * as React from "react" | ||
import { cva, type VariantProps } from "class-variance-authority" | ||
import { type VariantProps, cva } from "class-variance-authority"; | ||
import * as React from "react"; | ||
|
||
import { cn } from "~/utils" | ||
import { cn } from "~/utils"; | ||
|
||
const alertVariants = cva( | ||
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", | ||
{ | ||
variants: { | ||
variant: { | ||
default: "bg-background text-foreground", | ||
destructive: | ||
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
}, | ||
} | ||
) | ||
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", | ||
{ | ||
variants: { | ||
variant: { | ||
default: "bg-background text-foreground", | ||
destructive: | ||
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
}, | ||
}, | ||
); | ||
|
||
const Alert = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants> | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants> | ||
>(({ className, variant, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
role="alert" | ||
className={cn(alertVariants({ variant }), className)} | ||
{...props} | ||
/> | ||
)) | ||
Alert.displayName = "Alert" | ||
<div | ||
ref={ref} | ||
role="alert" | ||
className={cn(alertVariants({ variant }), className)} | ||
{...props} | ||
/> | ||
)); | ||
Alert.displayName = "Alert"; | ||
|
||
const AlertTitle = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLHeadingElement> | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLHeadingElement> | ||
>(({ className, ...props }, ref) => ( | ||
<h5 | ||
ref={ref} | ||
className={cn("mb-1 font-medium leading-none tracking-tight", className)} | ||
{...props} | ||
/> | ||
)) | ||
AlertTitle.displayName = "AlertTitle" | ||
<h5 | ||
ref={ref} | ||
className={cn("mb-1 font-medium leading-none tracking-tight", className)} | ||
{...props} | ||
/> | ||
)); | ||
AlertTitle.displayName = "AlertTitle"; | ||
|
||
const AlertDescription = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLParagraphElement> | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLParagraphElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("text-sm [&_p]:leading-relaxed", className)} | ||
{...props} | ||
/> | ||
)) | ||
AlertDescription.displayName = "AlertDescription" | ||
<div | ||
ref={ref} | ||
className={cn("text-sm [&_p]:leading-relaxed", className)} | ||
{...props} | ||
/> | ||
)); | ||
AlertDescription.displayName = "AlertDescription"; | ||
|
||
export { Alert, AlertTitle, AlertDescription } | ||
export { Alert, AlertTitle, AlertDescription }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeRabbit
エラーメッセージの設定が適切に行われていない可能性があります。
catch
ブロック内でerror
オブジェクトが必ずしもmessage
プロパティを持つとは限らないため、エラーハンドリングを改善する必要があります。