Skip to content

Commit

Permalink
fix: intent components
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic-maury committed Jan 18, 2025
1 parent 03a3ba7 commit c0575d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Common/ThreadsIntent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export function ThreadsIntent(props: {
} & ActionIconProps) {
const { t } = useTranslation('common');

const { text, url, hashtags } = props;
const threadsIntent = encodeURI(`https://www.threads.net/intent/post?url=${url}&text=${text} ${hashtags.map((hashtag) => `#${hashtag}`).join(' ')}`);
const { text, url } = props;
const threadsIntent = encodeURI(`https://www.threads.net/intent/post?url=${url}&`) + `text=${text}`;

return (

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Common/TwitterIntent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export function TwitterIntent(props: {
const { t } = useTranslation('common');

const { text, url, hashtags } = props;
const twitterIntent = encodeURI(`https://twitter.com/intent/tweet?size=large&text=${text}&url=${url}&hashtags=${hashtags.join(',')}&related=RealTPlatform`);
const twitterIntent = encodeURI(`https://twitter.com/intent/tweet?size=large&url=${url}`)
+ `&text=${text}&hashtags=${hashtags.join(',')}&related=RealTPlatform`;

return (
<ActionIcon
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/Settings/Help/HelpContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import MadeBy from "../../Common/MadeBy";
import { ThreadsIntent } from "../../Common/ThreadsIntent";
import { TwitterIntent } from "../../Common/TwitterIntent";

const URL = window.location.origin + window.location.pathname;

export function HelpContent() {
const { t } = useTranslation('common', { keyPrefix: 'help' });

Expand Down Expand Up @@ -39,13 +41,13 @@ export function HelpContent() {
<TwitterIntent
size="xl"
text="Discover RealT properties like never before with this amazing interactive map!"
url={window.location.href}
url={URL}
hashtags={['RealT', 'RealToken', 'RPM', 'RealtPropertyMap']}
/>
<ThreadsIntent
size="xl"
text="Discover RealT properties like never before with this amazing interactive map!"
url={window.location.href}
url={URL}
hashtags={['RealT', 'RealToken', 'RPM', 'RealtPropertyMap']}
/>
</div>
Expand Down

0 comments on commit c0575d8

Please sign in to comment.