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

feat: surplus modal #2767

Merged
merged 7 commits into from
Jul 3, 2023
Merged

feat: surplus modal #2767

merged 7 commits into from
Jul 3, 2023

Conversation

fairlighteth
Copy link
Contributor

@fairlighteth fairlighteth commented Jun 30, 2023

Summary

  • Styles the surplus modal from @alfetopito
  • Has the Tweet button functionality
  • On click of the Tweet button fires the track event onTweetShare
Screenshot 2023-06-30 at 15 21 24 Screenshot 2023-06-30 at 15 21 36

Todo:

  • Review mobile/responsive
  • Review Tweet text: We can specify if they 'saved' or got 'surplus'

@vercel
Copy link

vercel bot commented Jun 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
swap-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback

🌃 Cosmos ↗︎

@fairlighteth fairlighteth requested review from a team June 30, 2023 14:23
Copy link
Collaborator

@shoom3301 shoom3301 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice :)

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks amazing!

One small suggestion regarding the modal size logic

Comment on lines 83 to +84
if (activityDerivedState && getActivityState(activityDerivedState) === 'filled') {
return 400
return 470
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case you can unify the return with line 89

Change the if condition to:

if((activityDerivedState && getActivityState(activityDerivedState) === 'filled') || !hash)

then remove lines 86, 88 and 89, returning 850 in the default case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, can we specify the 470 value specifically for this surplus modal? Not sure that's a specific 'activity'.

function getTwitterText(surplusAmount: string, surplusToken: string) {
const surplus = `${surplusAmount} ${surplusToken}`
return encodeURIComponent(
`Hey, I just ${SELL_SURPLUS_WORD} ${surplus} on @CoWSwap! 🐮💸\n\nStart swapping on swap.cow.fi`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this message receive the order.kind as a parameter (or directly the surplusWord)? so it works for buy orders too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right. Just committed a fix.

@fairlighteth
Copy link
Contributor Author

Added updates for dark mode:
Screenshot 2023-06-30 at 15 40 27

@elena-zh
Copy link
Contributor

Hey @fairlighteth , great!
Some issues that I see:

  1. Twitter button looks a bit different to me in comparison with the screenshot
    button diff
  2. Twitter post: maybe better to add 'extra' into the text?
    extra
  3. Twitter: again, for a buy order maybe better to say 'saved extra' ?
    saved
  4. modal, responsive view: for a tablet resolution the content does not cover the whole screen:
    surface

@fairlighteth
Copy link
Contributor Author

@elena-zh Thank you for reviewing. The first and last point should be fixed.

@elena-zh
Copy link
Contributor

@fairlighteth , cases 1, 4 LGTM!

@fairlighteth
Copy link
Contributor Author

@elena-zh I will merge and we can see about point 2 and 3 as this PR aims to focus around the styling aspects.

@fairlighteth fairlighteth merged commit 694a112 into develop Jul 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2023
@alfetopito alfetopito deleted the surplus-modal-styling branch July 3, 2023 12:28
@alfetopito
Copy link
Collaborator

@elena-zh I will merge and we can see about point 2 and 3 as this PR aims to focus around the styling aspects.

@fairlighteth I can take care of that if you want

@elena-zh
Copy link
Contributor

elena-zh commented Jul 4, 2023

@elena-zh I will merge and we can see about point 2 and 3 as this PR aims to focus around the styling aspects.

@fairlighteth I can take care of that if you want

@fairlighteth , @alfetopito , I have created #2780 task for this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants