Regression: Add view room action on Teams Channels (#21295)
* add threads on teams and headers items positions * add click to view room * Review * Add enter action * fix component pattern Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat> Co-authored-by: Gabriel Henriques <gabriel.henriques@rocket.chat>pull/21293/head^2
parent
f89e628e9c
commit
eb29b033fc
@ -1,11 +1,15 @@ |
||||
import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; |
||||
import React, { useState } from 'react'; |
||||
|
||||
import EditChannelWithData from './EditRoomInfo'; |
||||
import RoomInfo from './RoomInfo'; |
||||
import EditRoomInfoWithData from './EditRoomInfo'; |
||||
import RoomInfoWithData from './RoomInfo'; |
||||
|
||||
export default ({ rid }) => { |
||||
const RoomInfo = ({ rid, onClickBack, onEnterRoom }) => { |
||||
const [editing, setEditing] = useState(false); |
||||
const onClickBack = useMutableCallback(() => setEditing(false)); |
||||
return editing ? <EditChannelWithData onClickBack={onClickBack} rid={rid} /> : <RoomInfo openEditing={setEditing} rid={rid} />; |
||||
const backToView = useMutableCallback(() => setEditing(false)); |
||||
return editing |
||||
? <EditRoomInfoWithData onClickBack={backToView} rid={rid} /> |
||||
: <RoomInfoWithData onClickBack={onClickBack} openEditing={setEditing} rid={rid} onEnterRoom={onEnterRoom} />; |
||||
}; |
||||
|
||||
export default RoomInfo; |
||||
|
||||
@ -1,14 +1,14 @@ |
||||
import { lazy, LazyExoticComponent, FC } from 'react'; |
||||
import { FC, lazy, LazyExoticComponent } from 'react'; |
||||
|
||||
import { addAction } from '../../room/lib/Toolbox'; |
||||
|
||||
addAction('team-channels', () => ({ |
||||
addAction('team-channels', { |
||||
groups: ['team'], |
||||
id: 'team-channels', |
||||
anonymous: true, |
||||
full: true, |
||||
title: 'Team_Channels', |
||||
icon: 'hash', |
||||
template: lazy(() => import('./TeamChannels')) as LazyExoticComponent<FC>, |
||||
full: true, |
||||
order: 8, |
||||
})); |
||||
order: 2, |
||||
}); |
||||
@ -1,4 +1,4 @@ |
||||
import './contextualBar'; |
||||
import './contextualBar/tabBar'; |
||||
import './info/tabBar.ts'; |
||||
import './members/tabBar'; |
||||
import './info'; |
||||
|
||||
Loading…
Reference in new issue