fix(design-system): fix styling regression from removing next/link (#168)

This commit is contained in:
41666 2021-03-13 20:16:40 -05:00 committed by GitHub
parent 99952aa19f
commit 5e8876a90c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 24 deletions

View file

@ -1,3 +1,4 @@
import { Link as RouterLink } from '@reach/router';
import { palette } from '@roleypoly/design-system/atoms/colors'; import { palette } from '@roleypoly/design-system/atoms/colors';
import { transitions } from '@roleypoly/design-system/atoms/timings'; import { transitions } from '@roleypoly/design-system/atoms/timings';
import styled, { css } from 'styled-components'; import styled, { css } from 'styled-components';
@ -106,7 +107,7 @@ export const Link = styled.a`
} }
`; `;
export const CompletelyStylelessLink = styled.a` export const CompletelyStylelessLink = styled(RouterLink)`
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
:visited, :visited,

View file

@ -1,5 +1,9 @@
import { Avatar, utils } from '@roleypoly/design-system/atoms/avatar'; import { Avatar, utils } from '@roleypoly/design-system/atoms/avatar';
import { AccentTitle, AmbientLarge } from '@roleypoly/design-system/atoms/typography'; import {
AccentTitle,
AmbientLarge,
CompletelyStylelessLink,
} from '@roleypoly/design-system/atoms/typography';
import { GuildSlug } from '@roleypoly/types'; import { GuildSlug } from '@roleypoly/types';
import * as React from 'react'; import * as React from 'react';
import { GoPencil } from 'react-icons/go'; import { GoPencil } from 'react-icons/go';
@ -25,12 +29,12 @@ export const ServerMasthead = (props: ServerMastheadProps) => {
<Name> <Name>
<AccentTitle>{props.guild.name}</AccentTitle> <AccentTitle>{props.guild.name}</AccentTitle>
{props.editable && ( {props.editable && (
<a href={`/s/${props.guild.id}/edit`}> <CompletelyStylelessLink to={`/s/${props.guild.id}/edit`}>
<Editable role="button"> <Editable role="button">
<GoPencil /> <GoPencil />
&nbsp; <AmbientLarge>Edit Server</AmbientLarge> &nbsp; <AmbientLarge>Edit Server</AmbientLarge>
</Editable> </Editable>
</a> </CompletelyStylelessLink>
)} )}
</Name> </Name>
</Wrapper> </Wrapper>

View file

@ -13,18 +13,14 @@ export const UserPopover = (props: UserPopoverProps) => (
<Base> <Base>
<UserAvatarGroup user={props.user} preventCollapse={true} /> <UserAvatarGroup user={props.user} preventCollapse={true} />
<NavAction> <NavAction>
<a href="/user/settings"> <CompletelyStylelessLink to="/user/settings">
<CompletelyStylelessLink>
Settings <GoGear /> Settings <GoGear />
</CompletelyStylelessLink> </CompletelyStylelessLink>
</a>
</NavAction> </NavAction>
<NavAction> <NavAction>
<a href="/machinery/logout"> <CompletelyStylelessLink to="/machinery/logout">
<CompletelyStylelessLink>
Log Out <GoSignOut /> Log Out <GoSignOut />
</CompletelyStylelessLink> </CompletelyStylelessLink>
</a>
</NavAction> </NavAction>
</Base> </Base>
); );

View file

@ -4,6 +4,7 @@ import { GuildSlug } from '@roleypoly/types';
import * as React from 'react'; import * as React from 'react';
import { FaDiscord } from 'react-icons/fa'; import { FaDiscord } from 'react-icons/fa';
import styled from 'styled-components'; import styled from 'styled-components';
import { CompletelyStylelessLink } from '../../atoms/typography';
export type PreauthProps = { export type PreauthProps = {
guildSlug?: GuildSlug; guildSlug?: GuildSlug;
@ -32,7 +33,7 @@ export const Preauth = (props: PreauthProps) => {
<Centered> <Centered>
{props.guildSlug && <PreauthGreeting guildSlug={props.guildSlug} />} {props.guildSlug && <PreauthGreeting guildSlug={props.guildSlug} />}
<WidthContainer> <WidthContainer>
<a href={props.discordOAuthLink || '#'}> <CompletelyStylelessLink to={props.discordOAuthLink || '#'}>
<Button <Button
color="discord" color="discord"
icon={ icon={
@ -43,7 +44,7 @@ export const Preauth = (props: PreauthProps) => {
> >
Sign in with Discord Sign in with Discord
</Button> </Button>
</a> </CompletelyStylelessLink>
</WidthContainer> </WidthContainer>
</Centered> </Centered>
); );

View file

@ -2,7 +2,11 @@ import { Avatar, utils } from '@roleypoly/design-system/atoms/avatar';
import { Button } from '@roleypoly/design-system/atoms/button'; import { Button } from '@roleypoly/design-system/atoms/button';
import { DotOverlay } from '@roleypoly/design-system/atoms/dot-overlay'; import { DotOverlay } from '@roleypoly/design-system/atoms/dot-overlay';
import { Hero } from '@roleypoly/design-system/atoms/hero'; import { Hero } from '@roleypoly/design-system/atoms/hero';
import { AccentTitle, SmallTitle } from '@roleypoly/design-system/atoms/typography'; import {
AccentTitle,
CompletelyStylelessLink,
SmallTitle,
} from '@roleypoly/design-system/atoms/typography';
import { evaluatePermission } from '@roleypoly/misc-utils/hasPermission'; import { evaluatePermission } from '@roleypoly/misc-utils/hasPermission';
import { GuildSlug, UserGuildPermissions } from '@roleypoly/types'; import { GuildSlug, UserGuildPermissions } from '@roleypoly/types';
import * as React from 'react'; import * as React from 'react';
@ -63,11 +67,11 @@ const adminMessage = (id: string) => (
</FlexLine> </FlexLine>
<FlexLine> <FlexLine>
<div> <div>
<a href={`/machinery/bot-join?id=${id}`}> <CompletelyStylelessLink to={`/machinery/bot-join?id=${id}`}>
<Button color="discord" icon={<FaDiscord />}> <Button color="discord" icon={<FaDiscord />}>
Add Roleypoly Add Roleypoly
</Button> </Button>
</a> </CompletelyStylelessLink>
</div> </div>
</FlexLine> </FlexLine>
</> </>

View file

@ -14,11 +14,9 @@ const CardList = (props: { guilds: GuildSlug[] }) => (
<> <>
{props.guilds.map((guild, idx) => ( {props.guilds.map((guild, idx) => (
<CardContainer key={idx}> <CardContainer key={idx}>
<a href={`/s/${guild.id}`}> <CompletelyStylelessLink to={`/s/${guild.id}`}>
<CompletelyStylelessLink>
<ServerListingCard guild={guild} /> <ServerListingCard guild={guild} />
</CompletelyStylelessLink> </CompletelyStylelessLink>
</a>
</CardContainer> </CardContainer>
))} ))}
</> </>