Update LabelsOnMe dialog

This commit is contained in:
Eric Bailey
2024-02-26 18:23:49 -06:00
parent 304b6f4f00
commit 0dc1cdfdcf
8 changed files with 104 additions and 227 deletions
+8 -7
View File
@@ -8,8 +8,10 @@ import {useSession} from '#/state/session'
import {atoms as a} from '#/alf'
import {Button, ButtonText, ButtonIcon, ButtonSize} from '#/components/Button'
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo'
import {useOpenGlobalDialog} from '#/components/dialogs'
import {LabelsOnMeDialog} from '#/components/dialogs/LabelsOnMe'
import {
LabelsOnMeDialog,
useLabelsOnMeDialogControl,
} from '#/components/LabelsOnMe'
export function LabelsOnMe({
details,
@@ -25,7 +27,7 @@ export function LabelsOnMe({
const {_} = useLingui()
const {currentAccount} = useSession()
const isAccount = 'did' in details
const openDialog = useOpenGlobalDialog()
const control = useLabelsOnMeDialogControl()
if (!labels || !currentAccount) {
return null
@@ -39,16 +41,15 @@ export function LabelsOnMe({
return (
<View style={[a.flex_row, style]}>
<LabelsOnMeDialog control={control} subject={details} labels={labels} />
<Button
variant="solid"
color="secondary"
size={size || 'small'}
label={_(msg`View information about these labels`)}
onPress={() => {
openDialog(LabelsOnMeDialog, {
subject: details,
labels: labels!,
})
control.open()
}}>
<ButtonIcon position="left" icon={CircleInfo} />
<ButtonText>
-3
View File
@@ -29,7 +29,6 @@ import {useSession} from '#/state/session'
import {useCloseAnyActiveElement} from '#/state/util'
import * as notifications from 'lib/notifications/notifications'
import {Outlet as PortalOutlet} from '#/components/Portal'
import {GlobalDialog} from '#/components/dialogs'
function ShellInner() {
const isDrawerOpen = useIsDrawerOpen()
@@ -96,8 +95,6 @@ function ShellInner() {
<Composer winHeight={winDim.height} />
<ModalsContainer />
<Lightbox />
<GlobalDialog />
<PortalOutlet />
</>
)
-3
View File
@@ -16,7 +16,6 @@ import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell'
import {useCloseAllActiveElements} from '#/state/util'
import {useWebBodyScrollLock} from '#/lib/hooks/useWebBodyScrollLock'
import {Outlet as PortalOutlet} from '#/components/Portal'
import {GlobalDialog} from '#/components/dialogs'
function ShellInner() {
const isDrawerOpen = useIsDrawerOpen()
@@ -42,8 +41,6 @@ function ShellInner() {
<Composer winHeight={0} />
<ModalsContainer />
<Lightbox />
<GlobalDialog />
<PortalOutlet />
{!isDesktop && isDrawerOpen && (