|
1 | | -import React from 'react'; |
| 1 | +import React, { useEffect } from 'react'; |
| 2 | + |
2 | 3 | import { inject, hooksObserver } from 'app/componentConnectors'; |
| 4 | +import Navigation from 'app/pages/common/Navigation'; |
3 | 5 |
|
4 | | -import ZeitLogo from 'app/components/ZeitLogo'; |
5 | | -import Integration from 'app/components/Integration'; |
| 6 | +import { Container } from './elements'; |
| 7 | +import Prompt from './Prompt'; |
6 | 8 |
|
7 | 9 | interface Props { |
8 | 10 | small: boolean; |
9 | 11 | store: any; |
10 | 12 | signals: any; |
11 | 13 | } |
12 | 14 |
|
13 | | -const ZeitIntegration = inject('store', 'signals')( |
| 15 | +const CLI = inject('store', 'signals')( |
14 | 16 | hooksObserver( |
15 | 17 | ({ |
16 | | - small, |
17 | | - signals: { signInZeitClicked, signOutZeitClicked }, |
18 | | - store: { user, isLoadingZeit }, |
19 | | - }: Props) => ( |
20 | | - <Integration |
21 | | - name="ZEIT" |
22 | | - small={small} |
23 | | - color="black" |
24 | | - description="Deployments" |
25 | | - Icon={ZeitLogo} |
26 | | - userInfo={user.integrations.zeit} |
27 | | - signIn={signInZeitClicked} |
28 | | - signOut={signOutZeitClicked} |
29 | | - loading={isLoadingZeit} |
30 | | - /> |
31 | | - ) |
| 18 | + signals: { cliMounted, signInCliClicked }, |
| 19 | + store: { user, authToken, isLoadingCLI, error }, |
| 20 | + }: Props) => { |
| 21 | + useEffect(() => { |
| 22 | + cliMounted(); |
| 23 | + }, [cliMounted]); |
| 24 | + |
| 25 | + return ( |
| 26 | + <Container> |
| 27 | + <Navigation title="CLI Authorization" /> |
| 28 | + |
| 29 | + <Prompt |
| 30 | + error={error} |
| 31 | + loading={isLoadingCLI} |
| 32 | + signIn={signInCliClicked} |
| 33 | + token={authToken} |
| 34 | + username={user && user.username} |
| 35 | + /> |
| 36 | + </Container> |
| 37 | + ); |
| 38 | + } |
32 | 39 | ) |
33 | 40 | ); |
34 | 41 |
|
35 | | -export default ZeitIntegration; |
| 42 | +export default CLI; |
0 commit comments