-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
313 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { XRPCError } from '@mary/bluesky-client/xrpc'; | ||
import type { AppBskyActorProfile, At } from '../atp-schema'; | ||
import { multiagent } from '../globals/agent'; | ||
|
||
export const upsertProfile = async ( | ||
uid: At.DID, | ||
updater: (existing: AppBskyActorProfile.Record | undefined) => AppBskyActorProfile.Record, | ||
) => { | ||
const agent = await multiagent.connect(uid); | ||
|
||
const existing = await agent.rpc | ||
.get('com.atproto.repo.getRecord', { | ||
params: { | ||
repo: uid, | ||
collection: 'app.bsky.actor.profile', | ||
rkey: 'self', | ||
}, | ||
}) | ||
.catch((err) => { | ||
if (err instanceof XRPCError) { | ||
if (err.kind === 'InvalidRequest') { | ||
return undefined; | ||
} | ||
} | ||
|
||
return Promise.reject(err); | ||
}); | ||
|
||
const updated = updater(existing?.data.value as AppBskyActorProfile.Record | undefined); | ||
|
||
await agent.rpc.call('com.atproto.repo.putRecord', { | ||
data: { | ||
repo: uid, | ||
collection: 'app.bsky.actor.profile', | ||
rkey: 'self', | ||
record: updated, | ||
swapRecord: existing?.data.cid, | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { JSX } from 'solid-js'; | ||
|
||
export interface ViewHeaderProps { | ||
children?: JSX.Element; | ||
} | ||
|
||
export const ViewHeader = (props: ViewHeaderProps) => { | ||
return ( | ||
<div class="flex h-13 min-w-0 shrink-0 items-center gap-2 border-b border-divider px-4"> | ||
{props.children} | ||
</div> | ||
); | ||
}; | ||
|
||
export interface ViewHeadingProps { | ||
title: string; | ||
subtitle?: string; | ||
} | ||
|
||
export const ViewHeading = (props: ViewHeadingProps) => { | ||
return ( | ||
<div class="flex min-w-0 grow flex-col gap-0.5"> | ||
<p class="overflow-hidden text-ellipsis whitespace-nowrap text-base font-bold leading-5"> | ||
{props.title} | ||
</p> | ||
|
||
<p class="overflow-hidden text-ellipsis whitespace-nowrap text-xs text-muted-fg empty:hidden"> | ||
{props.subtitle} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export interface ViewBodyProps { | ||
children?: JSX.Element; | ||
} | ||
|
||
export const ViewBody = (props: ViewBodyProps) => { | ||
return <div class="flex min-h-0 grow flex-col overflow-y-auto">{props.children}</div>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createIcon } from './_icon'; | ||
|
||
const PeopleOutlinedIcon = createIcon([ | ||
[ | ||
'M9 13.75c-2.34 0-7 1.17-7 3.5V19h14v-1.75c0-2.33-4.66-3.5-7-3.5M4.34 17c.84-.58 2.87-1.25 4.66-1.25s3.82.67 4.66 1.25zM9 12c1.93 0 3.5-1.57 3.5-3.5S10.93 5 9 5S5.5 6.57 5.5 8.5S7.07 12 9 12m0-5c.83 0 1.5.67 1.5 1.5S9.83 10 9 10s-1.5-.67-1.5-1.5S8.17 7 9 7m7.04 6.81c1.16.84 1.96 1.96 1.96 3.44V19h4v-1.75c0-2.02-3.5-3.17-5.96-3.44M15 12c1.93 0 3.5-1.57 3.5-3.5S16.93 5 15 5c-.54 0-1.04.13-1.5.35c.63.89 1 1.98 1 3.15s-.37 2.26-1 3.15c.46.22.96.35 1.5.35', | ||
], | ||
]); | ||
|
||
export default PeopleOutlinedIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.