-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Frontend] Owner 画面(椅子一覧、売上)、Client 画面モーダルに値段表示 #244
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9d08873
Implement PriceText component
yamacent a0ee5e5
Implement List component
yamacent 95ba7b7
Merge branch 'main' into frontend/adjust-style
yamacent d16d913
運賃表示
yamacent 3a87b4c
Merge branch 'main' into frontend/adjust-style
yamacent 994464f
Merge branch 'main' into frontend/adjust-style
yamacent 49483b1
フォーマットの外部インスタンス化
kazuhiro1982 8bc2912
wip
yamacent 2b5099c
Salesページ実装
yamacent abef842
データが多い場合のスクロールを調整
yamacent c1463b6
Owner header
yamacent 704365f
椅子一覧ページ
yamacent b6a6d58
refactoring
yamacent 627d788
modalに運賃を表示
yamacent c2c7941
Introduce ListItem
yamacent 2cb9c85
fix lint
yamacent 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ComponentProps, PropsWithChildren } from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
export function ListItem({ | ||
children, | ||
className, | ||
...props | ||
}: PropsWithChildren<ComponentProps<"li">>) { | ||
return ( | ||
<li {...props} className={twMerge("px-4 py-3 border-b", className)}> | ||
{children} | ||
</li> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ComponentProps, PropsWithChildren } from "react"; | ||
|
||
export function List({ | ||
children, | ||
className, | ||
...props | ||
}: PropsWithChildren<ComponentProps<"ul">>) { | ||
return ( | ||
<ul {...props} className={className}> | ||
{children} | ||
</ul> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
frontend/app/components/modules/owner-header/owner-header.tsx
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { FC } from "react"; | ||
import { useClientProviderContext } from "~/contexts/provider-context"; | ||
|
||
export const OwnerHeader: FC = () => { | ||
const { provider } = useClientProviderContext(); | ||
|
||
return ( | ||
<div className="flex items-center my-8 px-6"> | ||
{/* TODO: UI */} | ||
<div className="border rounded-full size-16"></div> | ||
<span className="text-2xl ms-4">{provider?.name}</span> | ||
</div> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ComponentPropsWithoutRef, FC } from "react"; | ||
import { Text } from "~/components/primitives/text/text"; | ||
|
||
type PriceTextProps = Omit< | ||
ComponentPropsWithoutRef<typeof Text>, | ||
"children" | ||
> & { | ||
value: number; | ||
}; | ||
|
||
const formatter = new Intl.NumberFormat("ja-JP"); | ||
|
||
export const PriceText: FC<PriceTextProps> = ({ value, ...rest }) => { | ||
return <Text {...rest}>{formatter.format(value)} 円</Text>; | ||
}; | ||
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { PropsWithChildren } from "react"; | ||
|
||
export const Badge = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<span className="border rounded-md border-gray-300 text-sm px-2 py-1"> | ||
{children} | ||
</span> | ||
); | ||
}; |
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
21 changes: 21 additions & 0 deletions
21
frontend/app/components/primitives/chair-model/chair-model.tsx
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { FC } from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
import { CarGreenIcon } from "~/components/icon/car-green"; | ||
import { CarRedIcon } from "~/components/icon/car-red"; | ||
import { CarYellowIcon } from "~/components/icon/car-yellow"; | ||
|
||
<CarRedIcon className="size-[76px] mb-4" />; | ||
|
||
export const ChairModel: FC<{ model: string; className?: string }> = ( | ||
props, | ||
) => { | ||
const Chair = (() => { | ||
// TODO: 仮実装 | ||
const model = props.model; | ||
if (/^[a-n]/i.test(model)) return CarGreenIcon; | ||
if (/^[o-z]/i.test(model)) return CarYellowIcon; | ||
return CarRedIcon; | ||
})(); | ||
|
||
return <Chair className={twMerge(["size-[1.5rem]", props.className])} />; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { FC, PropsWithoutRef } from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
type DateInputProps = PropsWithoutRef<{ | ||
id: string; | ||
name: string; | ||
className?: string; | ||
required?: boolean; | ||
onChange?: React.ChangeEventHandler<HTMLInputElement>; | ||
}>; | ||
|
||
export const DateInput: FC<DateInputProps> = (props) => { | ||
return ( | ||
<input | ||
type="date" | ||
id={props.id} | ||
name={props.name} | ||
className={twMerge( | ||
"mt-1 p-2 w-full border border-neutral-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500", | ||
props?.className, | ||
)} | ||
required={props.required} | ||
onChange={props.onChange} | ||
></input> | ||
); | ||
}; |
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
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
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
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
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
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.
こちら、よき感じで cherry-pick いただけるとありがたいです 🙏
058882b