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

CRDCDH-951 Set default Data Submission tab when unspecified #312

Merged
merged 1 commit into from
Mar 15, 2024
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
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
Loading