-
Notifications
You must be signed in to change notification settings - Fork 800
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
Social: Add new connection modal #37211
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2ac54d9
Add the constants
gmjuhasz 9ff8f83
Chain down iconSize to SocialServiceIcon
gmjuhasz 7ba255a
changelog
gmjuhasz 6da7cb6
Add the connection modal
gmjuhasz f040608
Add the connect page component
gmjuhasz 6615297
Add assets
gmjuhasz 035cb6a
Add LinkedIn, Nextdoor, and Tumblr example
gmjuhasz 08a9777
Add Mastodon
gmjuhasz e70fda9
Merge branch 'trunk' into add/social-add-connection-modal
gmjuhasz 1d33c6f
Hook up the modal
gmjuhasz dc23280
Fixup versions
gmjuhasz 9edd20f
Add aria-label to button
gmjuhasz 2bfaeda
Update projects/js-packages/publicize-components/src/components/add-c…
gmjuhasz 6444ce6
Update projects/js-packages/publicize-components/src/components/add-c…
gmjuhasz e9fbc4a
Update projects/js-packages/publicize-components/src/components/add-c…
gmjuhasz 35afae9
Update projects/js-packages/publicize-components/src/components/add-c…
gmjuhasz f944912
Update projects/js-packages/publicize-components/src/components/add-c…
gmjuhasz d260429
Add connect button to main page as well
gmjuhasz 8792b32
Merge branch 'trunk' into add/social-add-connection-modal
gmjuhasz 6aff2e3
Fixup versions
gmjuhasz d791d72
Show `back` instead of chevronleft
gmjuhasz c45a42b
Fix TS compile error for image imports in js-packages
manzoorwanijk fef8379
Update projects/js-packages/publicize-components/src/components/add-c…
gmjuhasz 7f8d947
Merge branch 'trunk' into add/social-add-connection-modal
gmjuhasz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/js-packages/components/changelog/add-social-add-connection-modal
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,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Social: Added add connection modal |
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
4 changes: 4 additions & 0 deletions
4
projects/js-packages/publicize-components/changelog/add-social-add-connection-modal
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,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Social: Added add connection modal |
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
Binary file added
BIN
+11.8 KB
...cts/js-packages/publicize-components/src/assets/connections-button-facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.9 KB
...cts/js-packages/publicize-components/src/assets/connections-button-linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.9 KB
projects/js-packages/publicize-components/src/assets/connections-button-tumblr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+79.7 KB
projects/js-packages/publicize-components/src/assets/connections-facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.6 KB
.../js-packages/publicize-components/src/assets/connections-instagram-business.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.5 KB
projects/js-packages/publicize-components/src/assets/connections-linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.7 KB
projects/js-packages/publicize-components/src/assets/connections-nextdoor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62.1 KB
projects/js-packages/publicize-components/src/assets/connections-tumblr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
projects/js-packages/publicize-components/src/assets/index.d.ts
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 @@ | ||
declare module '*.png'; |
52 changes: 52 additions & 0 deletions
52
...es/publicize-components/src/components/add-connection-modal/connect-page/connect-page.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,52 @@ | ||
import { Button, useBreakpointMatch } from '@automattic/jetpack-components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import classNames from 'classnames'; | ||
import { Connection } from '../constants'; | ||
import styles from './style.module.scss'; | ||
|
||
type ConnectPageProps = { | ||
service: Connection; | ||
onBackClicked: () => void; | ||
}; | ||
|
||
export const ConnectPage: React.FC< ConnectPageProps > = ( { service, onBackClicked } ) => { | ||
const [ isSmall ] = useBreakpointMatch( 'sm' ); | ||
|
||
return ( | ||
<> | ||
<div | ||
className={ classNames( styles[ 'example-wrapper' ], { | ||
[ styles.small ]: isSmall, | ||
} ) } | ||
> | ||
{ service.examples.map( ( Example, idx ) => ( | ||
<div key={ service.name + idx } className={ styles.example }> | ||
<Example /> | ||
</div> | ||
) ) } | ||
</div> | ||
<div className={ styles[ 'actions-wrapper' ] }> | ||
<Button | ||
variant="secondary" | ||
onClick={ onBackClicked } | ||
aria-label={ __( 'Go back', 'jetpack' ) } | ||
> | ||
{ __( 'Back', 'jetpack' ) } | ||
</Button> | ||
<form className={ classNames( styles[ 'connect-form' ], { [ styles.small ]: isSmall } ) }> | ||
{ 'mastodon' === service.name ? ( | ||
<input | ||
gmjuhasz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
required | ||
type="text" | ||
aria-label={ __( 'Mastodon username', 'jetpack' ) } | ||
placeholder={ '@[email protected]' } | ||
/> | ||
) : null } | ||
<Button type="submit" variant="primary"> | ||
{ __( 'Connect', 'jetpack' ) } | ||
</Button> | ||
</form> | ||
</div> | ||
</> | ||
); | ||
}; |
53 changes: 53 additions & 0 deletions
53
...s/publicize-components/src/components/add-connection-modal/connect-page/style.module.scss
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,53 @@ | ||
.example-wrapper { | ||
display: grid; | ||
grid-auto-columns: minmax(0, 1fr); | ||
grid-auto-flow: column; | ||
font-size: 15px; | ||
margin-top: 0.4rem; | ||
min-height: 300px; | ||
|
||
&.small { | ||
grid-auto-flow: row; | ||
grid-gap: 2rem; | ||
height: auto; | ||
min-height: unset; | ||
} | ||
|
||
img { | ||
max-height: 520px; | ||
max-width: 100%; | ||
} | ||
|
||
> div { | ||
padding: 0.4rem; | ||
|
||
&:has(img) { | ||
margin-inline-start: auto; | ||
margin-inline-end: auto; | ||
} | ||
} | ||
} | ||
|
||
.actions-wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: 1rem; | ||
} | ||
|
||
.chevron-back { | ||
display: block; | ||
} | ||
|
||
.connect-form { | ||
display: grid; | ||
gap: 0.5rem; | ||
|
||
& > input { | ||
height: 100%; | ||
width: 18rem; | ||
} | ||
|
||
&:not(.small) { | ||
grid-auto-flow: column; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Mastodon we need to have the username as an input. We can handle that on the Button onClick event