Skip to content

Commit

Permalink
style: set color of call to action button to secondary
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Willenbring committed Oct 20, 2023
1 parent 3ac2cc0 commit 2496799
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Button, ButtonProps } from "@mui/material";
import React from "react";

export function CallToActionButton({ ...props }: ButtonProps) {
return (
<Button {...props} variant="contained" color="secondary">
{props.children}
</Button>
);
}
5 changes: 3 additions & 2 deletions packages/frontend/src/common/dialogs/JoinSessionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { TextInput } from "../components/TextInput";
import { useErrorContext } from "../context/ErrorContext";
import { LocalStorage } from "../utils/localStorage";
import { useLocalStorage } from "../hooks/useLocalStorage";
import { CallToActionButton } from "../components/buttons/CallToActionButton";

interface JoinSessionDialogProps extends DialogProps {
roomId: string;
Expand Down Expand Up @@ -112,9 +113,9 @@ export function JoinSessionDialog({
</DialogContent>
<DialogActions>
<Button onClick={handleClose}>Cancel</Button>
<Button onClick={handleSubmit} disabled={!isValid}>
<CallToActionButton onClick={handleSubmit} disabled={!isValid}>
Join
</Button>
</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { TextInput } from "../../../common/components/TextInput";
import { useRouter } from "next/navigation";
import { LocalStorage } from "../../../common/utils/localStorage";
import { useLocalStorage } from "../../../common/hooks/useLocalStorage";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

export function CreatePokerSessionDialog({ isOpen, close }: DialogProps) {
const {
Expand Down Expand Up @@ -92,9 +93,9 @@ export function CreatePokerSessionDialog({ isOpen, close }: DialogProps) {
</DialogContent>
<DialogActions>
<Button onClick={handleClose}>Cancel</Button>
<Button onClick={handleSubmit} disabled={!isValid}>
<CallToActionButton onClick={handleSubmit} disabled={!isValid}>
Join
</Button>
</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { DialogProps } from "../../../common/types/commonTypes";
import { useFullscreen } from "../../../retro/hooks/useFullscreen";
import { PokerUnit, PokerUnitType } from "../../types/pokerTypes";
import { usePokerContext } from "../../context/PokerContext";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

export function EstimationUnitSetupDialog({ isOpen, close }: DialogProps) {
const { pokerState, handleSetPokerUnit } = usePokerContext();
Expand Down Expand Up @@ -79,7 +80,7 @@ export function EstimationUnitSetupDialog({ isOpen, close }: DialogProps) {
</DialogContent>
<DialogActions>
<Button onClick={close}>Cancel</Button>
<Button onClick={handleSubmit}>Save</Button>
<CallToActionButton onClick={handleSubmit}>Save</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { TextInput } from "../../../common/components/TextInput";
import { useValidatedTextInput } from "../../../common/hooks/useValidatedTextInput";
import { DialogProps } from "../../../common/types/commonTypes";
import { useFullscreen } from "../../hooks/useFullscreen";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

interface CreateCardDialogProps extends DialogProps {
columnIndex: number;
Expand Down Expand Up @@ -79,9 +80,9 @@ export function CreateCardDialog({ isOpen, close, columnIndex }: CreateCardDialo
</DialogContent>
<DialogActions>
<Button onClick={handleClose}>Cancel</Button>
<Button onClick={handleSubmit} disabled={!isValid}>
<CallToActionButton onClick={handleSubmit} disabled={!isValid}>
Create
</Button>
</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { RetroColumn } from "../../types/retroTypes";
import { useValidatedTextInput } from "../../../common/hooks/useValidatedTextInput";
import { useRetroContext } from "../../context/RetroContext";
import { DialogProps } from "../../../common/types/commonTypes";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

export function CreateColumnDialog({ isOpen, close }: DialogProps) {
const {
Expand Down Expand Up @@ -73,9 +74,9 @@ export function CreateColumnDialog({ isOpen, close }: DialogProps) {
</DialogContent>
<DialogActions>
<Button onClick={closeDialog}>Cancel</Button>
<Button onClick={handleSubmit} disabled={!isValid}>
<CallToActionButton onClick={handleSubmit} disabled={!isValid}>
Create
</Button>
</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { useRoomContext } from "../../../common/context/RoomContext";
import { useRouter } from "next/navigation";
import { LocalStorage } from "../../../common/utils/localStorage";
import { useLocalStorage } from "../../../common/hooks/useLocalStorage";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

export function CreateRetroSessionDialog({ isOpen, close }: DialogProps) {
const {
Expand Down Expand Up @@ -126,9 +127,12 @@ export function CreateRetroSessionDialog({ isOpen, close }: DialogProps) {
</DialogContent>
<DialogActions>
<Button onClick={handleClose}>Cancel</Button>
<Button onClick={handleSubmit} disabled={!isNameValid || !isTitleValid || !format}>
<CallToActionButton
onClick={handleSubmit}
disabled={!isNameValid || !isTitleValid || !format}
>
Create
</Button>
</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TextInput } from "../../../common/components/TextInput";
import { RetroCard } from "../../types/retroTypes";
import { DialogProps } from "../../../common/types/commonTypes";
import { useFullscreen } from "../../hooks/useFullscreen";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

interface EditCardDialogProps extends DialogProps {
card: RetroCard;
Expand Down Expand Up @@ -69,9 +70,9 @@ export function EditCardDialog({ isOpen, close, card, columnIndex }: EditCardDia
</DialogContent>
<DialogActions>
<Button onClick={close}>Cancel</Button>
<Button onClick={handleSave} disabled={!isValid}>
<CallToActionButton onClick={handleSave} disabled={!isValid}>
Save
</Button>
</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { DialogProps } from "../../../common/types/commonTypes";
import { useFullscreen } from "../../hooks/useFullscreen";
import { useRetroContext } from "../../context/RetroContext";
import { CallToActionButton } from "../../../common/components/buttons/CallToActionButton";

export function ManageVotesDialog({ isOpen, close }: DialogProps) {
const fullScreen = useFullscreen();
Expand Down Expand Up @@ -72,7 +73,7 @@ export function ManageVotesDialog({ isOpen, close }: DialogProps) {
<DialogActions>
<Button onClick={handleReset}>Reset Votes</Button>
<Button onClick={handleCancel}>Cancel</Button>
<Button onClick={handleSave}>Save</Button>
<CallToActionButton onClick={handleSave}>Save</CallToActionButton>
</DialogActions>
</Dialog>
);
Expand Down

0 comments on commit 2496799

Please sign in to comment.