Skip to content

Commit

Permalink
Set default tab and made workflow buttons always visible in all tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Vega committed Mar 15, 2024
1 parent 26fd8d6 commit e5b586c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/content/dataSubmissions/DataSubmission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Button,
Card,
CardActions,
CardActionsProps,
CardContent,
Container,
IconButton,
Expand Down Expand Up @@ -117,13 +116,10 @@ const StyledMainContentArea = styled("div")(() => ({
padding: "21px 40px 0",
}));

const StyledCardActions = styled(CardActions, {
shouldForwardProp: (prop) => prop !== "isVisible"
})<CardActionsProps & { isVisible: boolean; }>(({ isVisible }) => ({
const StyledCardActions = styled(CardActions)(() => ({
"&.MuiCardActions-root": {
visibility: isVisible ? "visible" : "hidden",
paddingTop: 0,
}
},
}));

const StyledTabs = styled(Tabs)(() => ({
Expand Down Expand Up @@ -337,7 +333,7 @@ type Props = {
tab: string;
};

const DataSubmission: FC<Props> = ({ submissionId, tab }) => {
const DataSubmission: FC<Props> = ({ submissionId, tab = URLTabs.DATA_ACTIVITY }) => {
usePageTitle(`Data Submission ${submissionId || ""}`);

const { user } = useAuthContext();
Expand Down Expand Up @@ -597,7 +593,7 @@ const DataSubmission: FC<Props> = ({ submissionId, tab }) => {
<BackButton navigateTo="/data-submissions" text="Back to Data Submissions" />
</StyledMainContentArea>
</StyledCardContent>
<StyledCardActions isVisible={tab === URLTabs.DATA_ACTIVITY}>
<StyledCardActions>
<DataSubmissionActions
submission={data?.getSubmission}
onAction={updateSubmissionAction}
Expand Down

0 comments on commit e5b586c

Please sign in to comment.