Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c2db8e6
init
alexsohn1126 Jan 2, 2026
7dc636c
change alert type to variant
alexsohn1126 Jan 2, 2026
2fb9e1b
Update index.tsx
alexsohn1126 Jan 2, 2026
06a0c19
Update index.tsx
alexsohn1126 Jan 2, 2026
3f10cfd
Merge branch 'alexsohn/feat/add-github-identity-and-provider-factory-…
alexsohn1126 Jan 5, 2026
aeaacaf
update error display in invite modal
alexsohn1126 Jan 5, 2026
bd45b00
remove hard-coded map for an existing constant and make repo user eas…
alexsohn1126 Jan 5, 2026
9b73a8b
fix option creation function
alexsohn1126 Jan 5, 2026
555d43f
remove unused export
alexsohn1126 Jan 5, 2026
aab48f2
set default values for modal
alexsohn1126 Jan 6, 2026
3333b1a
set gamingplatform prop for switch and xbox
alexsohn1126 Jan 6, 2026
c54d601
re-add dynamic origin selection
alexsohn1126 Jan 6, 2026
4757a0d
add missing gameplatform to tempest and console extensions
alexsohn1126 Jan 6, 2026
13ff7b2
add default msg for error while submitting sdk invite
alexsohn1126 Jan 6, 2026
9dccfba
fix default value
alexsohn1126 Jan 6, 2026
21242b6
graceful error handling for user idenitity api call
alexsohn1126 Jan 6, 2026
e7d61a6
convert anchor element to ExternalLink
alexsohn1126 Jan 6, 2026
98f4ce0
remove redundant states and use mutation instead
alexsohn1126 Jan 6, 2026
a28b64a
use nuqs instead of manual search params management
alexsohn1126 Jan 6, 2026
0577ffd
fix redirect URL
alexsohn1126 Jan 7, 2026
b3a5f59
add back the encodedURIComponent
alexsohn1126 Jan 7, 2026
9c9606c
confirm error returned string before showing it to user
alexsohn1126 Jan 7, 2026
5e39637
use modalprop ref to avoid repeated useEffect exec
alexsohn1126 Jan 7, 2026
410a905
remove onSubmit from PrivateGamingSdkAccessModalProps in RequestSdkAc…
alexsohn1126 Jan 7, 2026
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
37 changes: 37 additions & 0 deletions static/app/components/gameConsole/RequestSdkAccessButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {Button} from '@sentry/scraps/button';

import {openPrivateGamingSdkAccessModal} from 'sentry/actionCreators/modal';
import type {PrivateGamingSdkAccessModalProps} from 'sentry/components/modals/privateGamingSdkAccessModal';
import {IconLock} from 'sentry/icons';
import {t} from 'sentry/locale';
import {useReopenGamingSdkModal} from 'sentry/utils/useReopenGamingSdkModal';

export function RequestSdkAccessButton({
gamingPlatform,
organization,
origin,
projectId,
}: Omit<PrivateGamingSdkAccessModalProps, 'onSubmit'>) {
const buttonProps: PrivateGamingSdkAccessModalProps = {
gamingPlatform,
organization,
origin,
projectId,
};

useReopenGamingSdkModal(buttonProps);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do understand why it makes sense to use the hook here, but in my opinion it should be used outside of this component. I wouldn’t expect a button component to automatically open a modal just by being rendered. Does that make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I completely get that, I thought I was being smart by doing this, but I can see why this would be confusing for whoever uses this component. I'll move these hooks out to the pages they are being used in 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iiuc it doesn't automatically open the modal right? it still requires the click to open it. What it does do is open the modal if there's a specific query param int he URL. If that's the case, I think it makes sense to have it in here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billyvg Yea, it only opens the modal if a specific query param in the URL!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been looking at how I can extract out the hook, but it feels like maybe leaving a comment on the component would be a better fix as this button won't be super widely used.. LMK what you think @priscilawebdev


return (
<Button
priority="primary"
size="sm"
data-test-id="request-sdk-access"
icon={<IconLock locked />}
onClick={() => {
openPrivateGamingSdkAccessModal(buttonProps);
}}
>
{t('Request SDK Access')}
</Button>
);
}
Loading
Loading