Skip to content
Open
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
3 changes: 3 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export function App() {
}
return (
<>
<h1 class="text-4xl text-center m-4">
スプラトゥーン3 ランダムブキ編成ガチャ
</h1>
Comment on lines +57 to +59

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新しい<h1>要素の追加は、ユーザーインターフェースにタイトルを表示するための明確な目的を持っています。この変更は視覚的なアピールを高め、アプリケーションの目的をユーザーに直接伝える効果があります。ただし、<h1>タグに直接スタイルクラスを適用することは、スタイルの再利用性やメンテナンス性の観点から最適ではない場合があります。将来的にスタイルを変更する必要が生じた場合、CSSファイル内でこれらのスタイルを管理する方が、変更が容易になります。また、アクセシビリティの観点から、ページ内に複数の<h1>タグが存在しないことを確認することも重要です。ページの構造を明確にするために、適切な見出し階層を維持することが推奨されます。

<div class="flex m-6 justify-center">
<SelectBox
title="人数"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type ButtonProps = {
export const Button: FunctionComponent<ButtonProps> = ({ text, onClick }) => {
return (
<button
class="flex p-2 rounded-lg bg-blue-500 text-white"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

class属性はPreactでは使用されず、代わりにclassName属性を使用する必要があります。修正のために、classclassNameに変更します。

-      class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
+      className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"

onClick={onClick}
>
{text}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type CardProps = {
export const Card: FunctionComponent<CardProps> = ({ title, weaponList }) => {
return (
<div class="bg-white shadow-lg rounded-lg overflow-hidden">
<div class="bg-gray-200 text-gray-600 text-lg font-bold p-2">{title}</div>
<div class="bg-gray-200 text-gray-700 text-lg px-6 py-4">{title}</div>
<ul class="text-gray-600">
{weaponList.map((weapon, index) => (
<li key={index} class="border-b border-gray-200 p-2">
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const SelectBox: FunctionComponent<SelectBoxProps> = ({
{title}
</label>
<select
class="mt-1 block w-full rounded-md bg-gray-100 border-transparent focus:border-gray-500 focus:bg-white focus:ring-0"
class="w-32 bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

class属性の値には、PreactではなくReactのスタイルを使用する必要があります。Preactでは、代わりにclassNameを使用します。

-        class="w-32 bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline"
+        className="w-32 bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline"

id="select-box"
name="select-box"
onChange={(e) => onSelectChange(e)}
Expand Down