Skip to content

Commit

Permalink
everything is working again
Browse files Browse the repository at this point in the history
  • Loading branch information
khill-fbmc committed Oct 15, 2024
1 parent 163ace8 commit 1522b53
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/hooks/useEditMode.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useExtensionState } from "./useExtensionState";

export function useEditMode() {
const [isEditing, setEditMode] = useExtensionState((s) => [
s.isEditing,
s.setEditMode,
]);
const isEditing = useExtensionState((s) => s.isEditing);
const setEditMode = useExtensionState((s) => s.setEditMode);
const startEditMode = () => setEditMode(true);
const endEditMode = () => setEditMode(false);

return { isEditing, setEditMode, startEditMode, endEditMode };
}
4 changes: 2 additions & 2 deletions src/pages/Options/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ function Options() {
</Alert> */}
</Col>
</Row>
{/* <OptionsForm /> */}
<OptionsForm />
</Container>
</Tab>
<Tab eventKey="storage" title="Storage">
{/* <StorageTab /> */}
<StorageTab />
</Tab>
<Tab eventKey="workflow" title="Workflow">
<WorkflowTab />
Expand Down
13 changes: 8 additions & 5 deletions src/pages/Options/components/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Props = EditProps | StdProps;

function AppCard({ app, isActive, ...props }: Props) {
const { endEditMode } = useEditMode();
const { domain } = useDomain();
const domain = useExtensionState((s) => s.domain);
const setActiveApp = useExtensionState((s) => s.setActiveApp);

const appUrl = useRetoolAppUrl(domain, app);
Expand Down Expand Up @@ -65,13 +65,13 @@ function AppCard({ app, isActive, ...props }: Props) {
{app.query.length > 0 && (
<Col>
<h5>Query Params</h5>
<Parameters params={app.query} />
<Parameters type="query" params={app.query} />
</Col>
)}
{app.hash.length > 0 && (
<Col>
<h5>Hash Params</h5>
<Parameters params={app.hash} />
<Parameters type="hash" params={app.hash} />
</Col>
)}
</Row>
Expand Down Expand Up @@ -113,12 +113,15 @@ function AppCard({ app, isActive, ...props }: Props) {

export default AppCard;

const Parameters: React.FC<{ params: UrlParam[] }> = ({ params }) => {
const Parameters: React.FC<{
type: "query" | "hash";
params: UrlParam[];
}> = ({ type, params }) => {
return (
<dl>
{params.map((p) => (
<div key={p.param}>
<dt className="query">{p.param}</dt>
<dt className={type}>{p.param}</dt>
<dd className="text-muted">{p.value}</dd>
</div>
))}
Expand Down

0 comments on commit 1522b53

Please sign in to comment.