Skip to content
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

feat: hero ui #305

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions .eslintrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const path = require("path");

// TODO: エラーで使えないのでpackage.jsonのpre-commitを変更している。
// see https://github.com/eslint/eslint/issues/19322

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"inbucket",
"jankiroku",
"nextjs",
"nextui",
"heroui",
"oidc",
"OPENAI",
"orioledb",
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ Supabase Studio URL: http://localhost:54323

## 用語一覧

| コード | 意味 |
| ---- | ---- |
| user | ログインしているユーザー |
| match | 成績表 |
| game | 半荘 |
| score | ポイント |
| points | 点数 |
| result | 収支 |
| コード | 意味 |
| ------ | ------------------------ |
| user | ログインしているユーザー |
| match | 成績表 |
| game | 半荘 |
| score | ポイント |
| points | 点数 |
| result | 収支 |
7 changes: 1 addition & 6 deletions app/(lp)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem,
} from "@nextui-org/react";
import { Navbar, NavbarBrand, NavbarContent, NavbarItem } from "@heroui/react";
import Image from "next/image";
import Link from "next/link";
import { Button } from "@/components/Button";
Expand Down
10 changes: 3 additions & 7 deletions app/(maintenance)/(routes)/maintenance/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
"use client";

import {
Navbar as NextUINavbar,
NavbarBrand,
NavbarContent,
} from "@nextui-org/react";
import { Navbar, NavbarBrand, NavbarContent } from "@heroui/react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
Expand All @@ -18,15 +14,15 @@ export default function MaintenancePage() {
const [isRefreshing, setIsRefreshing] = useState(false);
return (
<main className="relative flex min-h-screen flex-col">
<NextUINavbar position="static" className="absolute inset-x-0 top-0">
<Navbar position="static" className="absolute inset-x-0 top-0">
<NavbarContent>
<NavbarBrand>
<Link color="foreground" href="/">
<Logo className="text-large" />
</Link>
</NavbarBrand>
</NavbarContent>
</NextUINavbar>
</Navbar>
<div className="flex grow items-center justify-center px-4">
<div className="flex flex-col items-center gap-4">
<h1 className="text-center text-large">メンテナンス中</h1>
Expand Down
6 changes: 3 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IconDefs } from "@/components/Icon";
import { SERVICE_NAME } from "@/lib/config";
import { fontClassNames } from "./fonts";
import "./globals.css";
import { NextUIProvider } from "./nextUiProvider";
import { Providers } from "./providers";

export const metadata: Metadata = {
title: {
Expand Down Expand Up @@ -35,9 +35,9 @@ export default function RootLayout({
</head>
<body className="h-full font-rocknroll">
<IconDefs />
<NextUIProvider>
<Providers>
<div className="h-full bg-background text-foreground">{children}</div>
</NextUIProvider>
</Providers>
</body>
</html>
);
Expand Down
17 changes: 0 additions & 17 deletions app/nextUiProvider.tsx

This file was deleted.

17 changes: 17 additions & 0 deletions app/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client";

import { HeroUIProvider } from "@heroui/react";
import { ThemeProvider as NextThemesProvider } from "next-themes";

/**
* @see https://heroui.org/docs/frameworks/nextjs#tailwind-css-setup
*/
export function Providers({ children }: { children: React.ReactNode }) {
return (
<HeroUIProvider className="h-full">
<NextThemesProvider attribute="class" defaultTheme="system">
{children}
</NextThemesProvider>
</HeroUIProvider>
);
}
2 changes: 1 addition & 1 deletion components/Accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Accordion, AccordionItem } from "@nextui-org/react";
export { Accordion, AccordionItem } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Alert } from "@nextui-org/react";
export { Alert } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Avatar, AvatarGroup } from "@nextui-org/react";
export { Avatar, AvatarGroup } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Button, ButtonGroup, type ButtonProps } from "@nextui-org/react";
export { Button, ButtonGroup, type ButtonProps } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Card, CardHeader, CardBody, CardFooter } from "@nextui-org/react";
export { Card, CardHeader, CardBody, CardFooter } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Chip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Chip } from "@nextui-org/react";
export { Chip } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Divider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Divider } from "@nextui-org/react";
export { Divider } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export {
DropdownMenu,
DropdownSection,
DropdownItem,
} from "@nextui-org/react";
} from "@heroui/react";
4 changes: 2 additions & 2 deletions components/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Input as NextUiInput, InputProps } from "@nextui-org/react";
import { Input as HeroUiInput, InputProps } from "@heroui/react";
import classNames from "classnames";
import { forwardRef } from "react";

