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

fix: unauthed review click should show login modal #771

Merged
merged 1 commit into from
Sep 15, 2023
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
4 changes: 2 additions & 2 deletions packages/ui/components/core/ActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
// Previous actions object is now a hook to check user session before using save or saved actions
const useActions = () => {
const { classes } = useStyles()

const { status: sessionStatus } = useSession()
/**
* Curried function which accepts a Polymorphic button element as its base param. The inner function returns
* a JSX component.
Expand Down Expand Up @@ -396,7 +396,7 @@
delete: generic(QuickPromotionModal),
more: generic(createPolymorphicComponent<'button', PolyButtonProps>(Button)),
print: generic(PrintButton),
review: generic(ReviewModal),
review: generic(sessionStatus === 'authenticated' ? ReviewModal : QuickPromotionModal),
save: generic(SaveToggleButton),
share: generic(ShareLink),
} as const
Expand Down Expand Up @@ -439,12 +439,12 @@
const orgOrServiceId = { organizationId: orgId ?? '', serviceId }

let filteredOverflowItems = Object.entries(overFlowItems).filter(
([key, item]) => !(isMobile || isTablet) || key !== 'print'

Check warning on line 442 in packages/ui/components/core/ActionButtons.tsx

View check run for this annotation

InReachBot / Check Code for Errors

packages/ui/components/core/ActionButtons.tsx#L442

[@typescript-eslint/no-unused-vars] 'item' is defined but never used.
)

if (outsideMoreMenu)
/* Keep overFlowItems where the key is not in outsideMoreMenu array */
filteredOverflowItems = filteredOverflowItems.filter(([key, item]) => !outsideMoreMenu.includes(key))

Check warning on line 447 in packages/ui/components/core/ActionButtons.tsx

View check run for this annotation

InReachBot / Check Code for Errors

packages/ui/components/core/ActionButtons.tsx#L447

[@typescript-eslint/no-unused-vars] 'item' is defined but never used.

const overflowMenuItems = filteredOverflowItems.map(([key, item]) => {
const children = (
Expand Down
Loading