-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Photos picker: Integrate GooglePhotos connection upgrade (#97117)
* Photos picker: Disable session fetching if there is no feature flag * Update logic to refetch connection if it's an invalid status * Photos picker: create upgrade component * Integrate google photos connection upgrade screen
- Loading branch information
Showing
4 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
client/my-sites/media-library/google-photos-auth-upgrade.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Button } from '@wordpress/components'; | ||
import { useTranslate } from 'i18n-calypso'; | ||
import { useState } from 'react'; | ||
import { useDispatch } from 'calypso/state'; | ||
import { deleteStoredKeyringConnection } from 'calypso/state/sharing/keyring/actions'; | ||
import type { Connection } from 'calypso/sites/marketing/connections/types'; | ||
|
||
interface Props { | ||
connection: Connection; | ||
} | ||
const GooglePhotosAutUpgrade = ( props: Props ) => { | ||
const translate = useTranslate(); | ||
const dispatch = useDispatch(); | ||
const { connection } = props; | ||
const [ isDisconnecting, setIsDisconnecting ] = useState( false ); | ||
|
||
return ( | ||
<div className="media-library__connect-message"> | ||
<p> | ||
<img | ||
src="/calypso/images/sharing/google-photos-logo-text.svg?v=20241124" | ||
width="400" | ||
alt={ translate( 'Google Photos' ) } | ||
/> | ||
</p> | ||
<p> | ||
{ translate( | ||
"We've updated our Google Photos service. You will need to disconnect and reconnect to continue accessing your photos." | ||
) } | ||
</p> | ||
|
||
<Button | ||
variant="secondary" | ||
isBusy={ isDisconnecting } | ||
onClick={ () => { | ||
dispatch( deleteStoredKeyringConnection( connection ) ); | ||
setIsDisconnecting( true ); | ||
} } | ||
> | ||
{ translate( 'Disconnect from Google Photos' ) } | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default GooglePhotosAutUpgrade; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters