mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 18:09:09 +00:00
chore: restructure project into yarn workspaces, remove next
This commit is contained in:
parent
49e308507e
commit
8d06327c03
266 changed files with 16466 additions and 3350 deletions
|
@ -0,0 +1,12 @@
|
|||
import { mastheadSlugs } from '../../fixtures/storyData';
|
||||
import { ServersListing } from './ServersListing';
|
||||
|
||||
export default {
|
||||
title: 'Organisms/Servers Listing',
|
||||
component: ServersListing,
|
||||
args: {
|
||||
guilds: mastheadSlugs,
|
||||
},
|
||||
};
|
||||
|
||||
export const serversListing = (args) => <ServersListing {...args} />;
|
|
@ -0,0 +1,23 @@
|
|||
import { onTablet } from '@roleypoly/design-system/atoms/breakpoints';
|
||||
import styled, { css } from 'styled-components';
|
||||
|
||||
export const ContentContainer = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: calc(98vw - 15px);
|
||||
padding-bottom: 25px;
|
||||
${onTablet(css`
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
`)}
|
||||
`;
|
||||
|
||||
export const CardContainer = styled.div`
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 5px;
|
||||
${onTablet(css`
|
||||
margin: 5px;
|
||||
flex-basis: 30%;
|
||||
max-width: 30%;
|
||||
`)}
|
||||
`;
|
|
@ -0,0 +1,27 @@
|
|||
import { CompletelyStylelessLink } from '@roleypoly/design-system/atoms/typography';
|
||||
import { ServerListingCard } from '@roleypoly/design-system/molecules/server-listing-card';
|
||||
import * as React from 'react';
|
||||
import { GuildSlug } from '../../../../src/common/types';
|
||||
import { sortBy } from '../../../../src/common/utils/sortBy';
|
||||
import { CardContainer, ContentContainer } from './ServersListing.styled';
|
||||
|
||||
type ServersListingProps = {
|
||||
guilds: GuildSlug[];
|
||||
};
|
||||
|
||||
export const ServersListing = (props: ServersListingProps) => (
|
||||
<ContentContainer>
|
||||
{props.guilds &&
|
||||
sortBy(props.guilds, 'name', (a: string, b: string) =>
|
||||
a.toLowerCase() > b.toLowerCase() ? 1 : -1
|
||||
).map((guild, idx) => (
|
||||
<CardContainer key={idx}>
|
||||
<a href={`/s/${guild.id}`}>
|
||||
<CompletelyStylelessLink>
|
||||
<ServerListingCard guild={guild} />
|
||||
</CompletelyStylelessLink>
|
||||
</a>
|
||||
</CardContainer>
|
||||
))}
|
||||
</ContentContainer>
|
||||
);
|
|
@ -0,0 +1 @@
|
|||
export * from './ServersListing';
|
Loading…
Add table
Add a link
Reference in a new issue