From 291a82402a5347194eef50dc1239a743199de544 Mon Sep 17 00:00:00 2001 From: Sean Munson Date: Sat, 25 Jan 2025 02:44:02 -0500 Subject: [PATCH 1/5] add anchor --- src/common-components/conditional-anchor.jsx | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/common-components/conditional-anchor.jsx diff --git a/src/common-components/conditional-anchor.jsx b/src/common-components/conditional-anchor.jsx new file mode 100644 index 0000000..0b7ece7 --- /dev/null +++ b/src/common-components/conditional-anchor.jsx @@ -0,0 +1,38 @@ +import { jsx } from "@emotion/react"; +import React from "react"; + +/** + * @param {{ +* target:string, +* href: string, +* condition: boolean, +* className?: string, +* children?:React.ReactNode, +* }} +*/ + +export function ConditionalAnchor(props){ + + const {target, + href, + condition, + className, + children} = props; + + if (condition){ + return( + + {children} + + ) + }else{ + <> + {children} + + } + + + + + +} \ No newline at end of file From a0f2ca5cb1df54886c026dd8eb43d96ae108622b Mon Sep 17 00:00:00 2001 From: Sean Munson Date: Sat, 25 Jan 2025 12:34:33 -0500 Subject: [PATCH 2/5] Added to Lists --- src/common-components/conditional-anchor.jsx | 1 + src/detail-panels/lists/list-view.jsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common-components/conditional-anchor.jsx b/src/common-components/conditional-anchor.jsx index 0b7ece7..b140e78 100644 --- a/src/common-components/conditional-anchor.jsx +++ b/src/common-components/conditional-anchor.jsx @@ -8,6 +8,7 @@ import React from "react"; * condition: boolean, * className?: string, * children?:React.ReactNode, +* style?:CSSProperties * }} */ diff --git a/src/detail-panels/lists/list-view.jsx b/src/detail-panels/lists/list-view.jsx index dc116e8..15bd4e5 100644 --- a/src/detail-panels/lists/list-view.jsx +++ b/src/detail-panels/lists/list-view.jsx @@ -8,6 +8,7 @@ import { AccountShortEntry } from '../../common-components/account-short-entry'; import { FormatTimestamp } from '../../common-components/format-timestamp'; import './list-view.css'; +import { ConditionalAnchor } from '../../common-components/conditional-anchor'; /** * @param {{ @@ -63,9 +64,9 @@ function ListViewEntry({ className, entry }) { {/*
*/}
- + {entry.name} - + {entry.spam && ( Date: Sat, 25 Jan 2025 20:26:34 -0500 Subject: [PATCH 3/5] make condtion proper --- src/common-components/conditional-anchor.jsx | 13 ++++++++----- src/detail-panels/lists/list-view.jsx | 8 ++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/common-components/conditional-anchor.jsx b/src/common-components/conditional-anchor.jsx index b140e78..eb11ea9 100644 --- a/src/common-components/conditional-anchor.jsx +++ b/src/common-components/conditional-anchor.jsx @@ -18,18 +18,21 @@ export function ConditionalAnchor(props){ href, condition, className, - children} = props; - + children, + style,} = props; + console.log(condition) if (condition){ return( - + {children} ) }else{ - <> + return( + {children} - + + ); } diff --git a/src/detail-panels/lists/list-view.jsx b/src/detail-panels/lists/list-view.jsx index 15bd4e5..be64feb 100644 --- a/src/detail-panels/lists/list-view.jsx +++ b/src/detail-panels/lists/list-view.jsx @@ -9,6 +9,7 @@ import { FormatTimestamp } from '../../common-components/format-timestamp'; import './list-view.css'; import { ConditionalAnchor } from '../../common-components/conditional-anchor'; +import { useResolveHandleOrDid } from '../../api'; /** * @param {{ @@ -47,7 +48,9 @@ function ListViewEntry({ className, entry }) { }; const opacity = entry.spam? 0.4 : 1; - + console.log('list-view', entry.name, entry.url, entry.status, entry); + const resolved = useResolveHandleOrDid(entry.did); + console.log(resolved); return (
  • @@ -64,7 +67,8 @@ function ListViewEntry({ className, entry }) { {/*
    */}
    - + + {entry.name} {entry.spam && ( From 5887d397ed9d27a90115a4db9eb153273846952b Mon Sep 17 00:00:00 2001 From: Sean Munson Date: Sat, 25 Jan 2025 20:43:05 -0500 Subject: [PATCH 4/5] add conditional anchor to packs --- src/detail-panels/packs/pack-view.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/detail-panels/packs/pack-view.jsx b/src/detail-panels/packs/pack-view.jsx index feaf0ab..a98e597 100644 --- a/src/detail-panels/packs/pack-view.jsx +++ b/src/detail-panels/packs/pack-view.jsx @@ -3,6 +3,7 @@ import { FormatTimestamp } from '../../common-components/format-timestamp'; import {useResolveDidToProfile} from '../../api/resolve-handle-or-did'; import "./list-packs.css" +import { ConditionalAnchor } from '../../common-components/conditional-anchor'; /** * @param {{ @@ -35,11 +36,12 @@ export function PackView({packs, className=""}){
    - {originator.data?.avatarUrl - ? ( ) - :( - ) - } + + + Date: Tue, 28 Jan 2025 04:09:39 -0500 Subject: [PATCH 5/5] address comment --- src/detail-panels/packs/pack-view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detail-panels/packs/pack-view.jsx b/src/detail-panels/packs/pack-view.jsx index a98e597..2283c2e 100644 --- a/src/detail-panels/packs/pack-view.jsx +++ b/src/detail-panels/packs/pack-view.jsx @@ -37,7 +37,7 @@ export function PackView({packs, className=""}){