Skip to content

Commit 7123555

Browse files
WIP
1 parent 4d19f6d commit 7123555

6 files changed

Lines changed: 14 additions & 13 deletions

File tree

shared/profile/add-to-team.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const Container = (ownProps: OwnProps) => {
184184
setSendNotification(true)
185185
setTeamProfileAddList([])
186186
loadTeamList()
187-
}, [loadTeamList, them])
187+
}, [them])
188188

189189
const onBack = () => {
190190
navigateUp()

shared/teams/container.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as C from '@/constants'
22
import * as Teams from '@/stores/teams'
33
import * as Kb from '@/common-adapters'
44
import type * as T from '@/constants/types'
5+
import type {RouteProps2} from '@/router-v2/route-params'
56
import Main from './main'
67
import {useTeamsSubscribe} from './subscriber'
78
import {useActivityLevels} from './common'
@@ -42,12 +43,11 @@ const orderTeams = (
4243
})
4344
}
4445

45-
type Props = {
46-
filter?: string
47-
sort?: T.Teams.TeamListSort
48-
}
46+
type Props = RouteProps2<'teamsRoot'>
4947

50-
const Connected = ({filter = '', sort = 'role'}: Props) => {
48+
const Connected = ({navigation, route}: Props) => {
49+
const filter = route.params?.filter ?? ''
50+
const sort = route.params?.sort ?? 'role'
5151
const data = Teams.useTeamsState(
5252
C.useShallow(s => {
5353
const {deletedTeams, activityLevels, teamMeta, dispatch} = s
@@ -86,7 +86,7 @@ const Connected = ({filter = '', sort = 'role'}: Props) => {
8686
onCreateTeam={onCreateTeam}
8787
onJoinTeam={onJoinTeam}
8888
deletedTeams={deletedTeams}
89-
onChangeSort={sortOrder => C.Router2.navigateAppend({name: 'teamsRoot', params: {filter, sort: sortOrder}}, true)}
89+
onChangeSort={sortOrder => navigation.setParams({...(route.params ?? {}), filter, sort: sortOrder})}
9090
sortOrder={sort}
9191
teams={teams}
9292
/>

shared/teams/get-options.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const useHeaderActions = () => {
1616
}
1717

1818
const TeamsFilter = () => {
19-
const {params} = useRoute<RootRouteProps<'teamsRoot'>>()
19+
const params = useRoute<RootRouteProps<'teamsRoot'>>().params ?? {}
2020
const navigation = useNavigation<NativeStackNavigationProp<RootParamList, 'teamsRoot'>>()
21-
const filterValue = params?.filter ?? ''
21+
const filterValue = params.filter ?? ''
2222
const numTeams = useTeamsState(s => s.teamMeta.size)
2323
const setFilter = (filter: string) => navigation.setParams({...params, filter})
2424
return numTeams >= 20 ? (

shared/teams/routes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ export const newModalRoutes = {
293293
teamInviteLinkJoin: C.makeScreen(React.lazy(async () => import('./join-team/join-from-invite'))),
294294
teamJoinTeamDialog: C.makeScreen(React.lazy(async () => import('./join-team/container')), {
295295
getOptions: ({route}) => ({
296-
headerLeft: () => <JoinTeamHeaderLeft success={route.params?.success} />,
297-
headerTitle: () => <JoinTeamHeaderTitle success={route.params?.success} />,
296+
headerLeft: () => <JoinTeamHeaderLeft success={route.params.success} />,
297+
headerTitle: () => <JoinTeamHeaderTitle success={route.params.success} />,
298298
}),
299299
}),
300300
teamNewTeamDialog: C.makeScreen(React.lazy(async () => import('./new-team')), {

shared/teams/team/settings-tab/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import isEqual from 'lodash/isEqual'
1313
type Props = {
1414
allowOpenTrigger: number
1515
canShowcase: boolean
16+
error?: string
1617
isBigTeam: boolean
1718
ignoreAccessRequests: boolean
1819
publicityAnyMember: boolean
@@ -185,7 +186,7 @@ const IgnoreAccessRequests = (props: {
185186
}
186187

187188
export const Settings = (p: Props) => {
188-
const {savePublicity, isBigTeam, teamID, yourOperations, teamname, showOpenTeamWarning} = p
189+
const {error, savePublicity, isBigTeam, teamID, yourOperations, teamname, showOpenTeamWarning} = p
189190
const {canShowcase, allowOpenTrigger} = p
190191

191192
const [newPublicityAnyMember, setNewPublicityAnyMember] = React.useState(p.publicityAnyMember)

shared/teams/team/team-info.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as C from '@/constants'
22
import * as React from 'react'
33
import * as Teams from '@/stores/teams'
44
import * as Kb from '@/common-adapters'
5-
import type * as T from '@/constants/types'
5+
import * as T from '@/constants/types'
66

77
type Props = {teamID: T.Teams.TeamID}
88

0 commit comments

Comments
 (0)