mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 09:39:09 +00:00
chore: update prettier tab width for consistency (#175)
This commit is contained in:
parent
a931f8c69c
commit
f24d2fcc99
247 changed files with 7224 additions and 7375 deletions
|
@ -2,11 +2,11 @@ import { mastheadSlugs } from '../../fixtures/storyData';
|
|||
import { ServersListing } from './ServersListing';
|
||||
|
||||
export default {
|
||||
title: 'Organisms/Servers Listing',
|
||||
component: ServersListing,
|
||||
args: {
|
||||
guilds: mastheadSlugs,
|
||||
},
|
||||
title: 'Organisms/Servers Listing',
|
||||
component: ServersListing,
|
||||
args: {
|
||||
guilds: mastheadSlugs,
|
||||
},
|
||||
};
|
||||
|
||||
export const serversListing = (args) => <ServersListing {...args} />;
|
||||
|
|
|
@ -2,26 +2,26 @@ 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;
|
||||
`)}
|
||||
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%;
|
||||
`)}
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 5px;
|
||||
${onTablet(css`
|
||||
margin: 5px;
|
||||
flex-basis: 30%;
|
||||
max-width: 30%;
|
||||
`)}
|
||||
`;
|
||||
|
||||
export const SectionHead = styled.div`
|
||||
flex: 1 1 100%;
|
||||
flex: 1 1 100%;
|
||||
`;
|
||||
|
|
|
@ -6,38 +6,38 @@ import * as React from 'react';
|
|||
import { CardContainer, ContentContainer, SectionHead } from './ServersListing.styled';
|
||||
|
||||
type ServersListingProps = {
|
||||
guilds: GuildSlug[];
|
||||
recentGuilds: string[];
|
||||
guilds: GuildSlug[];
|
||||
recentGuilds: string[];
|
||||
};
|
||||
|
||||
const CardList = (props: { guilds: GuildSlug[] }) => (
|
||||
<>
|
||||
{props.guilds.map((guild, idx) => (
|
||||
<CardContainer key={idx}>
|
||||
<CompletelyStylelessLink to={`/s/${guild.id}`}>
|
||||
<ServerListingCard guild={guild} />
|
||||
</CompletelyStylelessLink>
|
||||
</CardContainer>
|
||||
))}
|
||||
</>
|
||||
<>
|
||||
{props.guilds.map((guild, idx) => (
|
||||
<CardContainer key={idx}>
|
||||
<CompletelyStylelessLink to={`/s/${guild.id}`}>
|
||||
<ServerListingCard guild={guild} />
|
||||
</CompletelyStylelessLink>
|
||||
</CardContainer>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
export const ServersListing = (props: ServersListingProps) => {
|
||||
const { recentGuildSlugs, sortedGuildSlugs } = getRecentAndSortedGuilds(
|
||||
props.guilds,
|
||||
props.recentGuilds
|
||||
);
|
||||
const { recentGuildSlugs, sortedGuildSlugs } = getRecentAndSortedGuilds(
|
||||
props.guilds,
|
||||
props.recentGuilds
|
||||
);
|
||||
|
||||
return (
|
||||
<ContentContainer>
|
||||
{recentGuildSlugs.length !== 0 && (
|
||||
<>
|
||||
<SectionHead>Recent Guilds</SectionHead>
|
||||
<CardList guilds={recentGuildSlugs} />
|
||||
<SectionHead>All Guilds</SectionHead>
|
||||
</>
|
||||
)}
|
||||
<CardList guilds={sortedGuildSlugs} />
|
||||
</ContentContainer>
|
||||
);
|
||||
return (
|
||||
<ContentContainer>
|
||||
{recentGuildSlugs.length !== 0 && (
|
||||
<>
|
||||
<SectionHead>Recent Guilds</SectionHead>
|
||||
<CardList guilds={recentGuildSlugs} />
|
||||
<SectionHead>All Guilds</SectionHead>
|
||||
</>
|
||||
)}
|
||||
<CardList guilds={sortedGuildSlugs} />
|
||||
</ContentContainer>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue