Skip to content
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
5 changes: 0 additions & 5 deletions src/components/Button/LoginBtn/LoginBtn.tsx

This file was deleted.

Empty file.
3 changes: 1 addition & 2 deletions src/components/Header/Header.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { render, screen, fireEvent } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import { BrowserRouter } from 'react-router-dom'
import { describe, it, expect } from 'vitest'
import Header from './Header'
import styles from './style.module.css'

// テスト用のWrapper
const Wrapper = ({ children }: { children: React.ReactNode }) => (
Expand Down
1 change: 0 additions & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styles from './style.module.css'
import hamburgerIcon from '../../assets/hamburger.svg'
import iconImg from '../../assets/icon.jpg'
import { useState } from 'react'
import { Link, useLocation } from 'react-router-dom'

type Type = {
Expand Down
10 changes: 9 additions & 1 deletion src/components/Header/Heder.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ const meta = {
export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {}
export const Default: Story = {
args: {
void: () => {
// ダミーの関数。クリック時などに呼ばれる想定
console.log('clicked')
},
state: false, // 初期状態
},
}
6 changes: 3 additions & 3 deletions src/components/Problem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { OptionsVO } from '@/models/entity/Options'
import { ProblemVO } from '@/models/entity/Problem'
import { TagsVO } from '@/models/entity/Tags'
import styles from './styles.module.css'
import Genre from '../Genre/Genre'
import { Button } from '@/stories/Button'
import { useState } from 'react'
import { ProblemVO } from '@/models/entity/client/Problem'
import { TagsVO } from '@/models/entity/client/Tags'
import { OptionsVO } from '@/models/entity/client/Options'

type Type = {
Problem: ProblemVO.Type
Expand Down
10 changes: 0 additions & 10 deletions src/models/entity/converter/fmt/CreateProblemFmt0001.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/CreateProblem/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default function CreateProblemDetail() {
type="text"
id="zipText"
placeholder="ファイルの名前"
onChange={(e) => {
onChange={() => {
/* 初期zip取得のAPIを叩くアクションを指定 */
// Action.editForm(dispatch, 'newCreate.problem.title', e.target.value)
}}
Expand Down
2 changes: 0 additions & 2 deletions src/stories/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

import './button.css'

export interface ButtonProps {
Expand Down
120 changes: 61 additions & 59 deletions src/stories/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,71 +1,73 @@
import React from 'react'

import { Button } from './Button'
import './header.css'

type User = {
name: string
name: string
}

export interface HeaderProps {
user?: User
onLogin?: () => void
onLogout?: () => void
onCreateAccount?: () => void
user?: User
onLogin?: () => void
onLogout?: () => void
onCreateAccount?: () => void
}

export const Header = ({
user,
onLogin,
onLogout,
onCreateAccount,
user,
onLogin,
onLogout,
onCreateAccount,
}: HeaderProps) => (
<header>
<div className="storybook-header">
<div>
<svg
width="32"
height="32"
viewBox="0 0 32 32"
xmlns="http://www.w3.org/2000/svg"
>
<g fill="none" fillRule="evenodd">
<path
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
fill="#FFF"
/>
<path
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
fill="#555AB9"
/>
<path
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
fill="#91BAF8"
/>
</g>
</svg>
<h1>Acme</h1>
</div>
<div>
{user ? (
<>
<span className="welcome">
Welcome, <b>{user.name}</b>!
</span>
<Button size="small" onClick={onLogout} label="Log out" />
</>
) : (
<>
<Button size="small" onClick={onLogin} label="Log in" />
<Button
primary
size="small"
onClick={onCreateAccount}
label="Sign up"
/>
</>
)}
</div>
</div>
</header>
<header>
<div className="storybook-header">
<div>
<svg
width="32"
height="32"
viewBox="0 0 32 32"
xmlns="http://www.w3.org/2000/svg"
>
<g fill="none" fillRule="evenodd">
<path
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
fill="#FFF"
/>
<path
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
fill="#555AB9"
/>
<path
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
fill="#91BAF8"
/>
</g>
</svg>
<h1>Acme</h1>
</div>
<div>
{user ? (
<>
<span className="welcome">
Welcome, <b>{user.name}</b>!
</span>
<Button
size="small"
onClick={onLogout}
label="Log out"
/>
</>
) : (
<>
<Button size="small" onClick={onLogin} label="Log in" />
<Button
primary
size="small"
onClick={onCreateAccount}
label="Sign up"
/>
</>
)}
</div>
</div>
</header>
)
Loading