mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 11:59:11 +00:00
fix linting issues
This commit is contained in:
parent
8cf3b2c78d
commit
b73bd1e664
3 changed files with 47 additions and 41 deletions
|
@ -5,7 +5,8 @@ import { GuildData } from '../utils/kv';
|
||||||
import { lowPermissions, missingParameters, notFound, ok } from '../utils/responses';
|
import { lowPermissions, missingParameters, notFound, ok } from '../utils/responses';
|
||||||
|
|
||||||
export const UpdateGuild = withSession(
|
export const UpdateGuild = withSession(
|
||||||
(session: SessionData) => async (request: Request): Promise<Response> => {
|
(session: SessionData) =>
|
||||||
|
async (request: Request): Promise<Response> => {
|
||||||
const url = new URL(request.url);
|
const url = new URL(request.url);
|
||||||
const [, , guildID] = url.pathname.split('/');
|
const [, , guildID] = url.pathname.split('/');
|
||||||
if (!guildID) {
|
if (!guildID) {
|
||||||
|
|
|
@ -37,15 +37,25 @@ export const EditorShell = (props: EditorShellProps) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasChanges = React.useMemo(() => !deepEqual(guild.data, props.guild.data), [
|
const hasChanges = React.useMemo(
|
||||||
guild.data,
|
() => !deepEqual(guild.data, props.guild.data),
|
||||||
props.guild.data,
|
[guild.data, props.guild.data]
|
||||||
]);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Space />
|
<Space />
|
||||||
<TabView initialTab={0} masthead={<EditorMasthead guild={guild} />}>
|
<TabView
|
||||||
|
initialTab={0}
|
||||||
|
masthead={
|
||||||
|
<EditorMasthead
|
||||||
|
guild={guild}
|
||||||
|
onReset={reset}
|
||||||
|
onSubmit={() => props.onGuildChange?.(guild)}
|
||||||
|
showSaveReset={hasChanges}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<Tab title="Guild Details">
|
<Tab title="Guild Details">
|
||||||
{() => (
|
{() => (
|
||||||
<EditorDetailsTab
|
<EditorDetailsTab
|
||||||
|
|
|
@ -7,13 +7,8 @@ import {
|
||||||
export const EditorTemplate = (
|
export const EditorTemplate = (
|
||||||
props: EditorShellProps & Omit<AppShellProps, 'children'>
|
props: EditorShellProps & Omit<AppShellProps, 'children'>
|
||||||
) => {
|
) => {
|
||||||
const {
|
const { guild, onCategoryChange, onMessageChange, onGuildChange, ...appShellProps } =
|
||||||
guild,
|
props;
|
||||||
onCategoryChange,
|
|
||||||
onMessageChange,
|
|
||||||
onGuildChange,
|
|
||||||
...appShellProps
|
|
||||||
} = props;
|
|
||||||
return (
|
return (
|
||||||
<AppShell {...appShellProps} activeGuildId={guild.id}>
|
<AppShell {...appShellProps} activeGuildId={guild.id}>
|
||||||
<EditorShell guild={guild} onGuildChange={onGuildChange} />
|
<EditorShell guild={guild} onGuildChange={onGuildChange} />
|
||||||
|
|
Loading…
Add table
Reference in a new issue