mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-05-07 17:12:35 +00:00
feat: redesign server listing design language
This commit is contained in:
parent
e5d83bc133
commit
0ed5d696df
4 changed files with 71 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
|||
import { palette } from '@roleypoly/design-system/atoms/colors';
|
||||
import { transitions } from '@roleypoly/design-system/atoms/timings';
|
||||
import { text400 } from '@roleypoly/design-system/atoms/typography';
|
||||
import styled from 'styled-components';
|
||||
|
||||
export const GuildNavItem = styled.a`
|
||||
|
@ -19,3 +20,23 @@ export const GuildNavItem = styled.a`
|
|||
cursor: pointer;
|
||||
}
|
||||
`;
|
||||
|
||||
export const SectionHead = styled.div`
|
||||
${text400}
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
svg {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
color: ${palette.taupe500};
|
||||
}
|
||||
`;
|
||||
|
||||
export const HeadLine = styled.div`
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background-color: ${palette.taupe300};
|
||||
margin-left: 0.5em;
|
||||
`;
|
||||
|
|
|
@ -3,9 +3,9 @@ import { getRecentAndSortedGuilds } from '@roleypoly/misc-utils/guildListing';
|
|||
import { GuildSlug, UserGuildPermissions } from '@roleypoly/types';
|
||||
import * as React from 'react';
|
||||
import Scrollbars from 'react-custom-scrollbars';
|
||||
import { GoStar, GoZap } from 'react-icons/go';
|
||||
import { GoHistory, GoListUnordered, GoStar, GoZap } from 'react-icons/go';
|
||||
import ReactTooltip from 'react-tooltip';
|
||||
import { GuildNavItem } from './GuildNav.styled';
|
||||
import { GuildNavItem, HeadLine, SectionHead } from './GuildNav.styled';
|
||||
|
||||
type Props = {
|
||||
guilds: GuildSlug[];
|
||||
|
@ -55,9 +55,17 @@ export const GuildNav = (props: Props) => {
|
|||
>
|
||||
{recentGuildSlugs && (
|
||||
<>
|
||||
<div>Recents</div>
|
||||
<SectionHead>
|
||||
<GoHistory />
|
||||
Recent Guilds
|
||||
<HeadLine />
|
||||
</SectionHead>
|
||||
<NavList guilds={recentGuildSlugs} />
|
||||
<div>All Guilds</div>
|
||||
<SectionHead>
|
||||
<GoListUnordered />
|
||||
All Guilds
|
||||
<HeadLine />
|
||||
</SectionHead>
|
||||
</>
|
||||
)}
|
||||
<NavList guilds={sortedGuildSlugs} />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { onTablet } from '@roleypoly/design-system/atoms/breakpoints';
|
||||
import { palette } from '@roleypoly/design-system/atoms/colors';
|
||||
import { text500 } from '@roleypoly/design-system/atoms/typography';
|
||||
import styled, { css } from 'styled-components';
|
||||
|
||||
export const ContentContainer = styled.div`
|
||||
|
@ -23,5 +25,24 @@ export const CardContainer = styled.div`
|
|||
`;
|
||||
|
||||
export const SectionHead = styled.div`
|
||||
${text500}
|
||||
|
||||
flex: 1 1 100%;
|
||||
padding: 0.6em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
|
||||
svg {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
color: ${palette.taupe500};
|
||||
}
|
||||
`;
|
||||
|
||||
export const Line = styled.div`
|
||||
height: 1px;
|
||||
flex: 1;
|
||||
background-color: ${palette.taupe400};
|
||||
margin-left: 1em;
|
||||
`;
|
||||
|
|
|
@ -3,7 +3,13 @@ import { ServerListingCard } from '@roleypoly/design-system/molecules/server-lis
|
|||
import { getRecentAndSortedGuilds } from '@roleypoly/misc-utils/guildListing';
|
||||
import { GuildSlug } from '@roleypoly/types';
|
||||
import * as React from 'react';
|
||||
import { CardContainer, ContentContainer, SectionHead } from './ServersListing.styled';
|
||||
import { GoHistory, GoListUnordered } from 'react-icons/go';
|
||||
import {
|
||||
CardContainer,
|
||||
ContentContainer,
|
||||
Line,
|
||||
SectionHead,
|
||||
} from './ServersListing.styled';
|
||||
|
||||
type ServersListingProps = {
|
||||
guilds: GuildSlug[];
|
||||
|
@ -32,11 +38,19 @@ export const ServersListing = (props: ServersListingProps) => {
|
|||
<ContentContainer>
|
||||
{recentGuildSlugs.length !== 0 && (
|
||||
<>
|
||||
<SectionHead>Recent Guilds</SectionHead>
|
||||
<SectionHead>
|
||||
<GoHistory />
|
||||
Recent Guilds
|
||||
<Line />
|
||||
</SectionHead>
|
||||
<CardList guilds={recentGuildSlugs} />
|
||||
<SectionHead>All Guilds</SectionHead>
|
||||
</>
|
||||
)}
|
||||
<SectionHead>
|
||||
<GoListUnordered />
|
||||
All Guilds
|
||||
<Line />
|
||||
</SectionHead>
|
||||
<CardList guilds={sortedGuildSlugs} />
|
||||
</ContentContainer>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue