Link modal redesign (#82)

* Redesign link modal

* Add cursor pointer
This commit is contained in:
Maria Rushkova 2021-10-18 22:41:23 +02:00 committed by GitHub
parent c929c26172
commit 5609c9540d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 28 deletions

View File

@ -1,6 +1,8 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import styled from "styled-components"; import styled from "styled-components";
import { buttonStyles } from "./buttonStyle";
const userAgent = window.navigator.userAgent; const userAgent = window.navigator.userAgent;
const platform = window.navigator.platform; const platform = window.navigator.platform;
const macosPlatforms = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"]; const macosPlatforms = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"];
@ -59,11 +61,6 @@ export const DownloadButton = ({ className }: DownloadButtonProps) => {
const Link = styled.a` const Link = styled.a`
margin-top: 24px; margin-top: 24px;
padding: 11px 32px; padding: 11px 32px;
font-weight: 500;
font-size: 15px; ${buttonStyles}
line-height: 22px;
text-align: center;
color: ${({ theme }) => theme.tertiary};
background: ${({ theme }) => theme.buttonBg};
border-radius: 8px;
`; `;

View File

@ -0,0 +1,11 @@
import { css } from "styled-components";
export const buttonStyles = css`
border-radius: 8px;
font-weight: 500;
font-size: 15px;
line-height: 22px;
text-align: center;
color: ${({ theme }) => theme.tertiary};
background: ${({ theme }) => theme.buttonBg};
`;

View File

@ -169,5 +169,6 @@ const ContentWrapper = styled.div`
const Link = styled.div` const Link = styled.div`
text-decoration: underline; text-decoration: underline;
cursor: pointer;
color: ${({ theme }) => theme.memberNameColor}; color: ${({ theme }) => theme.memberNameColor};
`; `;

View File

@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import styled from "styled-components"; import styled from "styled-components";
import { buttonStyles } from "../Buttons/buttonStyle";
import { textMediumStyles } from "../Text"; import { textMediumStyles } from "../Text";
import { BasicModalProps, Modal } from "./Modal"; import { BasicModalProps, Modal } from "./Modal";
@ -13,7 +14,10 @@ export const LinkModal = ({ isVisible, onClose, link }: LinkModalProps) => {
return ( return (
<Modal isVisible={isVisible} onClose={onClose}> <Modal isVisible={isVisible} onClose={onClose}>
<Section> <Section>
<Text>Are you sure you want to visit {link}</Text> <Question>Are you sure you want to visit this website?</Question>
</Section>
<Section>
<Link>{link}</Link>
</Section> </Section>
<ButtonSection> <ButtonSection>
<ButtonNo onClick={onClose}>No</ButtonNo> <ButtonNo onClick={onClose}>No</ButtonNo>
@ -23,45 +27,52 @@ export const LinkModal = ({ isVisible, onClose, link }: LinkModalProps) => {
onClose(); onClose();
}} }}
> >
Yes Yes, take me there
</ButtonYes> </ButtonYes>
</ButtonSection> </ButtonSection>
</Modal> </Modal>
); );
}; };
const ButtonSection = styled.div`
display: flex;
`;
const Section = styled.div` const Section = styled.div`
padding: 20px 16px; padding: 16px;
& + & { & + & {
border-top: 1px solid ${({ theme }) => theme.border}; border-top: 1px solid ${({ theme }) => theme.border};
} }
`; `;
const Text = styled.p` const Question = styled.p`
color: ${({ theme }) => theme.primary};
font-weight: bold;
font-size: 17px;
line-height: 24px;
`;
const Link = styled.a`
text-decoration: none;
word-break: break-all;
color: ${({ theme }) => theme.primary}; color: ${({ theme }) => theme.primary};
${textMediumStyles} ${textMediumStyles}
`; `;
const ButtonYes = styled.button` const ButtonSection = styled(Section)`
background-color: ${({ theme }) => theme.tertiary}; display: flex;
padding: 10px; justify-content: flex-end;
width: 50px;
height: 40px;
border-radius: 10px;
margin: 10px;
`; `;
const ButtonNo = styled.button` const ButtonNo = styled.button`
background-color: ${({ theme }) => theme.secondary}; padding: 11px 24px;
padding: 10px; margin-right: 16px;
width: 50px;
height: 40px; ${buttonStyles}
border-radius: 10px; background: rgba(255, 45, 85, 0.1);
margin: 10px; color: #ff2d55;
`;
const ButtonYes = styled.button`
padding: 11px 24px;
${buttonStyles}
`; `;