Skip to content
Merged
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
7 changes: 4 additions & 3 deletions react-kit/src/lib/components/buttons/GoBackButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import React from 'react';
import { IconButton, Tooltip } from '@mui/material';
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
import { useNavigate } from 'react-router-dom';

interface GoBackButtonProps {
onClick: () => void;
name?: string;
children?: React.ReactNode;
}

export function GoBackButton(props: GoBackButtonProps) {
const navigate = useNavigate();
return (
<Tooltip title="Go Back to Previous Page">
<IconButton name={props.name} color="primary" onClick={() => props.onClick()}>
<IconButton name={props.name} color="primary" onClick={() => navigate(-1)}>
<ArrowBackIosIcon />
{props.children ?? props.name}
{props.children}
</IconButton>
</Tooltip>
);
Expand Down