kyd-shared-badge 0.3.79 → 0.3.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@ export function ConnectAccounts(props: ConnectAccountsProps) {
|
|
|
41
41
|
initialProviderId,
|
|
42
42
|
githubAppSlugId,
|
|
43
43
|
userId,
|
|
44
|
+
inviteId,
|
|
44
45
|
} = props;
|
|
45
46
|
|
|
46
47
|
const router = useRouter();
|
|
@@ -164,10 +165,22 @@ export function ConnectAccounts(props: ConnectAccountsProps) {
|
|
|
164
165
|
if (url) router.push(url);
|
|
165
166
|
};
|
|
166
167
|
|
|
167
|
-
const selectedProvider = useMemo(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
const selectedProvider = useMemo(() => {
|
|
169
|
+
if (!selectedProviderId) return null;
|
|
170
|
+
if (selectedProviderId.toLowerCase() === 'githubapp') {
|
|
171
|
+
// Special virtual provider for github app, not in providers list
|
|
172
|
+
return {
|
|
173
|
+
id: 'githubapp',
|
|
174
|
+
name: 'GitHub App',
|
|
175
|
+
connectionType: 'githubapp',
|
|
176
|
+
iconColor: 'text-gray-900',
|
|
177
|
+
placeholder: 'Install the GitHub App to connect your repositories.',
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
return providers.find(
|
|
181
|
+
(p) => p.id.toLowerCase() === selectedProviderId.toLowerCase()
|
|
182
|
+
) || null;
|
|
183
|
+
}, [selectedProviderId, providers]);
|
|
171
184
|
|
|
172
185
|
const handleConnectBack = () => {
|
|
173
186
|
setSelectedProviderIdAndCallback(null);
|
|
@@ -329,7 +342,7 @@ export function ConnectAccounts(props: ConnectAccountsProps) {
|
|
|
329
342
|
className="w-full sm:w-auto bg-[var(--icon-accent)] text-white transition-colors font-semibold"
|
|
330
343
|
onClick={() => {
|
|
331
344
|
const opaqueState = window.crypto?.randomUUID?.() || Math.random().toString(36).substring(2);
|
|
332
|
-
const stateObj = { opaqueState, userId, companyId };
|
|
345
|
+
const stateObj = { opaqueState, userId, companyId, inviteId };
|
|
333
346
|
const stateString = encodeURIComponent(JSON.stringify(stateObj));
|
|
334
347
|
const redirectUrl = `https://github.com/apps/${githubAppSlugId}/installations/new?state=${stateString}`;
|
|
335
348
|
window.location.href = redirectUrl;
|