Skip to content

Commit

Permalink
Update Collective profile prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavlrsn committed Oct 7, 2024
1 parent a3201a3 commit 62a6f0d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion components/crowdfunding-redesign/FundraiserLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ProfileModal } from './ProfileModal';
import { ArrowRight } from 'lucide-react';
import { Progress } from '../ui/Progress';
import FormattedMoneyAmount from '../FormattedMoneyAmount';
import { StackedAvatars } from '../Avatar';

import { Button } from '../ui/Button';
import { FormattedMessage } from 'react-intl';
import { TabsList, TabsTrigger } from './DumbTabs';
Expand Down
12 changes: 6 additions & 6 deletions components/crowdfunding-redesign/FundraisingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ export function FundraisingPage() {
allowAttributes
transform={node => {
// Allow some iframes
const attrs = [].slice.call(node.attributes);
if (node.tagName === 'iframe') {
if (node.tagName.toLowerCase() === 'iframe') {
const src = node.getAttribute('src');
const parsedUrl = new URL(src);
const hostname = parsedUrl.hostname;
if (['youtube-nocookie.com', 'www.youtube-nocookie.com', 'anchor.fm'].includes(hostname)) {
const attributes = merge({}, ...attrs.map(({ name, value }) => ({ [name]: value })));
return (
<iframe
{...pick(attributes, ['width', 'height', 'frameborder', 'allowfullscreen'])}
title={attributes.title || 'Embed content'}
width={node.getAttribute('width')}
height={node.getAttribute('height')}
allowFullScreen={node.getAttribute('allowfullscreen') as any}
title={node.getAttribute('title') || 'Embed content'}
src={src}
/>
);
}
} else if (node.tagName === 'a') {
} else if (node.tagName.toLowerCase() === 'a') {
// Open links in new tab
node.setAttribute('target', '_blank');
node.setAttribute('rel', 'noopener noreferrer');
Expand Down
1 change: 0 additions & 1 deletion components/crowdfunding-redesign/Goal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { aggregateGoalAmounts } from './helpers';

import { Progress } from '../ui/Progress';
import FormattedMoneyAmount from '../FormattedMoneyAmount';
import { StackedAvatars } from '../Avatar';

// Naive implementation of Goals for prototype
export function Goal({ account }) {
Expand Down
3 changes: 1 addition & 2 deletions components/crowdfunding-redesign/Goals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { aggregateGoalAmounts } from './helpers';

import { Progress } from '../ui/Progress';
import FormattedMoneyAmount from '../FormattedMoneyAmount';
import { StackedAvatars } from '../Avatar';

import StackedAvatars from '../StackedAvatars';
// Naive implementation of Goals for prototype
export function Goals({ account }) {
if (!account) {
Expand Down
12 changes: 6 additions & 6 deletions pages/preview/[collectiveSlug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,22 @@ export default function ContributePage() {
allowAttributes
transform={node => {
// Allow some iframes
const attrs = [].slice.call(node.attributes);
if (node.tagName === 'iframe') {
if (node.tagName.toLowerCase() === 'iframe') {
const src = node.getAttribute('src');
const parsedUrl = new URL(src);
const hostname = parsedUrl.hostname;
if (['youtube-nocookie.com', 'www.youtube-nocookie.com', 'anchor.fm'].includes(hostname)) {
const attributes = merge({}, ...attrs.map(({ name, value }) => ({ [name]: value })));
return (
<iframe
{...pick(attributes, ['width', 'height', 'frameborder', 'allowfullscreen'])}
title={attributes.title || 'Embed content'}
width={node.getAttribute('width')}
height={node.getAttribute('height')}
allowFullScreen={node.getAttribute('allowfullscreen') as any}
title={node.getAttribute('title') || 'Embed content'}
src={src}
/>
);
}
} else if (node.tagName === 'a') {
} else if (node.tagName.toLowerCase() === 'a') {
// Open links in new tab
node.setAttribute('target', '_blank');
node.setAttribute('rel', 'noopener noreferrer');
Expand Down

0 comments on commit 62a6f0d

Please sign in to comment.