Expand All @@ -9,7 +9,7 @@ export const Input = forwardRef<
Omit<InputProps, "isInvalid">
>(function Input({ classNames: propsClassNames, ...props }, ref) {
return (
<NextUiInput
<HeroUiInput
classNames={{
...propsClassNames,
input: classNames("text-medium", propsClassNames?.input), // ios safariで拡大されるのを防ぐ
Expand Down
10 changes: 5 additions & 5 deletions components/Link/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use client";

import {
Link as NextUILink,
LinkProps as NextUILinkProps,
} from "@nextui-org/react";
Link as HeroUiLink,
LinkProps as HeroUiLinkProps,
} from "@heroui/react";
import NextLink, { LinkProps as NextLinkProps } from "next/link";
import { forwardRef } from "react";

export const Link = forwardRef<
HTMLAnchorElement,
NextLinkProps & NextUILinkProps
NextLinkProps & HeroUiLinkProps
>(function Link(props, ref) {
return <NextUILink as={NextLink} ref={ref} {...props} />;
return <HeroUiLink as={NextLink} ref={ref} {...props} />;
});
2 changes: 1 addition & 1 deletion components/Listbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Listbox, ListboxItem, ListboxSection } from "@nextui-org/react";
export { Listbox, ListboxItem, ListboxSection } from "@heroui/react";
6 changes: 3 additions & 3 deletions components/Modal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use client";

import { useDisclosure } from "@nextui-org/react";
import { useDisclosure } from "@heroui/react";

export type { ModalProps } from "@nextui-org/react";
export type { ModalProps } from "@heroui/react";
export {
Modal,
ModalContent,
ModalHeader,
ModalBody,
ModalFooter,
} from "@nextui-org/react";
} from "@heroui/react";

export type UseModalReturn = {
isOpen: boolean;
Expand Down
2 changes: 1 addition & 1 deletion components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Navbar, NavbarBrand, NavbarContent } from "@nextui-org/react";
export { Navbar, NavbarBrand, NavbarContent } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Popover/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Popover, PopoverTrigger, PopoverContent } from "@nextui-org/react";
export { Popover, PopoverTrigger, PopoverContent } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Progress/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Progress } from "@nextui-org/react";
export { Progress } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/ScrollShadow/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { ScrollShadow } from "@nextui-org/react";
export { ScrollShadow } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Select/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Select, SelectItem } from "@nextui-org/react";
export { Select, SelectItem } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Skeleton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Skeleton } from "@nextui-org/react";
export { Skeleton } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Slider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Slider } from "@nextui-org/react";
export { Slider } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Tabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Tab, Tabs } from "@nextui-org/react";
export { Tab, Tabs } from "@heroui/react";
2 changes: 1 addition & 1 deletion components/Tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";

export { Tooltip } from "@nextui-org/react";
export { Tooltip } from "@heroui/react";
4 changes: 2 additions & 2 deletions components/User/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { User as NextUiUser, UserProps } from "@nextui-org/react";
import { User as HeroUiUser, UserProps } from "@heroui/react";
import { Skeleton } from "@/components/Skeleton";

export function User({
Expand All @@ -26,7 +26,7 @@ export function User({
);
}
return (
<NextUiUser
<HeroUiUser
name={name}
description={displayId && `@${displayId}`}
avatarProps={{
Expand Down
16 changes: 2 additions & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import tailwind from "eslint-plugin-tailwindcss";
import eslintConfigPrettier from "eslint-config-prettier";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
baseDirectory: import.meta.dirname,
});
// [...compat.extends(
// "eslint:recommended",
// "plugin:@typescript-eslint/recommended",
// "next/core-web-vitals",
// "plugin:tailwindcss/recommended",
// "prettier",
// ),

export default tseslint.config(
{
ignores: ["lib/database.types.ts"],
Expand Down
Loading