fix(design-system): fix some button styling issues leaking link styles in (#176)

This commit is contained in:
41666 2021-03-14 14:49:29 -04:00 committed by GitHub
parent f24d2fcc99
commit 410e27c2b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View file

@ -107,7 +107,7 @@ export const Link = styled.a`
} }
`; `;
export const CompletelyStylelessLink = styled(RouterLink)` export const CompletelyStylelessA = styled.a`
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
:visited, :visited,
@ -116,3 +116,5 @@ export const CompletelyStylelessLink = styled(RouterLink)`
color: inherit; color: inherit;
} }
`; `;
export const CompletelyStylelessLink = CompletelyStylelessA.withComponent(RouterLink);

View file

@ -4,7 +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'; import { CompletelyStylelessA } from '../../atoms/typography';
export type PreauthProps = { export type PreauthProps = {
guildSlug?: GuildSlug; guildSlug?: GuildSlug;
@ -33,7 +33,7 @@ export const Preauth = (props: PreauthProps) => {
<Centered> <Centered>
{props.guildSlug && <PreauthGreeting guildSlug={props.guildSlug} />} {props.guildSlug && <PreauthGreeting guildSlug={props.guildSlug} />}
<WidthContainer> <WidthContainer>
<CompletelyStylelessLink to={props.discordOAuthLink || '#'}> <CompletelyStylelessA href={props.discordOAuthLink || '#'}>
<Button <Button
color="discord" color="discord"
icon={ icon={
@ -44,7 +44,7 @@ export const Preauth = (props: PreauthProps) => {
> >
Sign in with Discord Sign in with Discord
</Button> </Button>
</CompletelyStylelessLink> </CompletelyStylelessA>
</WidthContainer> </WidthContainer>
</Centered> </Centered>
); );

View file

@ -1,3 +1,4 @@
import { navigate } from '@reach/router';
import { Avatar, utils } from '@roleypoly/design-system/atoms/avatar'; 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';
@ -61,7 +62,7 @@ const adminMessage = (id: string) => (
</FlexLine> </FlexLine>
<FlexLine> <FlexLine>
<div> <div>
<CompletelyStylelessLink to={`/machinery/bot-join?id=${id}`}> <CompletelyStylelessLink to={`/machinery/bot-join/${id}`}>
<Button color="discord" icon={<FaDiscord />}> <Button color="discord" icon={<FaDiscord />}>
Add Roleypoly Add Roleypoly
</Button> </Button>
@ -78,7 +79,7 @@ const managerMessage = (id: string) => (
</FlexLine> </FlexLine>
<FlexLine> <FlexLine>
<div> <div>
<a href={`/machinery/bot-join?id=${id}`}> <a href={`/machinery/bot-join/${id}`}>
<Button color="discord" icon={<FaDiscord />}> <Button color="discord" icon={<FaDiscord />}>
Add Roleypoly Add Roleypoly
</Button> </Button>
@ -99,7 +100,7 @@ const userMessage = (name: string) => {
<FlexLine> <FlexLine>
<Button <Button
onClick={() => { onClick={() => {
// void router.push('/'); navigate(-1);
}} }}
color="muted" color="muted"
size="small" size="small"