MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / Channel

Function Channel

apps/web/ui/ChannelView/TopicView/index.tsx:139–563  ·  view source on GitHub ↗
({
  threads,
  topics,
  pinnedThreads,
  currentChannel,
  currentCommunity,
  settings,
  channelName,
  isSubDomainRouting,
  token,
  permissions,
  currentThreadId,
  pathCursor,
  setThreads,
  setTopics,
  deleteMessage,
  editThread,
  muteThread,
  unmuteThread,
  pinThread,
  starThread,
  updateThreadResolution,
  readThread,
  unreadThread,
  editMessage,
  onMessage,
  onDrop,
  onShare,
  onRemind,
  onSelectThread,
  updateThread,
  sendReaction,
  useUsersContext,
  usePath,
  routerPush,
  api,
  //startSignUp,
  activeUsers,
}: Props)

Source from the content-addressed store, hash-verified

137const UPDATE_READ_STATUS_INTERVAL_IN_MS = 30000;
138
139export default function Channel({
140 threads,
141 topics,
142 pinnedThreads,
143 currentChannel,
144 currentCommunity,
145 settings,
146 channelName,
147 isSubDomainRouting,
148 token,
149 permissions,
150 currentThreadId,
151 pathCursor,
152 setThreads,
153 setTopics,
154 deleteMessage,
155 editThread,
156 muteThread,
157 unmuteThread,
158 pinThread,
159 starThread,
160 updateThreadResolution,
161 readThread,
162 unreadThread,
163 editMessage,
164 onMessage,
165 onDrop,
166 onShare,
167 onRemind,
168 onSelectThread,
169 updateThread,
170 sendReaction,
171 useUsersContext,
172 usePath,
173 routerPush,
174 api,
175 //startSignUp,
176 activeUsers,
177}: Props) {
178 const [collapsed, setCollapsed] = useState(false);
179 const [isInfiniteScrollLoading, setInfiniteScrollLoading] = useState(false);
180 const [isLeftScrollAtBottom, setIsLeftScrollAtBottom] = useState(true);
181 const [isScrolling, setIsScrolling] = useState(true);
182 const [readStatus, setReadStatus] = useState<SerializedReadStatus>();
183 const scrollableRootRef = useRef<HTMLDivElement | null>(null);
184 const lastScrollDistanceToBottomRef = useRef<number>();
185 const rightRef = useRef<HTMLDivElement>(null);
186 const leftBottomRef = useRef<HTMLDivElement>(null);
187 const [error, setError] = useState<{ prev?: unknown; next?: unknown }>();
188 const { mode } = useMode();
189 const membersPath = usePath({ href: '/members' });
190 const viewport = useViewport();
191
192 const currentUser = permissions.user || null;
193
194 useLayoutEffect(() => {
195 if (!isInfiniteScrollLoading) {
196 scrollDown();

Callers

nothing calls this directly

Calls 14

useViewportFunction · 0.90
timestampFunction · 0.90
useModeFunction · 0.85
usePathFunction · 0.85
debounceFunction · 0.85
onSelectThreadFunction · 0.85
scrollDownFunction · 0.70
handleScrollFunction · 0.70
selectThreadFunction · 0.70
isPaginationViewFunction · 0.70
handleLeftScrollFunction · 0.70
fetchMentionsMethod · 0.65

Tested by

no test coverage detected