Skip to content

Commit

Permalink
Remove rest of DisabledButton references
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Feb 22, 2024
1 parent 7c1d287 commit a17990e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
8 changes: 2 additions & 6 deletions src/ui/components/shared/APIKeys.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect, useMemo, useRef, useState } from "react";

import { Button } from "replay-next/components/Button";
import { ApiKey, ApiKeyResponse, ApiKeyScope } from "shared/graphql/types";

import { Button, DisabledButton, PrimaryButton } from "./Button";
import { useConfirm } from "./Confirm";
import TextInput from "./Forms/TextInput";
import MaterialIcon from "./MaterialIcon";
Expand Down Expand Up @@ -176,11 +176,7 @@ export default function APIKeys({
value={label}
/>

{canSubmit ? (
<PrimaryButton color="blue">Add</PrimaryButton>
) : (
<DisabledButton>Add</DisabledButton>
)}
<Button disabled={!canSubmit}>Add</Button>
</fieldset>
{scopes && scopes.length > 1 ? (
<fieldset className="w-full">
Expand Down
9 changes: 0 additions & 9 deletions src/ui/components/shared/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,3 @@ export const PrimaryButton = (props: ButtonProps & { color: Colors }) => (
export const SecondaryButton = (props: ButtonProps & { color: Colors }) => (
<Button {...props} size="md" style="secondary" />
);
export const DisabledButton = ({ className, ...rest }: ButtonProps) => (
<Button
{...rest}
size="md"
style="disabled"
className={classNames(className, "cursor-default")}
color="gray"
/>
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ChangeEvent, useMemo, useState } from "react";

import { Button } from "replay-next/components/Button";
import { WorkspaceUser } from "shared/graphql/types";
import * as actions from "ui/actions/app";
import { useRedirectToTeam } from "ui/components/Library/Team/utils";
Expand All @@ -12,7 +13,6 @@ import { validateEmail } from "ui/utils/helpers";
import { trackEvent } from "ui/utils/telemetry";

import Base64Image from "../Base64Image";
import { Button, DisabledButton, PrimaryButton } from "../Button";
import { useConfirm } from "../Confirm";
import { TextInput } from "../Forms";
import InvitationLink from "../NewWorkspaceModal/InvitationLink";
Expand Down Expand Up @@ -117,13 +117,7 @@ function WorkspaceForm() {
onChange={onChange}
className="border-inputBorder"
/>
{isLoading ? (
<DisabledButton>Loading...</DisabledButton>
) : canSubmit ? (
<PrimaryButton color="blue">Invite</PrimaryButton>
) : (
<DisabledButton>Invite</DisabledButton>
)}
<Button disabled={isLoading || !canSubmit}>{isLoading ? "Loading..." : "Invite"}</Button>
</div>
{errorMessage ? <div className="py-3 text-xs text-red-500">{errorMessage}</div> : null}
</form>
Expand Down Expand Up @@ -225,7 +219,7 @@ const settings: Settings<
<div className="font-semibold">Delete this team</div>
<div className="">{`This cannot be reversed.`}</div>
</div>
<Button color="red" onClick={handleDeleteTeam} size="md" style="primary">
<Button color="secondary" onClick={handleDeleteTeam}>
Delete this team
</Button>
</div>
Expand Down

0 comments on commit a17990e

Please sign in to comment.