Skip to content

Commit

Permalink
pg: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ece committed Oct 6, 2024
1 parent 12857a4 commit 1a17605
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion anchor/src/client/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ export class BaseClient {
openfundsMetadataId: fundAccount.openfunds.toBase58(),
fundUri: `https://playground.glam.systems/products/${fundPDA}`,
//@ts-ignore
imageKey: (fundModel.shareClasses[0]?.id || fundPDA).toBase58(),
imageKey: (fundAccount.shareClasses[0] || fundPDA).toBase58(),
...this.getOpenfundsFromAccounts(fundAccount, openfundsAccount, [
firstShareClass,
]),
Expand Down
34 changes: 20 additions & 14 deletions playground/src/app/access/components/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DataTableColumnHeader } from "./data-table-column-header";
import { DataTableRowActions } from "./data-table-row-actions";
import Sparkle from "../../../utils/Sparkle";
import TruncateAddress from "@/utils/TruncateAddress";
import { ExplorerLink } from "@/components/ExplorerLink";

const tagColors: Record<string, string> = {
stake:
Expand All @@ -28,24 +29,29 @@ interface KeyData {

// Use the defined type in ColumnDef
export const columns: ColumnDef<KeyData>[] = [
{
accessorKey: "label",
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Label" />
),
cell: ({ row }) => (
<div className="w-[100px] truncate">{row.getValue("label")}</div>
),
enableSorting: true,
enableHiding: false,
},
// {
// accessorKey: "label",
// header: ({ column }) => (
// <DataTableColumnHeader column={column} title="Label" />
// ),
// cell: ({ row }) => (
// <div className="w-[100px] truncate">{row.getValue("label")}</div>
// ),
// enableSorting: true,
// enableHiding: false,
// },
{
accessorKey: "pubkey",
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Key" />
),
cell: ({ row }) => (
<div className="w-[100px] truncate">{row.getValue("pubkey")}</div>
<div className="w-[100px]">
<ExplorerLink
path={`/account/${row.getValue("pubkey")}`}
label={row.getValue("pubkey")}
/>
</div>
),
enableSorting: false,
enableHiding: false,
Expand All @@ -58,12 +64,12 @@ export const columns: ColumnDef<KeyData>[] = [
cell: ({ row }) => {
const tags = row.getValue("tags") as KeyData["tags"];
return (
<div className="flex space-x-2">
<div className="space-x-2">
{tags.map((tag) => (
<Badge
key={tag}
variant="default"
className={`pointer-events-none capitalize font-normal rounded-none dark:bg-opacity-25 ${tagColors[tag]}`}
className={`my-1 pointer-events-none capitalize font-normal rounded-none dark:bg-opacity-25 ${tagColors[tag]}`}
>
{tag}
</Badge>
Expand Down
4 changes: 3 additions & 1 deletion playground/src/components/ExplorerLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function ExplorerLink({
explorer?: string;
}) {
const cluster = useCluster();
console.log(cluster);
let href = cluster.getExplorerUrl(path);
if (explorer == "solana.fm") {
href = href
Expand All @@ -35,6 +34,9 @@ export function ExplorerLink({
href={href}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => {
e.stopPropagation();
}}
className={className ? className : `link font-mono`}
>
{ellipsify(label)}
Expand Down

0 comments on commit 1a17605

Please sign in to comment.