mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 06:50:28 +03:00
Apply requested changes
This commit is contained in:
parent
e2974d386e
commit
d3fac3bf94
3 changed files with 12 additions and 13 deletions
|
|
@ -11,7 +11,7 @@ export const useExploreSelected = (): boolean => {
|
|||
return !!match;
|
||||
};
|
||||
|
||||
export const useExploringFeaturedRooms = (): boolean => {
|
||||
export const useExploreFeaturedRooms = (): boolean => {
|
||||
const match = useMatch({
|
||||
path: getExploreFeaturedPath(),
|
||||
caseSensitive: true,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import {
|
|||
import { getExploreFeaturedPath, getExploreServerPath } from '../../pathUtils';
|
||||
import { useClientConfig } from '../../../hooks/useClientConfig';
|
||||
import {
|
||||
useExploringFeaturedRooms,
|
||||
useExploreFeaturedRooms,
|
||||
useExploreServer,
|
||||
} from '../../../hooks/router/useExploreSelected';
|
||||
import { useMatrixClient } from '../../../hooks/useMatrixClient';
|
||||
|
|
@ -42,6 +42,7 @@ import { useNavToActivePathMapper } from '../../../hooks/useNavToActivePathMappe
|
|||
import { PageNav, PageNavContent, PageNavHeader } from '../../../components/page';
|
||||
import { stopPropagation } from '../../../utils/keyboard';
|
||||
import { useExploreServers } from '../../../hooks/useExploreServers';
|
||||
import { useAlive } from '../../../hooks/useAlive';
|
||||
|
||||
type AddExploreServerPromptProps = {
|
||||
onSubmit: (server: string) => Promise<void>;
|
||||
|
|
@ -57,6 +58,7 @@ export function AddExploreServerPrompt({
|
|||
}: AddExploreServerPromptProps) {
|
||||
const mx = useMatrixClient();
|
||||
const [dialog, setDialog] = useState(false);
|
||||
const alive = useAlive();
|
||||
const serverInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const getInputServer = (): string | undefined => {
|
||||
|
|
@ -73,8 +75,10 @@ export function AddExploreServerPrompt({
|
|||
|
||||
await mx.publicRooms({ server, limit: 1 });
|
||||
await onSubmit(server);
|
||||
setDialog(false);
|
||||
}, [onSubmit, mx])
|
||||
if (alive()) {
|
||||
setDialog(false);
|
||||
}
|
||||
}, [alive, onSubmit, mx])
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
@ -235,7 +239,7 @@ export function Explore() {
|
|||
const [exploreServers, addServer, removeServer] = useExploreServers();
|
||||
|
||||
const selectedServer = useExploreServer();
|
||||
const exploringFeaturedRooms = useExploringFeaturedRooms();
|
||||
const exploringFeaturedRooms = useExploreFeaturedRooms();
|
||||
const exploringUnlistedServer = useMemo(
|
||||
() =>
|
||||
selectedServer !== undefined &&
|
||||
|
|
|
|||
|
|
@ -527,18 +527,13 @@ export function PublicRooms() {
|
|||
</BackRouteHandler>
|
||||
)}
|
||||
</Box>
|
||||
<Box grow="Yes" justifyContent="Center" alignItems="Center" gap="200">
|
||||
<Box grow="Yes" basis="Yes" justifyContent="Center" alignItems="Center" gap="200">
|
||||
{screenSize !== ScreenSize.Mobile && <Icon size="400" src={Icons.Category} />}
|
||||
<Text size="H3" truncate>
|
||||
{server}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box
|
||||
shrink="No"
|
||||
grow={screenSize === ScreenSize.Mobile ? 'No' : 'Yes'}
|
||||
basis={screenSize === ScreenSize.Mobile ? 'Yes' : 'No'}
|
||||
justifyContent="End"
|
||||
>
|
||||
<Box shrink="No" grow="Yes" basis="No" justifyContent="End">
|
||||
<TooltipProvider
|
||||
position="Bottom"
|
||||
align="End"
|
||||
|
|
@ -588,7 +583,7 @@ export function PublicRooms() {
|
|||
isRemoving ? (
|
||||
<Spinner fill="Solid" variant="Secondary" size="200" />
|
||||
) : (
|
||||
<Icon size="100" src={Icons.Minus} />
|
||||
<Icon size="100" src={Icons.Delete} />
|
||||
)
|
||||
}
|
||||
radii="300"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue