chore: restructure project into yarn workspaces, remove next

This commit is contained in:
41666 2021-03-09 23:25:16 -05:00
parent 49e308507e
commit 8d06327c03
266 changed files with 16466 additions and 3350 deletions

View file

@ -0,0 +1,11 @@
import * as React from 'react';
import { guild } from '../../fixtures/storyData';
import { NavSlug } from './NavSlug';
export default {
title: 'Molecules/Server Slug',
component: NavSlug,
};
export const Empty = () => <NavSlug guild={null} />;
export const Example = () => <NavSlug guild={guild} />;

View file

@ -0,0 +1,16 @@
import styled from 'styled-components';
export const SlugContainer = styled.div`
display: flex;
align-items: center;
justify-content: flex-start;
padding: 5px;
`;
export const SlugName = styled.div`
padding: 0 10px;
position: relative;
top: -1px;
white-space: nowrap;
text-overflow: ellipsis;
`;

View file

@ -0,0 +1,27 @@
import { Avatar, utils } from '@roleypoly/design-system/atoms/avatar';
import * as React from 'react';
import { GoOrganization } from 'react-icons/go';
import { GuildSlug } from '../../../../src/common/types';
import { SlugContainer, SlugName } from './NavSlug.styled';
type Props = {
guild: GuildSlug | null;
};
export const NavSlug = (props: Props) => (
<SlugContainer>
<Avatar
hash={props.guild ? props.guild.icon : undefined}
src={
props.guild
? utils.avatarHash(props.guild.id, props.guild.icon)
: undefined
}
deliberatelyEmpty={!props.guild}
size={35}
>
{props.guild ? utils.initialsFromName(props.guild.name) : <GoOrganization />}
</Avatar>
<SlugName>{props.guild?.name || <>Your Guilds</>}</SlugName>
</SlugContainer>
);

View file

@ -0,0 +1 @@
export * from './NavSlug';