fix linting issues

This commit is contained in:
41666 2021-07-05 12:10:40 -05:00
parent 8cf3b2c78d
commit b73bd1e664
3 changed files with 47 additions and 41 deletions

View file

@ -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) {

View file

@ -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

View file

@ -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} />