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

Dues estimator to reduce currencylayer usage #10767

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danieljames-dj
Copy link
Member

For getting currency details, we moved to currencylayer API which is paid. Currently, the dues is shown on competition edit page, but it may not be noticed every time by the user. So it has been replaced with a button now as shown below:

Screenshot 2025-02-04 at 06 33 28

When the user clicks the button, they will be able to see the dues estimate. This view not only shows the dues estimate, but also allows user to change the competitor count temporarily and see what is the dues for that competitor count:

Screenshot 2025-02-04 at 06 35 50

The future plan of this component will be to explain the dues calculation method used in this component, so that delegate can easily understand it from here, and hence reduce queries to WFC on 'why is the dues xyz for n competitors'.

Comment on lines +14 to +17
const currencyInfo = useMemo(
() => (currenciesData.byIso[currencyCode] || currenciesData.byIso.USD),
[currencyCode],
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there's any need to memoize this.


const {
data, loading, error,
} = useLoadedData(calculateDuesUrl(countryId, currencyCode, baseEntryFee));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use useQuery here? useLoadedData has some issues and I think the plan is to replace it at some point anyway.

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.

2 participants