feat: P1 features — voice speed, private receipts, room filter, favorites, invite link, poll creation
P1-5: Voice message playback speed toggle (0.75×/1×/1.5×/2×) in AudioContent.tsx P1-10: Private read receipts toggle in Privacy settings; wired to notifications.ts P1-3: Room filter input on Home tab and DMs tab (client-side, clears on tab switch) P1-8: Favorite rooms via m.favourite tag — Favorites section in Home sidebar, star/unstar in right-click menu P1-9: Room invite link + QR code in room settings (Share Room tile, api.qrserver.com QR) P1-6: Poll creation modal in composer (PollCreator.tsx, sends m.poll.start) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import { Box, Button, config, Icon, Icons, Text } from 'folds';
|
||||
import { SequenceCard } from '../../../components/sequence-card';
|
||||
import { SequenceCardStyle } from '../../room-settings/styles.css';
|
||||
import { SettingTile } from '../../../components/setting-tile';
|
||||
import { CutoutCard } from '../../../components/cutout-card';
|
||||
import { useMatrixClient } from '../../../hooks/useMatrixClient';
|
||||
import { useRoom } from '../../../hooks/useRoom';
|
||||
import { getMatrixToRoom } from '../../../plugins/matrix-to';
|
||||
|
||||
export function RoomShareInvite() {
|
||||
const mx = useMatrixClient();
|
||||
const room = useRoom();
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const domain = mx.getDomain() ?? undefined;
|
||||
const inviteUrl = getMatrixToRoom(room.roomId, domain ? [domain] : undefined);
|
||||
const qrSrc = `https://api.qrserver.com/v1/create-qr-code/?size=160x160&data=${encodeURIComponent(inviteUrl)}`;
|
||||
|
||||
const handleCopy = useCallback(() => {
|
||||
navigator.clipboard.writeText(inviteUrl).then(() => {
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
});
|
||||
}, [inviteUrl]);
|
||||
|
||||
return (
|
||||
<SequenceCard
|
||||
className={SequenceCardStyle}
|
||||
variant="SurfaceVariant"
|
||||
direction="Column"
|
||||
gap="400"
|
||||
>
|
||||
<SettingTile
|
||||
title="Share Room"
|
||||
description="Share this invite link so others can join the room."
|
||||
/>
|
||||
<CutoutCard variant="Surface" style={{ padding: config.space.S300 }}>
|
||||
<Box direction="Column" gap="300">
|
||||
<Box gap="200" alignItems="Center">
|
||||
<Box grow="Yes">
|
||||
<Text
|
||||
size="T200"
|
||||
style={{
|
||||
wordBreak: 'break-all',
|
||||
userSelect: 'all',
|
||||
}}
|
||||
>
|
||||
{inviteUrl}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box shrink="No">
|
||||
<Button
|
||||
size="300"
|
||||
variant={copied ? 'Success' : 'Secondary'}
|
||||
fill={copied ? 'Solid' : 'Soft'}
|
||||
radii="300"
|
||||
onClick={handleCopy}
|
||||
before={<Icon size="100" src={copied ? Icons.Check : Icons.Link} />}
|
||||
>
|
||||
<Text size="B300">{copied ? 'Copied!' : 'Copy Link'}</Text>
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box justifyContent="Center">
|
||||
<img
|
||||
src={qrSrc}
|
||||
alt="QR code for room invite link"
|
||||
width={160}
|
||||
height={160}
|
||||
style={{ display: 'block', borderRadius: config.radii.R300 }}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
</CutoutCard>
|
||||
</SequenceCard>
|
||||
);
|
||||
}
|
||||
@@ -4,4 +4,5 @@ export * from './RoomHistoryVisibility';
|
||||
export * from './RoomJoinRules';
|
||||
export * from './RoomProfile';
|
||||
export * from './RoomPublish';
|
||||
export * from './RoomShareInvite';
|
||||
export * from './RoomUpgrade';
|
||||
|
||||
Reference in New Issue
Block a user