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: CTA Button to Star Github Repo #532

Merged
merged 7 commits into from
Oct 5, 2024

Conversation

Kamlesh72
Copy link
Contributor

@Kamlesh72 Kamlesh72 commented Sep 3, 2024

Linked Issue(s)

Fixes #454

Acceptance Criteria fulfillment

  • Github Star Button

Proposed changes

Screenshot 2024-09-13 at 10 57 35 PM Screenshot 2024-09-13 at 11 02 53 PM

@Kamlesh72
Copy link
Contributor Author

@jayantbh @e-for-eshaan We have 2 good options to show this, either in sidebar or in header of a page.

Is there any plan to add something on right side of header?

Screenshot 2024-08-27 at 4 37 18 PM Screenshot 2024-08-27 at 8 11 01 PM

@e-for-eshaan e-for-eshaan marked this pull request as ready for review September 6, 2024 07:15
@e-for-eshaan
Copy link
Contributor

We want it to be frictionless to be able to star the repo. Putting it in the side bar is basically 'hiding it'

@e-for-eshaan
Copy link
Contributor

margins and paddings seem a little off
image

@e-for-eshaan
Copy link
Contributor

It's difficult to infer from this that these are stars, there needs to be some sort of star icon or something similiar for people to know that they can star the repo by clicking this

@e-for-eshaan
Copy link
Contributor

image

that's why i included this image on the issue itself

@Kamlesh72
Copy link
Contributor Author

@e-for-eshaan Unauthorized Github API calls are limited to 60 per hour. We can use fetch() in GithubButton component directly to utilize browser caching which has 60 seconds of cache invalidation time. This will almost never exceed rate limit.

Any suggestions on this approach?

@jayantbh
Copy link
Contributor

jayantbh commented Sep 8, 2024

Why is rate limits a concern? 😄
This isn't the kind of thing that needs to update so frequently that rate limits comes into the discussion.

It can just be loaded once on app load and that's it.

@Kamlesh72
Copy link
Contributor Author

@jayantbh So currently I used NextJs api to fetch stars. For every user, the client will call the Github API from BFF.

So you mean we call Github API from client side and store count in redux?

@jayantbh
Copy link
Contributor

jayantbh commented Sep 8, 2024

Yeah that's probably best. While traffic is expected to be low on individual instances of Middleware, in case someone hosts it internally widely enough it'll totally break.

But the browser making the request is just super unlikely to break unless they are trying to break it.

@e-for-eshaan
Copy link
Contributor

@Kamlesh72 how's this turning out? Let us know if you need any help, suggestions and/or reviews.

@Kamlesh72
Copy link
Contributor Author

@e-for-eshaan I was busy in some urgent work past 10 days, now free 😃.

Made the required changes.

which extension? Comment Ref

@e-for-eshaan
Copy link
Contributor

which extension?

not really an extension, drew it myself

@e-for-eshaan
Copy link
Contributor

Hey @Kamlesh72 can we have some updated images and videos on the PR description

@Kamlesh72
Copy link
Contributor Author

@e-for-eshaan done

Comment on lines 45 to 48
<StarBorderOutlined fontSize="small" />
<Typography fontWeight="bold" marginLeft={1}>
Star
</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrap in a FlexBox components. Use alignCenter prop to fix the jagged alignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-09-21 at 3 23 23 AM

web-server/src/components/GithubButton.tsx Outdated Show resolved Hide resolved
web-server/src/components/PageHeader.tsx Outdated Show resolved Hide resolved
web-server/src/components/TopLevelLogicComponent.tsx Outdated Show resolved Hide resolved
web-server/src/components/GithubButton.tsx Outdated Show resolved Hide resolved
@jayantbh
Copy link
Contributor

jayantbh commented Oct 1, 2024

I hate to request a change as tiny as this, but this is the last mile. This PR is almost done!

@Kamlesh72
Copy link
Contributor Author

@jayantbh @e-for-eshaan Any update on this PR? Am I missing something?

@jayantbh
Copy link
Contributor

jayantbh commented Oct 5, 2024

Approved!

@jayantbh jayantbh dismissed e-for-eshaan’s stale review October 5, 2024 13:21

Changes were addressed.

@jayantbh jayantbh merged commit ca5a13a into middlewarehq:main Oct 5, 2024
3 checks passed
@jayantbh
Copy link
Contributor

jayantbh commented Oct 5, 2024

Congrats on the contribution sire, took a while but good work!

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.

Add a Star this repo on Github button
3 participants