Skip to content

Commit

Permalink
added disabling for action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Impeqq committed Nov 17, 2021
1 parent 92daa0c commit 78de9ce
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/chat/typing/typing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { RouteParams } from "@features/types";
import { useParams } from "react-router-dom";
import { BaseForm } from "@components";
import { useForm } from "react-hook-form";
import { Button, Input } from "@ui";
import { Button, ButtonType, Input } from "@ui";

export const Typing = () => {
const [sendMessage] = useMutation(SEND_MESSAGE);
const [sendMessage, { loading }] = useMutation(SEND_MESSAGE);

const { id } = useParams<RouteParams>();

Expand Down Expand Up @@ -55,8 +55,11 @@ export const Typing = () => {
<div>
<MicIcon />
<Button
type={ButtonType.SUBMIT}
className={styles.button}
text={""}
withDisable={true}
loading={loading}
icon={<SendIcon fill="#ffffff" />}
/>
</div>
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/pages/Auth/register-block/register-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ export const RegisterBlock = () => {
message={error?.message}
/>
<InputGroup>
<Button text={"Sign Up"} type={ButtonType.SUBMIT} loading={loading} />
<Button
text={"Sign Up"}
type={ButtonType.SUBMIT}
loading={loading}
withDisable={true}
/>
<Button
text={"Sign Up"}
iconDirection={IconDirection.RIGHT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ export const ChangeInformation = () => {
style={ButtonStyle.OUTLINE}
onClick={handleReset}
/>
<Button text={"Update"} type={ButtonType.SUBMIT} loading={loading} />
<Button
text={"Update"}
type={ButtonType.SUBMIT}
withDisable={true}
loading={loading}
/>
</InputGroup>
</BaseForm>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const ChangePassword = () => {
<Button
text={"Change password"}
type={ButtonType.SUBMIT}
withDisable={true}
loading={loading}
/>
<Input
Expand Down
1 change: 1 addition & 0 deletions frontend/src/ui/atoms/button/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
&.disabled {
background: $c_button_disabled;
color: $c_white;
cursor: unset;
&:hover {
background: $c_button_disabled_hover;
}
Expand Down

0 comments on commit 78de9ce

Please sign in to comment.