mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-15 17:19:10 +00:00
feat(editor): add permalink section in editor
This commit is contained in:
parent
f86eaae5e9
commit
0d96a4f973
11 changed files with 125 additions and 2 deletions
|
@ -0,0 +1,12 @@
|
|||
import { mastheadSlugs } from '../../fixtures/storyData';
|
||||
import { EditorInviteLink } from './EditorInviteLink';
|
||||
|
||||
export default {
|
||||
title: 'Molecules/Editor Invite Link',
|
||||
component: EditorInviteLink,
|
||||
args: {
|
||||
guild: mastheadSlugs[0],
|
||||
},
|
||||
};
|
||||
|
||||
export const editorInviteLink = (args) => <EditorInviteLink {...args} />;
|
|
@ -0,0 +1,2 @@
|
|||
import styled from 'styled-components';
|
||||
export const EditorInviteLinkStyled = styled.div``;
|
|
@ -0,0 +1,26 @@
|
|||
import { palette } from '@roleypoly/design-system/atoms/colors';
|
||||
import { CopyArea } from '@roleypoly/design-system/atoms/copy-area';
|
||||
import { AmbientLarge } from '@roleypoly/design-system/atoms/typography';
|
||||
import { MessageBox } from '@roleypoly/design-system/organisms/role-picker/RolePicker.styled';
|
||||
import { Guild } from '@roleypoly/types';
|
||||
import { GoInfo } from 'react-icons/go';
|
||||
|
||||
export const EditorInviteLink = (props: { guild: Guild }) => {
|
||||
const currentURL = new URL(location.href);
|
||||
currentURL.pathname = `/s/${props.guild.id}`;
|
||||
currentURL.search = '';
|
||||
|
||||
const inviteLink = currentURL.toString();
|
||||
|
||||
return (
|
||||
<MessageBox>
|
||||
Share this link with your server members, or ping{' '}
|
||||
<span style={{ color: palette.taupe500 }}>@roleypoly</span> in your server.
|
||||
<CopyArea value={inviteLink} />
|
||||
<AmbientLarge style={{ display: 'flex', color: palette.taupe600 }}>
|
||||
<GoInfo style={{ position: 'relative', top: 4 }} />
|
||||
This link will never change. Share it with anyone!
|
||||
</AmbientLarge>
|
||||
</MessageBox>
|
||||
);
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export * from './EditorInviteLink';
|
Loading…
Add table
Add a link
Reference in a new issue