Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -7,17 +7,42 @@ import React, {
|
||||
useState,
|
||||
} from 'react';
|
||||
import dayjs from 'dayjs';
|
||||
import { as, Box, Button, Chip, color, config, Header, IconButton, Input, Menu, MenuItem, PopOut, RectCords, Scroll, Switch, Text, toRem } from 'folds';
|
||||
import {
|
||||
as,
|
||||
Box,
|
||||
Button,
|
||||
Chip,
|
||||
color,
|
||||
config,
|
||||
Header,
|
||||
IconButton,
|
||||
Input,
|
||||
Menu,
|
||||
MenuItem,
|
||||
PopOut,
|
||||
RectCords,
|
||||
Scroll,
|
||||
Switch,
|
||||
Text,
|
||||
toRem,
|
||||
} from 'folds';
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { Range } from 'react-range';
|
||||
import { Icon, Icons } from '../../../components/icons';
|
||||
import { HexColorPicker } from 'react-colorful';
|
||||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { Icon, Icons } from '../../../components/icons';
|
||||
import { Page, PageContent, PageHeader } from '../../../components/page';
|
||||
import { SequenceCard } from '../../../components/sequence-card';
|
||||
import { useSetting } from '../../../state/hooks/settings';
|
||||
import { DateFormat, EmojiStyle, MessageLayout, MessageSpacing, ScrollToLatestBehavior, settingsAtom } from '../../../state/settings';
|
||||
import {
|
||||
DateFormat,
|
||||
EmojiStyle,
|
||||
MessageLayout,
|
||||
MessageSpacing,
|
||||
ScrollToLatestBehavior,
|
||||
settingsAtom,
|
||||
} from '../../../state/settings';
|
||||
import { SettingTile } from '../../../components/setting-tile';
|
||||
import { KeySymbol } from '../../../utils/key-symbol';
|
||||
import { isMacOS } from '../../../utils/user-agent';
|
||||
@@ -51,18 +76,14 @@ const ThemeSelector = as<'div', ThemeSelectorProps>(
|
||||
() => () => {
|
||||
setPreviewId(undefined);
|
||||
},
|
||||
[setPreviewId]
|
||||
[setPreviewId],
|
||||
);
|
||||
|
||||
const clearPreview = () => setPreviewId(undefined);
|
||||
const previewTheme = (theme: Theme) => setPreviewId(theme.id);
|
||||
|
||||
return (
|
||||
<Menu
|
||||
{...props}
|
||||
ref={ref}
|
||||
onMouseLeave={clearPreview}
|
||||
>
|
||||
<Menu {...props} ref={ref} onMouseLeave={clearPreview}>
|
||||
<Box direction="Column" gap="100" style={{ padding: config.space.S100 }}>
|
||||
{themes.map((theme) => (
|
||||
<MenuItem
|
||||
@@ -80,7 +101,7 @@ const ThemeSelector = as<'div', ThemeSelectorProps>(
|
||||
</Box>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function SelectTheme({ disabled }: { disabled?: boolean }) {
|
||||
@@ -338,7 +359,7 @@ const emojiStyleNames: Record<EmojiStyle, string> = {
|
||||
function SidebarNameplate() {
|
||||
const [sidebarNameplateOpacity, setSidebarNameplateOpacity] = useSetting(
|
||||
settingsAtom,
|
||||
'sidebarNameplateOpacity'
|
||||
'sidebarNameplateOpacity',
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -416,7 +437,7 @@ const EmojiStyleSelector = as<'div', EmojiStyleSelectorProps>(
|
||||
))}
|
||||
</Box>
|
||||
</Menu>
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
function Appearance() {
|
||||
@@ -907,7 +928,7 @@ function Editor() {
|
||||
function Spaces() {
|
||||
const [autoJoinSpaceRooms, setAutoJoinSpaceRooms] = useSetting(
|
||||
settingsAtom,
|
||||
'autoJoinSpaceRooms'
|
||||
'autoJoinSpaceRooms',
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -918,11 +939,7 @@ function Spaces() {
|
||||
title="Auto-Join Space Rooms"
|
||||
description="Automatically join all accessible rooms when joining a space, with notifications set to Mentions & Keywords."
|
||||
after={
|
||||
<Switch
|
||||
variant="Primary"
|
||||
value={autoJoinSpaceRooms}
|
||||
onChange={setAutoJoinSpaceRooms}
|
||||
/>
|
||||
<Switch variant="Primary" value={autoJoinSpaceRooms} onChange={setAutoJoinSpaceRooms} />
|
||||
}
|
||||
/>
|
||||
</SequenceCard>
|
||||
@@ -1072,7 +1089,7 @@ function SelectScrollToLatestBehavior() {
|
||||
const [menuCords, setMenuCords] = useState<RectCords>();
|
||||
const [scrollToLatestBehavior, setScrollToLatestBehavior] = useSetting(
|
||||
settingsAtom,
|
||||
'scrollToLatestBehavior'
|
||||
'scrollToLatestBehavior',
|
||||
);
|
||||
|
||||
const behaviors = [
|
||||
@@ -1148,15 +1165,15 @@ function SelectScrollToLatestBehavior() {
|
||||
function Messages() {
|
||||
const [legacyUsernameColor, setLegacyUsernameColor] = useSetting(
|
||||
settingsAtom,
|
||||
'legacyUsernameColor'
|
||||
'legacyUsernameColor',
|
||||
);
|
||||
const [hideMembershipEvents, setHideMembershipEvents] = useSetting(
|
||||
settingsAtom,
|
||||
'hideMembershipEvents'
|
||||
'hideMembershipEvents',
|
||||
);
|
||||
const [hideNickAvatarEvents, setHideNickAvatarEvents] = useSetting(
|
||||
settingsAtom,
|
||||
'hideNickAvatarEvents'
|
||||
'hideNickAvatarEvents',
|
||||
);
|
||||
const [mediaAutoLoad, setMediaAutoLoad] = useSetting(settingsAtom, 'mediaAutoLoad');
|
||||
const [urlPreview, setUrlPreview] = useSetting(settingsAtom, 'urlPreview');
|
||||
@@ -1227,18 +1244,53 @@ function Messages() {
|
||||
/>
|
||||
</SequenceCard>
|
||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||
<SettingTile
|
||||
title="Url Preview"
|
||||
after={<Switch variant="Primary" value={urlPreview} onChange={setUrlPreview} />}
|
||||
/>
|
||||
<Box style={{ marginLeft: '2.5rem', marginTop: '0.5rem', marginBottom: '1rem', background: 'rgba(255,255,255,0.045)', borderRadius: '8px', padding: '1.1rem 1.3rem', maxWidth: '36rem', boxShadow: '0 1px 4px 0 rgba(0,0,0,0.07)' }}>
|
||||
<Text size="T200" style={{ color: '#d0d0d0', display: 'block', marginBottom: '0.5rem', lineHeight: 1.6, fontWeight: 400 }}>
|
||||
For ad-free YouTube streaming, install <b>yt-dlp</b> (required for direct playback):
|
||||
</Text>
|
||||
<Box as="pre" style={{ background: '#232323', color: '#fff', borderRadius: '5px', padding: '0.6rem 1rem', fontSize: '1.08em', margin: 0, fontFamily: 'JetBrains Mono, Fira Mono, Menlo, monospace', overflowX: 'auto', width: '100%', textAlign: 'center', letterSpacing: '0.01em' }}>
|
||||
winget install yt-dlp
|
||||
</Box>
|
||||
<SettingTile
|
||||
title="Url Preview"
|
||||
after={<Switch variant="Primary" value={urlPreview} onChange={setUrlPreview} />}
|
||||
/>
|
||||
<Box
|
||||
style={{
|
||||
marginLeft: '2.5rem',
|
||||
marginTop: '0.5rem',
|
||||
marginBottom: '1rem',
|
||||
background: 'rgba(255,255,255,0.045)',
|
||||
borderRadius: '8px',
|
||||
padding: '1.1rem 1.3rem',
|
||||
maxWidth: '36rem',
|
||||
boxShadow: '0 1px 4px 0 rgba(0,0,0,0.07)',
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
size="T200"
|
||||
style={{
|
||||
color: '#d0d0d0',
|
||||
display: 'block',
|
||||
marginBottom: '0.5rem',
|
||||
lineHeight: 1.6,
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
For ad-free YouTube streaming, install <b>yt-dlp</b> (required for direct playback):
|
||||
</Text>
|
||||
<Box
|
||||
as="pre"
|
||||
style={{
|
||||
background: '#232323',
|
||||
color: '#fff',
|
||||
borderRadius: '5px',
|
||||
padding: '0.6rem 1rem',
|
||||
fontSize: '1.08em',
|
||||
margin: 0,
|
||||
fontFamily: 'JetBrains Mono, Fira Mono, Menlo, monospace',
|
||||
overflowX: 'auto',
|
||||
width: '100%',
|
||||
textAlign: 'center',
|
||||
letterSpacing: '0.01em',
|
||||
}}
|
||||
>
|
||||
winget install yt-dlp
|
||||
</Box>
|
||||
</Box>
|
||||
</SequenceCard>
|
||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||
<SettingTile
|
||||
|
||||
Reference in New Issue
Block a user