Skip to content

Commit

Permalink
role詳細画面への導線
Browse files Browse the repository at this point in the history
  • Loading branch information
aowheel committed Dec 26, 2024
1 parent d8f30c0 commit 09a2f60
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
15 changes: 8 additions & 7 deletions pkgs/frontend/app/components/BasicRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ export const RoleActions: FC<RoleActionsProps> = (params) => {

const navigate = useNavigate();

const navigateToDetail = () => navigate(`/${treeId}/${hatId}/${address}`);

const navigateToAssistCredit = () =>
navigate(`/${treeId}/${hatId}/${address}/assistcredit/send`);

return (
<HStack>
<Image rounded="4xl" width="1/3" src={imageUri} />
<VStack width="full">
<Text textStyle="xl">{detail?.data.name}</Text>
<BasicButton onClick={navigateToDetail}>See Detail</BasicButton>
<BasicButton onClick={navigateToAssistCredit}>
<BasicButton onClick={() => navigate(`/${treeId}/${hatId}/${address}`)}>
See Detail
</BasicButton>
<BasicButton
onClick={() =>
navigate(`/${treeId}/${hatId}/${address}/assistcredit/send`)
}
>
Transfer Assist Credit
</BasicButton>
</VStack>
Expand Down
18 changes: 9 additions & 9 deletions pkgs/frontend/app/routes/$treeId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const WorkspaceTop: FC = () => {
const topHatId = tree?.hats?.find((h) => h.levelAtLocalTree === 0)?.id;

const navigate = useNavigate();
const navigateToNewRole = () => navigate(`/workspaces/${topHatId}/roles/new`);

return (
<>
Expand Down Expand Up @@ -54,17 +53,18 @@ const WorkspaceTop: FC = () => {
{tree?.hats
?.filter((h) => Number(h.levelAtLocalTree) >= 2)
.map((h) => (
<HatsListItemParser
key={h.id}
imageUri={h.imageUri}
detailUri={h.details}
>
<VerticalRole />
</HatsListItemParser>
<Box key={h.id} onClick={() => navigate(`/${treeId}/${h.id}`)}>
<HatsListItemParser imageUri={h.imageUri} detailUri={h.details}>
<VerticalRole />
</HatsListItemParser>
</Box>
))}
<VStack>
<AspectRatio width="full" ratio={1}>
<CommonButton rounded="4xl" onClick={navigateToNewRole}>
<CommonButton
rounded="4xl"
onClick={() => navigate(`/workspaces/${topHatId}/roles/new`)}
>
<FaPlus />
</CommonButton>
</AspectRatio>
Expand Down

0 comments on commit 09a2f60

Please sign in to comment.