Skip to content

Commit

Permalink
problem: can't see who created problem
Browse files Browse the repository at this point in the history
  • Loading branch information
gsovereignty committed Jan 19, 2024
1 parent 8fd077b commit a0bdd44
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/components/comments/CommentUser.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<script lang="ts">
import { ndk_profiles } from "$lib/stores/event_sources/relays/ndk";
import { profiles } from "$lib/stores/hot_resources/profiles";
import type { NDKUser } from "@nostr-dev-kit/ndk";
import { InlineLoading } from "carbon-components-svelte";
import { Launch } from "carbon-icons-svelte";
import pl from "date-fns/locale/pl";
import { derived, writable } from "svelte/store";
export let pubkey: string;
export let large: boolean = false;
export let profile:NDKUser|undefined = undefined;
let styletag = "color: #fb923c";
Expand Down
3 changes: 1 addition & 2 deletions src/components/elements/Profile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import CommentUser from "../comments/CommentUser.svelte";
export let profile: NDKUser;
export let num = 0;
export let tiny = false;
let blankAvatar =
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxITEhUQEBASFhUQFRUVFRUXFRUVFRcQFRUWFxUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKBQUFDgUFDisZExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIANgA6QMBIgACEQEDEQH/xAAaAAACAwEBAAAAAAAAAAAAAAAAAQIDBQQG/8QAORAAAgECBAMFBwMDAwUAAAAAAAECAxEEITFBBRJRYXGRobETIjKBwdHwBhThI0JiUoLxFWNyosL/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A8HEYkMAABgIBgAAAAAhgAgAAGMQ0AxorqVYx+KSXeyCxlP8A1oDpQznhjKbyU1429ToQAiSEkNIBomRS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v4nnal2deFpO12BuSk5Z6I5alFM5Z4m2g/3V0BGrFL7nHUrJaFteqzNrVALfa2le5p4DE88unaYV2a/Cab12A6cddPXLTUzKr3RocQgr95nv8uBWpslGlckodC+jECqNIOQ6lEpqpX1AqlEqky2b7yrmARCRK47doEYRudFKJVAuTA6YxRLkRTGRPn/MgJjAAGhgAFuHoOTy+bO2GHSyXiAAU4qaXeZkm5OwwAvpYdLUVaeyAAOfkuWuFtAACib/AOdjkq2WwAByzld5Hp8HTcKalbJryGAHHi5t/mxxyWYABOC3zOmIABGT32/NiqrLpuAAVMrf5sAAReRFsYANFiYABZBkuYAA/9k=";
let avatarUrl = blankAvatar;
Expand All @@ -33,8 +34,6 @@
<div style="margin:2%;">
<ImageLoader fadeIn ratio="1x1" src={avatarUrl} />
</div>
<!-- <img src={profile.profile?.image} width="100%" height="auto" alt="[profile pic here]"> -->
<!-- <Avatar ndk={$ndk} user={profile}/> -->
</Tile>
</AspectRatio>
</Column>
Expand Down
6 changes: 5 additions & 1 deletion src/components/novoproblems/ProblemView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
ExtendedBaseType,
} from "@nostr-dev-kit/ndk-svelte";
import { comments } from "$lib/stores/hot_resources/comments";
import Profiles from "./ProfileSmall.svelte";
export let problem: Problem;
Expand Down Expand Up @@ -227,7 +228,10 @@
>{/if}
<Tag type="high-contrast" icon={Lightning}>0 sats</Tag>
</Tile>
<Tile style="margin-top:2px;">B</Tile>
<Tile style="margin-top:2px;">
{#each problem.Pubkeys as pubkey}<Profiles {pubkey} />{/each}

</Tile>
</Tile>
</Column></Row
></Tile
Expand Down
47 changes: 47 additions & 0 deletions src/components/novoproblems/ProfileSmall.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<script lang="ts">
import { profiles } from "$lib/stores/hot_resources/profiles";
import {
AspectRatio,
Column,
Row,
Tile
} from "carbon-components-svelte";
import CommentUser from "../comments/CommentUser.svelte";
export let pubkey: string;
let blankAvat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lKzKcRLoZ74gmQnjV1AoxvU5aeL2LK9ZPcz6i6AaXtky6niZLSTXzyMaM2i6NdgblPiU1qk/I6IcUjvFruzMCNYtjUQHpKWJhLSS7tH4Mt5l1R5m6ADuRISGA0MAAAAEADALAADsEYNuyV2AIspwbdkdNLAPWbt2bkpYiMMoL87QJrlpR5pam3g03Ri3q8389DyfPzSvUeS2Nef6ijlFRbW76AQ41hfcc1/bmeNnUd+891PidKXu3+JZ5eR5GtgW6vKtL+QHZgsB/QnVk7L1Oahz291O3XY33KLjGnJe5T6bs5MZiKbVoO3ZoBh1cLJu8pJeZNYJWv7RvuJYjqc0ZtAWPDxXXxDkj0I3YuVgS90ceXoRULk4xAmqMHqkS/Z02V2IyfRgFXBxX9zOWbS0lcVe7Ko4RsC39zYP3ZJYAf7EDZJIiNASAAAAAkkAJFkKbei+ZOFO2cvD7lOKrytbRdAJNwXxyfcvuzswvEaayhC3bv4nnal2deFpO12BuSk5Z6I5alFM5Z4m2g/3V0BGrFL7nHUrJaFteqzNrVALfa2le5p4DE88unaYV2a/Cab12A6cddPXLTUzKr3RocQgr95nv8uBWpslGlckodC+jECqNIOQ6lEpqpX1AqlEqky2b7yrmARCRK47doEYRudFKJVAuTA6YxRLkRTGRPn/MgJjAAGhgAFuHoOTy+bO2GHSyXiAAU4qaXeZkm5OwwAvpYdLUVaeyAAOfkuWuFtAACib/AOdjkq2WwAByzld5Hp8HTcKalbJryGAHHi5t/mxxyWYABOC3zOmIABGT32/NiqrLpuAAVMrf5sAAReRFsYANFiYABZBkuYAA/9k=";
function getAvatar(pubkeyString: string) {
let p = $profiles.get(pubkeyString);
console.log(p?.npub);
if (p) {
if (p.profile) {
if (p.profile.image) {
if (p.profile.image.length > 0) {
return p.profile.image;
}
}
}
}
return blankAvatar;
}
</script>

<Tile
light
style="max-width:120px; height:100%;overflow:hidden;margin:0;padding:0;"
>
<Row>
<Column>
<AspectRatio ratio="1x1" style="width:100%;">
<div style="margin:0;">
<img width="100%" height="auto" src={getAvatar(pubkey)} />
</div>
</AspectRatio>
<div style="text-align:center;overflow:hidden;">
<CommentUser {pubkey} />
</div>
</Column>
</Row>
</Tile>

0 comments on commit a0bdd44

Please sign in to comment.