Skip to content
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

Add a 'default' network option that changes modal into split dropdown #39

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

dsevillamartin
Copy link
Member

Fixes #29

Changes proposed in this pull request:

  • Add option for default share option
  • Switches layout to SplitDropdown if share option is supported (i.e. if native is selected & supported)
  • I tried to use a custom component for ShareButton but SplitDropdown replaces the component class for the active one... so had to resort to using <Button> directly

Reviewers should focus on:

  • If there's only one share option and it is made default, it'll just say the network's name, eg. Twitter, which I don't love. I'm not sure how to improve that though - adding more text like "Share with" is too long except in phone layout
  • I made the dropdown buttons look separate like the modal to keep the style similar and differentiate from just selecting an option like the following dropdown

Screenshot

  • Native & Twitter enabled, with native as default (Edge vs Firefox):
    image image
  • With Twitter as default (Edge vs Firefox vs Phone):
    image image
    image
  • Native default w/ more alternative options
    image

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@dsevillamartin dsevillamartin merged commit 418af9f into master Feb 2, 2024
12 checks passed
@dsevillamartin dsevillamartin deleted the ds/add-default-option-dropdown-layout branch February 2, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow directly opening Native Share
1 participant