this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

only link schema for $type fields

Juliet 1cf8db5f 2408254c

+8 -7
+8 -7
src/components/json.tsx
··· 14 14 mimeType: string; 15 15 } 16 16 17 - const JSONString = ({ data }: { data: string }) => { 17 + const JSONString = ({ data, isType }: { data: string; isType?: boolean }) => { 18 18 const navigate = useNavigate(); 19 19 20 20 const isURL = ··· 54 54 <A class="text-blue-400 hover:underline active:underline" href={`/at://${part}`}> 55 55 {part} 56 56 </A> 57 - : isNsid(part.split("#")[0]) ? 57 + : isNsid(part.split("#")[0]) && isType ? 58 58 <button 59 59 type="button" 60 60 onClick={() => handleClick(part)} ··· 135 135 "invisible h-0": !show(), 136 136 }} 137 137 > 138 - <JSONValue data={value} repo={repo} /> 138 + <JSONValue data={value} repo={repo} isType={key === "$type" ? true : undefined} /> 139 139 </span> 140 140 </span> 141 141 ); ··· 220 220 ); 221 221 }; 222 222 223 - export const JSONValue = ({ data, repo }: { data: JSONType; repo: string }) => { 224 - if (typeof data === "string") return <JSONString data={data} />; 223 + export const JSONValue = (props: { data: JSONType; repo: string; isType?: boolean }) => { 224 + const data = props.data; 225 + if (typeof data === "string") return <JSONString data={data} isType={props.isType} />; 225 226 if (typeof data === "number") return <JSONNumber data={data} />; 226 227 if (typeof data === "boolean") return <JSONBoolean data={data} />; 227 228 if (data === null) return <JSONNull />; 228 - if (Array.isArray(data)) return <JSONArray data={data} repo={repo} />; 229 - return <JSONObject data={data} repo={repo} />; 229 + if (Array.isArray(data)) return <JSONArray data={data} repo={props.repo} />; 230 + return <JSONObject data={data} repo={props.repo} />; 230 231 }; 231 232 232 233 export type JSONType = string | number | boolean | null | { [x: string]: JSONType } | JSONType[];