mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-29 03:22:12 +00:00
[MIRROR] allow to clear chat highlight settings (#11483)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3dc465899f
commit
cce52199f3
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
|
||||||
"assist": {
|
"assist": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"source": {
|
"source": {
|
||||||
|
|||||||
18
bun.lock
18
bun.lock
@@ -9,23 +9,23 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"packages": {
|
"packages": {
|
||||||
"@biomejs/biome": ["@biomejs/biome@2.1.2", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.1.2", "@biomejs/cli-darwin-x64": "2.1.2", "@biomejs/cli-linux-arm64": "2.1.2", "@biomejs/cli-linux-arm64-musl": "2.1.2", "@biomejs/cli-linux-x64": "2.1.2", "@biomejs/cli-linux-x64-musl": "2.1.2", "@biomejs/cli-win32-arm64": "2.1.2", "@biomejs/cli-win32-x64": "2.1.2" }, "bin": { "biome": "bin/biome" } }, "sha512-yq8ZZuKuBVDgAS76LWCfFKHSYIAgqkxVB3mGVVpOe2vSkUTs7xG46zXZeNPRNVjiJuw0SZ3+J2rXiYx0RUpfGg=="],
|
"@biomejs/biome": ["@biomejs/biome@2.2.0", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.2.0", "@biomejs/cli-darwin-x64": "2.2.0", "@biomejs/cli-linux-arm64": "2.2.0", "@biomejs/cli-linux-arm64-musl": "2.2.0", "@biomejs/cli-linux-x64": "2.2.0", "@biomejs/cli-linux-x64-musl": "2.2.0", "@biomejs/cli-win32-arm64": "2.2.0", "@biomejs/cli-win32-x64": "2.2.0" }, "bin": { "biome": "bin/biome" } }, "sha512-3On3RSYLsX+n9KnoSgfoYlckYBoU6VRM22cw1gB4Y0OuUVSYd/O/2saOJMrA4HFfA1Ff0eacOvMN1yAAvHtzIw=="],
|
||||||
|
|
||||||
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.1.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-leFAks64PEIjc7MY/cLjE8u5OcfBKkcDB0szxsWUB4aDfemBep1WVKt0qrEyqZBOW8LPHzrFMyDl3FhuuA0E7g=="],
|
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.2.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-zKbwUUh+9uFmWfS8IFxmVD6XwqFcENjZvEyfOxHs1epjdH3wyyMQG80FGDsmauPwS2r5kXdEM0v/+dTIA9FXAg=="],
|
||||||
|
|
||||||
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.1.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-Nmmv7wRX5Nj7lGmz0FjnWdflJg4zii8Ivruas6PBKzw5SJX/q+Zh2RfnO+bBnuKLXpj8kiI2x2X12otpH6a32A=="],
|
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.2.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-+OmT4dsX2eTfhD5crUOPw3RPhaR+SKVspvGVmSdZ9y9O/AgL8pla6T4hOn1q+VAFBHuHhsdxDRJgFCSC7RaMOw=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.1.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-NWNy2Diocav61HZiv2enTQykbPP/KrA/baS7JsLSojC7Xxh2nl9IczuvE5UID7+ksRy2e7yH7klm/WkA72G1dw=="],
|
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.2.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-6eoRdF2yW5FnW9Lpeivh7Mayhq0KDdaDMYOJnH9aT02KuSIX5V1HmWJCQQPwIQbhDh68Zrcpl8inRlTEan0SXw=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.1.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-qgHvafhjH7Oca114FdOScmIKf1DlXT1LqbOrrbR30kQDLFPEOpBG0uzx6MhmsrmhGiCFCr2obDamu+czk+X0HQ=="],
|
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.2.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-egKpOa+4FL9YO+SMUMLUvf543cprjevNc3CAgDNFLcjknuNMcZ0GLJYa3EGTCR2xIkIUJDVneBV3O9OcIlCEZQ=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.1.2", "", { "os": "linux", "cpu": "x64" }, "sha512-Km/UYeVowygTjpX6sGBzlizjakLoMQkxWbruVZSNE6osuSI63i4uCeIL+6q2AJlD3dxoiBJX70dn1enjQnQqwA=="],
|
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.2.0", "", { "os": "linux", "cpu": "x64" }, "sha512-5UmQx/OZAfJfi25zAnAGHUMuOd+LOsliIt119x2soA2gLggQYrVPA+2kMUxR6Mw5M1deUF/AWWP2qpxgH7Nyfw=="],
|
||||||
|
|
||||||
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.1.2", "", { "os": "linux", "cpu": "x64" }, "sha512-xlB3mU14ZUa3wzLtXfmk2IMOGL+S0aHFhSix/nssWS/2XlD27q+S6f0dlQ8WOCbYoXcuz8BCM7rCn2lxdTrlQA=="],
|
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.2.0", "", { "os": "linux", "cpu": "x64" }, "sha512-I5J85yWwUWpgJyC1CcytNSGusu2p9HjDnOPAFG4Y515hwRD0jpR9sT9/T1cKHtuCvEQ/sBvx+6zhz9l9wEJGAg=="],
|
||||||
|
|
||||||
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.1.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-G8KWZli5ASOXA3yUQgx+M4pZRv3ND16h77UsdunUL17uYpcL/UC7RkWTdkfvMQvogVsAuz5JUcBDjgZHXxlKoA=="],
|
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.2.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-n9a1/f2CwIDmNMNkFs+JI0ZjFnMO0jdOyGNtihgUNFnlmd84yIYY2KMTBmMV58ZlVHjgmY5Y6E1hVTnSRieggA=="],
|
||||||
|
|
||||||
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.1.2", "", { "os": "win32", "cpu": "x64" }, "sha512-9zajnk59PMpjBkty3bK2IrjUsUHvqe9HWwyAWQBjGLE7MIBjbX2vwv1XPEhmO2RRuGoTkVx3WCanHrjAytICLA=="],
|
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.2.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Nawu5nHjP/zPKTIryh2AavzTc/KEg4um/MxWdXW0A6P/RZOyIpa7+QSjeXwAwX/utJGaCoXRPWtF3m5U/bB3Ww=="],
|
||||||
|
|
||||||
"prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="],
|
"prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^2.1.2",
|
"@biomejs/biome": "^2.2.0",
|
||||||
"prettier": "^3.6.2"
|
"prettier": "^3.6.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -5,13 +5,14 @@
|
|||||||
|
|
||||||
[class^='tg-'],
|
[class^='tg-'],
|
||||||
[class*=' tg-'] {
|
[class*=' tg-'] {
|
||||||
|
/* biome-ignore lint/complexity/noImportantStyles: Needed */
|
||||||
font-family: 'tgfont' !important;
|
font-family: 'tgfont' !important;
|
||||||
font-size: undefined;
|
font-size: undefined;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
/* biome-ignore-start lint/suspicious/noUselessEscapeInString: Unicode */
|
||||||
:root {
|
:root {
|
||||||
--tg-air-tank-slash: '\ea01';
|
--tg-air-tank-slash: '\ea01';
|
||||||
--tg-air-tank: '\ea02';
|
--tg-air-tank: '\ea02';
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
--tg-sound-plus: '\ea0b';
|
--tg-sound-plus: '\ea0b';
|
||||||
--tg-syndicate-logo: '\ea0c';
|
--tg-syndicate-logo: '\ea0c';
|
||||||
}
|
}
|
||||||
|
/* biome-ignore-end lint/suspicious/noUselessEscapeInString: Unicode */
|
||||||
.tg-air-tank-slash::before {
|
.tg-air-tank-slash::before {
|
||||||
content: var(--tg-air-tank-slash);
|
content: var(--tg-air-tank-slash);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ export class RspackCompiler {
|
|||||||
stats
|
stats
|
||||||
?.toString(this.config.stats)
|
?.toString(this.config.stats)
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.forEach((line) => logger.log(line));
|
.forEach((line) => {
|
||||||
|
logger.log(line);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,9 @@ export class AudioPlayer {
|
|||||||
logger.log('playback failed');
|
logger.log('playback failed');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.onPlaySubscribers.forEach((subscriber) => subscriber());
|
this.onPlaySubscribers.forEach((subscriber) => {
|
||||||
|
subscriber();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
@@ -101,7 +103,9 @@ export class AudioPlayer {
|
|||||||
this.element.pause();
|
this.element.pause();
|
||||||
this.destroy();
|
this.destroy();
|
||||||
|
|
||||||
this.onStopSubscribers.forEach((subscriber) => subscriber());
|
this.onStopSubscribers.forEach((subscriber) => {
|
||||||
|
subscriber();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setVolume(volume: number): void {
|
setVolume(volume: number): void {
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ class ChatRenderer {
|
|||||||
let highlightRegex;
|
let highlightRegex;
|
||||||
// Nothing to match, reset highlighting
|
// Nothing to match, reset highlighting
|
||||||
if (lines.length === 0) {
|
if (lines.length === 0) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
// Reset lastIndex so it does not mess up the next word
|
// Reset lastIndex so it does not mess up the next word
|
||||||
allowedRegex.lastIndex = 0;
|
allowedRegex.lastIndex = 0;
|
||||||
@@ -433,6 +433,7 @@ class ChatRenderer {
|
|||||||
highlightBlacklist,
|
highlightBlacklist,
|
||||||
blacklistregex,
|
blacklistregex,
|
||||||
});
|
});
|
||||||
|
return undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -704,6 +705,7 @@ class ChatRenderer {
|
|||||||
node.className += ' ChatMessage--highlighted';
|
node.className += ' ChatMessage--highlighted';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Linkify text
|
// Linkify text
|
||||||
|
|||||||
@@ -80,21 +80,39 @@ const TextHighlightSetting = (props) => {
|
|||||||
return (
|
return (
|
||||||
<Stack.Item {...rest}>
|
<Stack.Item {...rest}>
|
||||||
<Stack mb={1} color="label" align="baseline">
|
<Stack mb={1} color="label" align="baseline">
|
||||||
<Stack.Item grow>
|
<Button.Confirm
|
||||||
<Button
|
icon="times"
|
||||||
color="transparent"
|
color="transparent"
|
||||||
icon="times"
|
onClick={() =>
|
||||||
onClick={() =>
|
dispatch(
|
||||||
dispatch(
|
updateHighlightSetting({
|
||||||
removeHighlightSetting({
|
id: id,
|
||||||
id: id,
|
highlightText: '',
|
||||||
}),
|
blacklistText: '',
|
||||||
)
|
}),
|
||||||
}
|
)
|
||||||
>
|
}
|
||||||
Delete
|
>
|
||||||
</Button>
|
Reset
|
||||||
</Stack.Item>
|
</Button.Confirm>
|
||||||
|
{id !== 'default' && (
|
||||||
|
<Stack.Item>
|
||||||
|
<Button.Confirm
|
||||||
|
color="transparent"
|
||||||
|
icon="times"
|
||||||
|
onClick={() =>
|
||||||
|
dispatch(
|
||||||
|
removeHighlightSetting({
|
||||||
|
id: id,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</Button.Confirm>
|
||||||
|
</Stack.Item>
|
||||||
|
)}
|
||||||
|
<Stack.Item grow />
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
<Button.Checkbox
|
<Button.Checkbox
|
||||||
checked={highlightBlacklist}
|
checked={highlightBlacklist}
|
||||||
|
|||||||
@@ -266,9 +266,7 @@ export function settingsReducer(
|
|||||||
// Transfer this data from the default highlight setting
|
// Transfer this data from the default highlight setting
|
||||||
// so they carry over to other servers
|
// so they carry over to other servers
|
||||||
if (id === defaultHighlightSetting.id) {
|
if (id === defaultHighlightSetting.id) {
|
||||||
if (settings.highlightText) {
|
nextState.highlightText = settings.highlightText;
|
||||||
nextState.highlightText = settings.highlightText;
|
|
||||||
}
|
|
||||||
if (settings.highlightColor) {
|
if (settings.highlightColor) {
|
||||||
nextState.highlightColor = settings.highlightColor;
|
nextState.highlightColor = settings.highlightColor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ blink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.FatalError--visible {
|
.FatalError--visible {
|
||||||
|
/* biome-ignore lint/complexity/noImportantStyles: Needed */
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ const BiogeneratorItems = (props: {
|
|||||||
})
|
})
|
||||||
.sort(sortTypes[props.sortOrder]);
|
.sort(sortTypes[props.sortOrder]);
|
||||||
if (items_in_cat.length === 0) {
|
if (items_in_cat.length === 0) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (props.descending) {
|
if (props.descending) {
|
||||||
items_in_cat = items_in_cat.reverse();
|
items_in_cat = items_in_cat.reverse();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export const BodyScannerMainAbnormalities = (props: { occupant: occupant }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
})}
|
})}
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const CasinoPrizeDispenserItems = (props: {
|
|||||||
})
|
})
|
||||||
.sort(sortTypes[props.sortOrder]);
|
.sort(sortTypes[props.sortOrder]);
|
||||||
if (items_in_cat.length === 0) {
|
if (items_in_cat.length === 0) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (props.descending) {
|
if (props.descending) {
|
||||||
items_in_cat = items_in_cat.reverse();
|
items_in_cat = items_in_cat.reverse();
|
||||||
|
|||||||
@@ -111,9 +111,9 @@ export class Changelog extends Component<ChangelogProps, ChangelogState> {
|
|||||||
} = useBackend<Data>();
|
} = useBackend<Data>();
|
||||||
|
|
||||||
if (dates) {
|
if (dates) {
|
||||||
dates.forEach((date) =>
|
dates.forEach((date) => {
|
||||||
this.dateChoices.push(dateformat(date, 'mmmm yyyy', true)),
|
this.dateChoices.push(dateformat(date, 'mmmm yyyy', true));
|
||||||
);
|
});
|
||||||
this.setSelectedDate(this.dateChoices[0]);
|
this.setSelectedDate(this.dateChoices[0]);
|
||||||
this.getData(dates[0]);
|
this.getData(dates[0]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
<Table.Row bold>
|
<Table.Row bold>
|
||||||
<Table.Cell collapsing>Photo</Table.Cell>
|
<Table.Cell collapsing>Photo</Table.Cell>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="name"
|
ourId="name"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
@@ -39,7 +39,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
Name
|
Name
|
||||||
</SortButton>
|
</SortButton>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="species"
|
ourId="species"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
@@ -48,7 +48,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
Species
|
Species
|
||||||
</SortButton>
|
</SortButton>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="tag"
|
ourId="tag"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
@@ -57,7 +57,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
Vore Tag
|
Vore Tag
|
||||||
</SortButton>
|
</SortButton>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="gendertag"
|
ourId="gendertag"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
@@ -66,7 +66,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
Gender
|
Gender
|
||||||
</SortButton>
|
</SortButton>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="sexualitytag"
|
ourId="sexualitytag"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
@@ -75,7 +75,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
Sexuality
|
Sexuality
|
||||||
</SortButton>
|
</SortButton>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="erptag"
|
ourId="erptag"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
@@ -84,7 +84,7 @@ export const CharacterDirectoryList = (props: {
|
|||||||
ERP Tag
|
ERP Tag
|
||||||
</SortButton>
|
</SortButton>
|
||||||
<SortButton
|
<SortButton
|
||||||
id="eventtag"
|
ourId="eventtag"
|
||||||
sortId={sortId}
|
sortId={sortId}
|
||||||
sortOrder={sortOrder}
|
sortOrder={sortOrder}
|
||||||
onSortId={setSortId}
|
onSortId={setSortId}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Button, Icon, Table } from 'tgui-core/components';
|
import { Button, Icon, Table } from 'tgui-core/components';
|
||||||
|
|
||||||
export const SortButton = (props: {
|
export const SortButton = (props: {
|
||||||
id: string;
|
ourId: string;
|
||||||
sortId: string;
|
sortId: string;
|
||||||
sortOrder: boolean;
|
sortOrder: boolean;
|
||||||
onSortOrder: React.Dispatch<React.SetStateAction<boolean>>;
|
onSortOrder: React.Dispatch<React.SetStateAction<boolean>>;
|
||||||
onSortId: React.Dispatch<React.SetStateAction<string>>;
|
onSortId: React.Dispatch<React.SetStateAction<string>>;
|
||||||
children: React.JSX.Element | string;
|
children: React.JSX.Element | string;
|
||||||
}) => {
|
}) => {
|
||||||
const { id, sortId, sortOrder, onSortOrder, onSortId, children } = props;
|
const { ourId, sortId, sortOrder, onSortOrder, onSortId, children } = props;
|
||||||
|
|
||||||
// Hey, same keys mean same data~
|
// Hey, same keys mean same data~
|
||||||
|
|
||||||
@@ -16,18 +16,18 @@ export const SortButton = (props: {
|
|||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
<Button
|
<Button
|
||||||
width="100%"
|
width="100%"
|
||||||
color={sortId !== id && 'transparent'}
|
color={sortId !== ourId && 'transparent'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (sortId === id) {
|
if (sortId === ourId) {
|
||||||
onSortOrder(!props.sortOrder);
|
onSortOrder(!props.sortOrder);
|
||||||
} else {
|
} else {
|
||||||
onSortId(id);
|
onSortId(ourId);
|
||||||
onSortOrder(true);
|
onSortOrder(true);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
{sortId === id && (
|
{sortId === ourId && (
|
||||||
<Icon name={sortOrder ? 'sort-up' : 'sort-down'} ml="0.25rem;" />
|
<Icon name={sortOrder ? 'sort-up' : 'sort-down'} ml="0.25rem;" />
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ const EStopSvg = (props: React.SVGProps<SVGSVGElement>) => {
|
|||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<defs>
|
<defs>
|
||||||
|
{/** biome-ignore lint/correctness/useUniqueElementIds: Required for SVG */}
|
||||||
<marker
|
<marker
|
||||||
id="b"
|
id="b"
|
||||||
markerHeight={2}
|
markerHeight={2}
|
||||||
@@ -254,6 +255,7 @@ const EStopSvg = (props: React.SVGProps<SVGSVGElement>) => {
|
|||||||
transform="scale(.5)"
|
transform="scale(.5)"
|
||||||
/>
|
/>
|
||||||
</marker>
|
</marker>
|
||||||
|
{/** biome-ignore lint/correctness/useUniqueElementIds: Required for SVG */}
|
||||||
<marker
|
<marker
|
||||||
id="c"
|
id="c"
|
||||||
markerHeight={2}
|
markerHeight={2}
|
||||||
@@ -279,6 +281,7 @@ const EStopSvg = (props: React.SVGProps<SVGSVGElement>) => {
|
|||||||
transform="scale(.5)"
|
transform="scale(.5)"
|
||||||
/>
|
/>
|
||||||
</marker>
|
</marker>
|
||||||
|
{/** biome-ignore lint/correctness/useUniqueElementIds: Required for SVG */}
|
||||||
<marker
|
<marker
|
||||||
id="a"
|
id="a"
|
||||||
markerHeight={2}
|
markerHeight={2}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ const MiningVendorItems = (props: {
|
|||||||
})
|
})
|
||||||
.sort(sortTypes[props.sortOrder]);
|
.sort(sortTypes[props.sortOrder]);
|
||||||
if (items_in_cat.length === 0) {
|
if (items_in_cat.length === 0) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
if (props.descending) {
|
if (props.descending) {
|
||||||
items_in_cat = items_in_cat.reverse();
|
items_in_cat = items_in_cat.reverse();
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export const setGradientSpace = (
|
|||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
});
|
});
|
||||||
if (!found) {
|
if (!found) {
|
||||||
gradient.push({ space: space });
|
gradient.push({ space: space });
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ const ConstructorPage = (props: {
|
|||||||
designs: ConstructorDesign[];
|
designs: ConstructorDesign[];
|
||||||
linked_data: LinkedConstructor;
|
linked_data: LinkedConstructor;
|
||||||
}) => {
|
}) => {
|
||||||
const { act, data } = useBackend<Data>();
|
|
||||||
const { type, designs, linked_data } = props;
|
const { type, designs, linked_data } = props;
|
||||||
const our_name = constructorEnumToName[type];
|
const our_name = constructorEnumToName[type];
|
||||||
|
|
||||||
@@ -328,7 +327,7 @@ const MatStorageTab = (props: {
|
|||||||
<LabeledList>
|
<LabeledList>
|
||||||
{Object.entries(linked_data.materials).map(([mat, amount]) => {
|
{Object.entries(linked_data.materials).map(([mat, amount]) => {
|
||||||
if (amount === 0 && !NEVER_HIDE_MATERIALS.includes(mat)) {
|
if (amount === 0 && !NEVER_HIDE_MATERIALS.includes(mat)) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<LabeledList.Item
|
<LabeledList.Item
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export const VoreContentsPanel = (props: {
|
|||||||
if (entry.value === value) {
|
if (entry.value === value) {
|
||||||
return entry.displayText;
|
return entry.displayText;
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
})
|
})
|
||||||
.filter((value) => value !== undefined);
|
.filter((value) => value !== undefined);
|
||||||
if (Array.isArray(bellyName) && bellyName.length) {
|
if (Array.isArray(bellyName) && bellyName.length) {
|
||||||
|
|||||||
@@ -115,9 +115,9 @@ export class Changelog extends Component<
|
|||||||
} = useBackend<Data>();
|
} = useBackend<Data>();
|
||||||
|
|
||||||
if (dates) {
|
if (dates) {
|
||||||
dates.forEach((date) =>
|
dates.forEach((date) => {
|
||||||
this.dateChoices.push(dateformat(date, 'mmmm yyyy', true)),
|
this.dateChoices.push(dateformat(date, 'mmmm yyyy', true));
|
||||||
);
|
});
|
||||||
this.setSelectedDate(this.dateChoices[0]);
|
this.setSelectedDate(this.dateChoices[0]);
|
||||||
this.getData(dates[0]);
|
this.getData(dates[0]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,9 +50,8 @@ const SelectedArticle = (props) => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{!!cover && <Image src={resolveAsset(cover)} />}
|
{!!cover && <Image src={resolveAsset(cover)} />}
|
||||||
{/* News articles are written in premade .html files and cannot be edited by players, so it should be
|
{/** biome-ignore lint/security/noDangerouslySetInnerHtml: News articles are written in premade .html files and cannot be edited by players, so it should be
|
||||||
* safe enough to use dangerouslySetInnerHTML here.
|
* safe enough to use dangerouslySetInnerHTML here. */}
|
||||||
*/}
|
|
||||||
<div dangerouslySetInnerHTML={{ __html: content }} />
|
<div dangerouslySetInnerHTML={{ __html: content }} />
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export const Connections = (props: {
|
|||||||
const from = val.from;
|
const from = val.from;
|
||||||
const to = val.to;
|
const to = val.to;
|
||||||
if (!to || !from) {
|
if (!to || !from) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
val.color = val.color || 'blue';
|
val.color = val.color || 'blue';
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ describe('captureExternalLinks', () => {
|
|||||||
parentElement: document.body,
|
parentElement: document.body,
|
||||||
};
|
};
|
||||||
const byond = { sendMessage: mock() };
|
const byond = { sendMessage: mock() };
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
global.Byond = byond;
|
global.Byond = byond;
|
||||||
|
|
||||||
const evt = { target: externalLink, preventDefault: mock() };
|
const evt = { target: externalLink, preventDefault: mock() };
|
||||||
@@ -58,7 +58,7 @@ describe('captureExternalLinks', () => {
|
|||||||
parentElement: document.body,
|
parentElement: document.body,
|
||||||
};
|
};
|
||||||
const byond = { sendMessage: mock() };
|
const byond = { sendMessage: mock() };
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
global.Byond = byond;
|
global.Byond = byond;
|
||||||
|
|
||||||
const evt = { target: byondLink, preventDefault: mock() };
|
const evt = { target: byondLink, preventDefault: mock() };
|
||||||
@@ -75,7 +75,7 @@ describe('captureExternalLinks', () => {
|
|||||||
parentElement: document.body,
|
parentElement: document.body,
|
||||||
};
|
};
|
||||||
const byond = { sendMessage: mock() };
|
const byond = { sendMessage: mock() };
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
global.Byond = byond;
|
global.Byond = byond;
|
||||||
|
|
||||||
const evt = { target: wwwLink, preventDefault: mock() };
|
const evt = { target: wwwLink, preventDefault: mock() };
|
||||||
|
|||||||
Reference in New Issue
Block a user