Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

742 add arrow to back buttons sweeping update #926

Merged
merged 1 commit into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const Affirmation = () => {
className={`${utilityClasses.buttonContainer} ${utilityClasses.justifyRight}`}
>
<Button
hasArrow
hasForwardArrow
onClick={() => updateAffirmationData({ isActive: false })}
buttonText={t(affirmationData.buttonText)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default function FlowNavigation({
disabled={isBackDisabled}
buttonText={backButtonLabel || 'BACK'}
theme={backBtnTheme}
hasBackArrow
/>
)}

Expand All @@ -82,7 +83,7 @@ export default function FlowNavigation({
disabled={isNextDisabled}
buttonText={nextButtonLabel || 'NEXT'}
theme="dark"
hasArrow
hasForwardArrow
/>
)}
</div>
Expand Down
12 changes: 8 additions & 4 deletions products/statement-generator/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useContext } from 'react';
import { Link } from 'react-router-dom';
import { Button, Theme, makeStyles, createStyles } from '@material-ui/core';
import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import { AppUrl } from 'contexts/RoutingProps';
import RoutingContext from 'contexts/RoutingContext';

Expand Down Expand Up @@ -126,7 +127,8 @@ const useStyles = makeStyles<Theme, StyleProps>(({ palette }) =>
interface ComponentProps {
className?: string;
theme?: string;
hasArrow?: boolean;
hasBackArrow?: boolean;
hasForwardArrow?: boolean;
disabled?: boolean;
icon?: React.ReactNode;
buttonText?: string;
Expand All @@ -136,13 +138,14 @@ interface ComponentProps {
const ButtonComponent = ({
className = '',
theme,
hasArrow,
hasBackArrow,
hasForwardArrow,
disabled = false,
icon,
buttonText,
onClick,
}: ComponentProps) => {
const styleProps = { theme, hasArrow };
const styleProps = { theme, hasBackArrow, hasForwardArrow };
const classes = useStyles(styleProps);
return (
<Button
Expand All @@ -151,9 +154,10 @@ const ButtonComponent = ({
className={`${classes.root} ${className}`}
onClick={onClick}
>
{hasBackArrow && <ArrowBackIcon style={{ height: '.8em' }} />}
{icon}
{buttonText}
{hasArrow && <ArrowForwardIcon style={{ height: '.8em' }} />}
{hasForwardArrow && <ArrowForwardIcon style={{ height: '.8em' }} />}
</Button>
);
};
Expand Down
6 changes: 5 additions & 1 deletion products/statement-generator/src/components/PopUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ const AlertDialog: React.FC<AlertDialogProps> = ({ title, info }) => {
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={() => handleClose()} buttonText="OK" hasArrow />
<Button
onClick={() => handleClose()}
buttonText="OK"
hasForwardArrow
/>
</DialogActions>
</Dialog>
</div>
Expand Down