mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-04 22:40:29 +03:00
add onClick prop to thread selector
This commit is contained in:
parent
38cc6e6f3a
commit
3d4c91c969
1 changed files with 5 additions and 0 deletions
|
|
@ -13,18 +13,22 @@ export function ThreadSelectorContainer({ children }: { children: ReactNode }) {
|
||||||
|
|
||||||
type ThreadSelectorProps = {
|
type ThreadSelectorProps = {
|
||||||
room: Room;
|
room: Room;
|
||||||
|
threadId: string;
|
||||||
threadDetail: IThreadBundledRelationship;
|
threadDetail: IThreadBundledRelationship;
|
||||||
outlined?: boolean;
|
outlined?: boolean;
|
||||||
hour24Clock: boolean;
|
hour24Clock: boolean;
|
||||||
dateFormatString: string;
|
dateFormatString: string;
|
||||||
|
onClick?: (threadId: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function ThreadSelector({
|
export function ThreadSelector({
|
||||||
room,
|
room,
|
||||||
|
threadId,
|
||||||
threadDetail,
|
threadDetail,
|
||||||
outlined,
|
outlined,
|
||||||
hour24Clock,
|
hour24Clock,
|
||||||
dateFormatString,
|
dateFormatString,
|
||||||
|
onClick,
|
||||||
}: ThreadSelectorProps) {
|
}: ThreadSelectorProps) {
|
||||||
const latestEvent = threadDetail.latest_event;
|
const latestEvent = threadDetail.latest_event;
|
||||||
|
|
||||||
|
|
@ -43,6 +47,7 @@ export function ThreadSelector({
|
||||||
className={classNames(css.ThreadSelector, outlined && css.ThreadSectorOutlined)}
|
className={classNames(css.ThreadSelector, outlined && css.ThreadSectorOutlined)}
|
||||||
alignItems="Center"
|
alignItems="Center"
|
||||||
gap="300"
|
gap="300"
|
||||||
|
onClick={() => onClick?.(threadId)}
|
||||||
>
|
>
|
||||||
<Box className={css.ThreadRepliesCount} shrink="No" alignItems="Center" gap="200">
|
<Box className={css.ThreadRepliesCount} shrink="No" alignItems="Center" gap="200">
|
||||||
<Icon size="100" src={Icons.Thread} filled />
|
<Icon size="100" src={Icons.Thread} filled />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue