fix(editor): make permalink types more sane

This commit is contained in:
41666 2022-01-22 22:10:57 -05:00
parent 0d96a4f973
commit 20efb22605
2 changed files with 3 additions and 4 deletions

View file

@ -2,12 +2,11 @@ import { palette } from '@roleypoly/design-system/atoms/colors';
import { CopyArea } from '@roleypoly/design-system/atoms/copy-area'; import { CopyArea } from '@roleypoly/design-system/atoms/copy-area';
import { AmbientLarge } from '@roleypoly/design-system/atoms/typography'; import { AmbientLarge } from '@roleypoly/design-system/atoms/typography';
import { MessageBox } from '@roleypoly/design-system/organisms/role-picker/RolePicker.styled'; import { MessageBox } from '@roleypoly/design-system/organisms/role-picker/RolePicker.styled';
import { Guild } from '@roleypoly/types';
import { GoInfo } from 'react-icons/go'; import { GoInfo } from 'react-icons/go';
export const EditorInviteLink = (props: { guild: Guild }) => { export const EditorInviteLink = (props: { guildId: string }) => {
const currentURL = new URL(location.href); const currentURL = new URL(location.href);
currentURL.pathname = `/s/${props.guild.id}`; currentURL.pathname = `/s/${props.guildId}`;
currentURL.search = ''; currentURL.search = '';
const inviteLink = currentURL.toString(); const inviteLink = currentURL.toString();

View file

@ -61,7 +61,7 @@ export const EditorShell = (props: EditorShellProps) => {
<Space /> <Space />
<ServerMasthead guild={props.guild.guild} editable={false} /> <ServerMasthead guild={props.guild.guild} editable={false} />
<Space /> <Space />
<EditorInviteLink guild={props.guild.guild} /> <EditorInviteLink guildId={props.guild.id} />
<Space /> <Space />
<EditableServerMessage <EditableServerMessage
onChange={onMessageChange} onChange={onMessageChange}