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: DiscordCardWarning component #1474

Merged
merged 8 commits into from
Sep 11, 2024
Merged

Conversation

BrickheadJohnny
Copy link
Collaborator

Added a cardWarningComponent for Discord rewards which indicates if the original Discord role doesn't exist anymore.

Also improved the code a bit:

  • Removed the custom logic for GoogleCardWarning from Reward.tsx, we don't need that anymore
  • Cleaned up the GoogleCardWarning component
  • Removed empty import lines
  • Created a reusable CardWarningComponentBase component

Note:
We should refactor the fetching logic in the DiscordBotPermissionsChecker component, I noticed that it won't write in the /v2/discord/servers/:serverId/permissions cache, so we'll actually fetch the data 2 times in some edge cases. This is a low prio task & is not the scope of this PR, so I left it as is for now.

@BrickheadJohnny BrickheadJohnny added the feature New feature or request label Sep 10, 2024
@BrickheadJohnny BrickheadJohnny self-assigned this Sep 10, 2024
Copy link

vercel bot commented Sep 10, 2024

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

Name Status Preview Comments Updated (UTC)
guild-xyz ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 2:05pm

import { PlatformName, PlatformType } from "types"
import PlatformAccessButton from "./PlatformAccessButton"

const AccessedGuildPlatformCard = () => {
const { guildPlatform } = useRolePlatform()
const rolePlatform = useRolePlatform()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: why not keep the {guildPlatform} destruction here? Since we only use that from rolePlatform, felt cleaner to me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, good point, I originally passed down rolePlatform as a prop to the PlatformCardWarning component, but then realised that I could just use the useRolePlatform hook & just forgot to revert this change. Will do it before merging the PR, thanks!

@BrickheadJohnny BrickheadJohnny merged commit 14f0f25 into main Sep 11, 2024
6 checks passed
@BrickheadJohnny BrickheadJohnny deleted the discord-role-warning branch September 11, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants