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

Fix/proposal links #23

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from
Open

Fix/proposal links #23

wants to merge 2 commits into from

Conversation

envin3
Copy link
Contributor

@envin3 envin3 commented Jan 5, 2024

Fix broken links on dao proposals.
PIP-33 links are wrapped in a google search link and are not modifiable. When clicking the link the google search generates a redirectory that the browser blocks for security reasons. The output looks like:
image

This fix aim is to modify the contain of the iframe in which the proposal is loaded and intecept all links click to check that the document loads only direct links.

@envin3 envin3 changed the base branch from feat/multichain to v2 January 5, 2024 17:05
@envin3 envin3 requested a review from oliviera9 January 5, 2024 17:05
@envin3 envin3 force-pushed the fix/proposal-links branch from cf497b1 to 3871df3 Compare January 5, 2024 17:20
Copy link
Contributor

@oliviera9 oliviera9 left a comment

Choose a reason for hiding this comment

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

Why were the links broken?
How does this PR fix them?

Remember to update the version number in package.json.

src/components/complex/Proposal/index.jsx Outdated Show resolved Hide resolved
src/components/complex/Proposal/index.jsx Outdated Show resolved Hide resolved
}
link.setAttribute(
'onClick',
'{ ' +
Copy link
Contributor

Choose a reason for hiding this comment

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

Factor out into a function taking stringified id as a parameter

src/components/complex/Proposal/index.jsx Outdated Show resolved Hide resolved

useEffect(() => {
// // Function to perform search and replace within the iframe
const performSearchAndReplace = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is too complex in my opinion, and needs refactoring to make it smaller and easier to read.

src/components/complex/Proposal/index.jsx Show resolved Hide resolved
src/components/complex/Proposal/index.jsx Show resolved Hide resolved
@envin3 envin3 force-pushed the fix/proposal-links branch from 3871df3 to 6171b1c Compare January 9, 2024 19:05
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