Skip to content

Commit

Permalink
chore: replace Action components with Action.Push
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdadev13 committed Oct 11, 2024
1 parent de213aa commit 2bac74f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
9 changes: 3 additions & 6 deletions extensions/twenty/src/list-companies.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from "react";
import { List, Image, Icon, ActionPanel, Action, Toast, showToast, useNavigation } from "@raycast/api";
import { List, Image, Icon, ActionPanel, Action, Toast, showToast } from "@raycast/api";
import { useGetCompanies } from "./hooks/use-company";
import CreatePersonForm from "./create-people";
import CreateCompanyForm from "./create-company";

export default function ListCompanies() {
const { push } = useNavigation();
const { companies, isLoading, error } = useGetCompanies();

React.useEffect(() => {
Expand Down Expand Up @@ -56,13 +55,11 @@ export default function ListCompanies() {
shortcut={{ modifiers: ["cmd"], key: "o" }}
target={<CreateCompanyForm />}
/>
<Action
<Action.Push
icon={Icon.AddPerson}
title="Add People"
shortcut={{ modifiers: ["cmd"], key: "p" }}
onAction={() => {
push(<CreatePersonForm />);
}}
target={<CreatePersonForm />}
/>
</ActionPanel>
}
Expand Down
15 changes: 5 additions & 10 deletions extensions/twenty/src/list-people.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { List, Image, Icon, ActionPanel, Action, useNavigation } from "@raycast/api";
import { List, Image, Icon, ActionPanel, Action } from "@raycast/api";
import { useGetPeople } from "./hooks/use-people";
import CreatePersonForm from "./create-people";
import CreateCompanyForm from "./create-company";

export default function ListPeople() {
const { push } = useNavigation();
const { people } = useGetPeople();

return (
Expand All @@ -21,21 +20,17 @@ export default function ListPeople() {
content={person.name.firstName}
shortcut={{ modifiers: ["cmd"], key: "c" }}
/>
<Action
<Action.Push
icon={Icon.AddPerson}
title="Add People"
shortcut={{ modifiers: ["cmd"], key: "p" }}
onAction={() => {
push(<CreatePersonForm />);
}}
target={<CreatePersonForm />}
/>
<Action
<Action.Push
icon={Icon.Building}
title="Add Company"
shortcut={{ modifiers: ["cmd"], key: "o" }}
onAction={() => {
push(<CreateCompanyForm />);
}}
target={<CreateCompanyForm />}
/>
</ActionPanel>
}
Expand Down

0 comments on commit 2bac74f

Please sign in to comment.