Merge pull request #5704 from urbit/james/group-notifications

groups: fix join/leave notification toggle
This commit is contained in:
Hunter Miller 2022-04-08 12:04:20 -05:00 committed by GitHub
commit 0828ae6296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -1,7 +1,7 @@
import { import {
LoadingSpinner, StatelessToggleSwitchField as Toggle, Box,
Icon,
Text LoadingSpinner, StatelessToggleSwitchField as Toggle
} from '@tlon/indigo-react'; } from '@tlon/indigo-react';
import React, { ReactElement } from 'react'; import React, { ReactElement } from 'react';
import { useStatelessAsyncClickable } from '~/logic/lib/useStatelessAsyncClickable'; import { useStatelessAsyncClickable } from '~/logic/lib/useStatelessAsyncClickable';
@ -22,11 +22,17 @@ export function StatelessAsyncToggle({
} = useStatelessAsyncClickable(onClick, name); } = useStatelessAsyncClickable(onClick, name);
return state === 'error' ? ( return state === 'error' ? (
<Text>Error</Text> <Box width={5} textAlign='center' title='Something went wrong...'>
<Icon icon='ExclaimationMarkBold' />
</Box>
) : state === 'loading' ? ( ) : state === 'loading' ? (
<LoadingSpinner foreground={'white'} background="gray" /> <Box width={5} textAlign='center'>
<LoadingSpinner foreground={'white'} background="gray" />
</Box>
) : state === 'success' ? ( ) : state === 'success' ? (
<Text mx={2}>Done</Text> <Box width={5} textAlign='center' title='Success'>
<Icon icon='CheckmarkBold' />
</Box>
) : ( ) : (
<Toggle onClick={handleClick} {...rest} /> <Toggle onClick={handleClick} {...rest} />
); );

View File

@ -34,8 +34,8 @@ export function GroupPersonalSettings(props: {
> >
<StatelessAsyncToggle selected={watching} onClick={onClick} /> <StatelessAsyncToggle selected={watching} onClick={onClick} />
<Col> <Col>
<Label>Notify me on group activity</Label> <Label>Notify me on participant activity</Label>
<Label mt={2} gray>Send me notifications when this group changes</Label> <Label mt={2} gray>When a user joins or leaves this group, send me a notification</Label>
</Col> </Col>
</BaseLabel> </BaseLabel>
</Col> </Col>