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: changes all instance of Neymar to Neynar #1009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const contentSecurityPolicy = {
'https://browser-intake-datadoghq.com', // datadog
'https://*.datadoghq.com', //datadog
'https://translate.googleapis.com', // Let user translate our website
'https://sdk-api.neynar.com/', // Neymar API
'https://sdk-api.neynar.com/', // Neynar API
'https://unpkg.com/@lottiefiles/[email protected]/dist/dotlottie-player.wasm', // lottie player
`https://${process.env.NEXT_PUBLIC_PINATA_GATEWAY_URL}`,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useUsernameProfile } from 'apps/web/src/components/Basenames/UsernameProfileContext';
import UsernameProfileSectionTitle from 'apps/web/src/components/Basenames/UsernameProfileSectionTitle';
import NeymarCast from 'apps/web/src/components/NeymarCast';
import NeynarCast from 'apps/web/src/components/NeynarCast';
import useReadBaseEnsTextRecords from 'apps/web/src/hooks/useReadBaseEnsTextRecords';

export default function UsernameProfileCasts() {
Expand All @@ -22,7 +22,7 @@ export default function UsernameProfileCasts() {
<ul className="mt-6 grid grid-cols-1 gap-8 md:grid-cols-2">
{casts.map((cast) => (
<li key={cast}>
<NeymarCast identifier={cast} type="url" />
<NeynarCast identifier={cast} type="url" />
</li>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import ImageWithLoading from 'apps/web/src/components/ImageWithLoading';
import NeymarFrame from 'apps/web/src/components/NeymarFrame';
import { fetchCast, NeymarCastData } from 'apps/web/src/utils/frames';
import NeynarFrame from 'apps/web/src/components/NeynarFrame';
import { fetchCast, NeynarCastData } from 'apps/web/src/utils/frames';
import Link from 'next/link';
import { MouseEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import Hls from 'hls.js';
Expand Down Expand Up @@ -102,14 +102,14 @@ function ParagraphWithLinks({ text }: { text: string }) {
return textWithLinks;
}

export default function NeymarCast({
export default function NeynarCast({
identifier,
type,
}: {
identifier: string;
type: 'url' | 'hash';
}) {
const [data, setData] = useState<NeymarCastData['cast']>();
const [data, setData] = useState<NeynarCastData['cast']>();
const { logError } = useErrors();
useEffect(() => {
fetchCast({ type, identifier })
Expand Down Expand Up @@ -208,7 +208,7 @@ export default function NeymarCast({
<ul className="flex flex-col gap-2">
{frames.map((frame) => (
<li key={frame.title}>
<NeymarFrame frame={frame} hash={hash} />
<NeynarFrame frame={frame} hash={hash} />
</li>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import ImageWithLoading from 'apps/web/src/components/ImageWithLoading';
import { NeynarFrame } from 'apps/web/src/utils/frames';

// Frame displayed from Neymar API data
// Frame displayed from Neynar API data
// No buttons or interactions for now, just a link to the frame source
export default function NeymarFrame({ frame }: { hash: string; frame: NeynarFrame }) {
export default function NeynarFrame({ frame }: { hash: string; frame: NeynarFrame }) {
return (
<div className="overflow-hidden rounded-3xl border border-gray-40/20">
{frame.frames_url && (
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/utils/frames.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { encodeUrlQueryParams } from 'apps/web/src/utils/urls';

// TODO: There's way more that neymar returns but we only need this for now
export type NeymarButton = {
// TODO: There's way more that Neynar returns but we only need this for now
export type NeynarButton = {
action_type: string;
index: number;
post_url: string;
Expand All @@ -10,7 +10,7 @@ export type NeymarButton = {
};

export type NeynarFrame = {
buttons: NeymarButton[];
buttons: NeynarButton[];
frames_url: string;
image: string;
image_aspect_ratio: string;
Expand All @@ -24,11 +24,11 @@ export type NeynarEmbed = {
url: string;
};

export type NeymarEmbedCast = {
export type NeynarEmbedCast = {
cast_id: { fid: number; hash: string };
};

export type NeymarCastData = {
export type NeynarCastData = {
cast: {
frames: NeynarFrame[];
embeds: NeynarEmbed[];
Expand Down Expand Up @@ -60,7 +60,7 @@ export async function fetchCast({
};
try {
const response = await fetch(url, options);
const data = (await response.json()) as NeymarCastData;
const data = (await response.json()) as NeynarCastData;
return data.cast;
} catch (error) {}
}