Skip to content

Commit

Permalink
refactor: rename SelectPeopleUI to SelectPeopleAndGroupsUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Sep 18, 2019
1 parent 7dcce7b commit 6f5ab01
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/components/InjectedComponents/AdditionalPostBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { useCallback, useRef, useState } from 'react'
import { SelectPeopleUI } from '../shared/SelectPeople'
import { SelectPeopleAndGroupsUI } from '../shared/SelectPeopleAndGroups'
import { useCapturedInput } from '../../utils/hooks/useCapturedEvents'
import { Avatar } from '../../utils/components/Avatar'
import Services from '../../extension/service'
Expand Down Expand Up @@ -68,7 +68,7 @@ export function AdditionalPostBoxUI(props: Props) {
</Paper>
<Divider />
<Paper elevation={2}>
<SelectPeopleUI
<SelectPeopleAndGroupsUI
ignoreMyself
items={availableTarget}
onSetSelected={selectPeople}
Expand Down
4 changes: 2 additions & 2 deletions src/components/InjectedComponents/SelectPeopleDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useState } from 'react'
import { SelectPeopleUI } from '../shared/SelectPeople'
import { SelectPeopleAndGroupsUI } from '../shared/SelectPeopleAndGroups'
import { geti18nString } from '../../utils/i18n'
import { makeStyles } from '@material-ui/styles'
import {
Expand Down Expand Up @@ -54,7 +54,7 @@ export function SelectPeopleDialog(props: Props) {
maxWidth="sm">
<DialogTitle className={classes.title}>{geti18nString('share_to')}</DialogTitle>
<DialogContent className={classes.content}>
<SelectPeopleUI
<SelectPeopleAndGroupsUI
frozenSelected={props.alreadySelectedPreviously}
disabled={committed}
items={props.people}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Welcomes/1a1a.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useState } from 'react'
import { geti18nString } from '../../utils/i18n'
import { Button, makeStyles, Typography, Theme } from '@material-ui/core'
import WelcomeContainer from './WelcomeContainer'
import { SelectPeopleUI, isGroup } from '../shared/SelectPeople'
import { SelectPeopleAndGroupsUI, isGroup } from '../shared/SelectPeopleAndGroups'
import { Person } from '../../database'
import Navigation from './Navigation/Navigation'

Expand Down Expand Up @@ -35,7 +35,7 @@ export default function Welcome({ next, identities, linkNewSocialNetworks, back
<WelcomeContainer className={classes.paper}>
<Navigation back={back} />
<Typography variant="h5">{geti18nString('welcome_1a1_title')}</Typography>
<SelectPeopleUI<Person>
<SelectPeopleAndGroupsUI<Person>
classes={{ root: classes.select }}
hideSelectAll
hideSelectNone
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/ChooseIdentity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore'
import { Avatar } from '../../utils/components/Avatar'
import { Person } from '../../database'
import { List, ListItem, ListItemIcon, ListItemText, ListSubheader } from '@material-ui/core'
import { PersonOrGroupInList } from './SelectPeople'
import { PersonOrGroupInList } from './SelectPeopleAndGroups'
import { getActivatedUI } from '../../social-network/ui'
import { useCurrentIdentity, useMyIdentities } from '../DataSource/useActivatedUI'
import { PersonIdentifier } from '../../database/type'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import MuiAvatar from '@material-ui/core/Avatar/Avatar'
import { Chip } from '@material-ui/core'
import { Person, Group } from '../../../database'
import { geti18nString } from '../../../utils/i18n'
import { isGroup, isPerson } from './SelectPeopleUI'
import { isGroup, isPerson } from './SelectPeopleAndGroupsUI'

interface Props {
onDelete?(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import GroupIcon from '@material-ui/icons/Group'
import { useFriendsList } from '../../DataSource/useActivatedUI'
import { PersonIdentifier } from '../../../database/type'
import { geti18nString, useIntlListFormat } from '../../../utils/i18n'
import { isGroup } from './SelectPeopleUI'
import { isGroup } from './SelectPeopleAndGroupsUI'

interface Props {
onClick(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const useStyles = makeStyles({
input: { flex: 1 },
button: { marginLeft: 8, padding: '2px 6px' },
})
export function SelectPeopleUI<ServeType extends Group | Person = PersonOrGroup>(
export function SelectPeopleAndGroupsUI<ServeType extends Group | Person = PersonOrGroup>(
props: SelectPeopleAndGroupsUIProps<ServeType>,
) {
const items: PersonOrGroup[] = props.items
Expand Down Expand Up @@ -145,7 +145,7 @@ export function SelectPeopleUI<ServeType extends Group | Person = PersonOrGroup>
)
}
}
SelectPeopleUI.defaultProps = {
SelectPeopleAndGroupsUI.defaultProps = {
frozenSelected: [],
}
function FrozenChip(item: PersonOrGroup) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './SelectPeopleUI'
export * from './SelectPeopleAndGroupsUI'
export * from './PersonOrGroupInList'
export * from './PersonOrGroupInChip'
4 changes: 2 additions & 2 deletions src/stories/Injections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { useShareMenu } from '../components/InjectedComponents/SelectPeopleDialo
import { sleep } from '../utils/utils'
import { Button, Paper } from '@material-ui/core'
import { RenderInShadowRootWrapper } from '../utils/jss/renderInShadowRoot'
import { demoPeople, demoGroup } from './demoPeople'
import { demoPeople, demoGroup } from './demoPeopleOrGroups'
import { PostCommentDecrypted } from '../components/InjectedComponents/PostComments'
import { CommentBox } from '../components/InjectedComponents/CommentBox'
import { DecryptionProgress } from '../extension/background-script/CryptoServices/decryptFrom'
import { PersonOrGroupInChip, PersonOrGroupInList } from '../components/shared/SelectPeople'
import { PersonOrGroupInChip, PersonOrGroupInList } from '../components/shared/SelectPeopleAndGroups'

storiesOf('Injections', module)
.add('PersonOrGroupInChip', () => demoGroup.map(g => <PersonOrGroupInChip item={g} />))
Expand Down
2 changes: 1 addition & 1 deletion src/stories/OptionsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import Identity from '../components/Dashboard/Identity'
import { demoPeople } from './demoPeople'
import { demoPeople } from './demoPeopleOrGroups'
import { action } from '@storybook/addon-actions'
import Dashboard from '../components/Dashboard/Dashboard'
import Privacy from '../extension/options-page/Privacy'
Expand Down
2 changes: 1 addition & 1 deletion src/stories/Welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { action } from '@storybook/addon-actions'
import { BannerUI } from '../components/Welcomes/Banner'
import { Dialog } from '@material-ui/core'
import QRScanner from '../components/Welcomes/QRScanner'
import { demoPeople } from './demoPeople'
import { demoPeople } from './demoPeopleOrGroups'

const ResponsiveDialog = Dialog
storiesOf('Welcome', module)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/stories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './OptionsPage'
import './Injections'
import './shared'
import { definedSocialNetworkUIs, defineSocialNetworkUI, activateSocialNetworkUI } from '../social-network/ui'
import { demoPeople, demoGroup } from './demoPeople'
import { demoPeople, demoGroup } from './demoPeopleOrGroups'
import { ValueRef } from '@holoflows/kit/es'
import { PersonIdentifier } from '../database/type'
import { emptyDefinition } from '../social-network/defaults/emptyDefinition'
Expand Down

0 comments on commit 6f5ab01

Please sign in to comment.