Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesigned Popup UI #81

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Popup/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Header: React.FC<HeaderProperties> = ({ userConfig, pageReloadFlag, setPag
<>
<header id="header">
<div className="logo__holder">
<img src="assets/logo.png" alt="logo" style={{ width: '22px', height: '22px' }} />
<img src="assets/logo.png" alt="logo" />
</div>
<div className="action__buttons--holder">
<button
Expand All @@ -97,6 +97,7 @@ const Header: React.FC<HeaderProperties> = ({ userConfig, pageReloadFlag, setPag
>
{/* eslint-disable no-nested-ternary */}
<Icon
className="refresh__icon"
name={
loading
? 'spinner'
Expand Down
15 changes: 9 additions & 6 deletions src/Popup/PopupBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ const PopupBody: React.FC<PopupBodyProperties> = ({ requestProcessed: { message,

return (
<>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<div className="popup__body">
{!error && (
<div>
<button
className="icon__button"
type="button"
onClick={(): void => {
return setQRView(!QRView);
}}
>
<Icon name="qrcode" />
<Icon className="qr__icon" name="qrcode" />
</button>

<CopyToClipboard
Expand All @@ -45,11 +46,13 @@ const PopupBody: React.FC<PopupBodyProperties> = ({ requestProcessed: { message,
}}
>
{!copied ? (
<button type="button">
<Icon name="copy" />
<button className="icon__button" type="button">
<Icon className="copy__icon" name="copy" />
</button>
) : (
<Icon name="tick" />
<button type="button">
<Icon name="tick" />
</button>
)}
</CopyToClipboard>
</div>
Expand All @@ -59,7 +62,7 @@ const PopupBody: React.FC<PopupBodyProperties> = ({ requestProcessed: { message,
</div>

{!error && QRView && (
<div>
<div className="qr__holder">
<QRCode size={128} value={message} />
</div>
)}
Expand Down
17 changes: 7 additions & 10 deletions src/Popup/PopupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,18 @@ const InnerForm: React.FC<PopupFormProperties & FormikProps<PopupFormValuesPrope
return (
<>
{!isSubmitting ? (
<Form onSubmit={handleSubmit} autoComplete="off" id="popup__form">
<Form onSubmit={handleSubmit} autoComplete="off" className="popup__form">
<div>
<Field
name="domain"
type="text"
component={SelectField}
label="Domain"
options={domainOptions}
/>
<h4>Domain:</h4>
<Field name="domain" type="text" component={SelectField} options={domainOptions} />
</div>
<div>
<Field name="customurl" type="text" component={TextField} label="Custom URL" />
<h4>kutt.it/</h4>
<Field name="customurl" type="text" component={TextField} />
</div>
<div>
<Field name="password" type="password" component={TextField} label="Password" />
<h4>Password:</h4>
<Field name="password" type="password" component={TextField} />
</div>

<button type="submit" disabled={isSubmitting}>
Expand Down
72 changes: 54 additions & 18 deletions src/Popup/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,67 @@ body {
min-height: 300px;
min-width: 250px;
font-size: 1.125em;
text-align: center;

#popup__form {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.popup__form {
padding: 15px 15px;
h4 {
padding: 10px 0px 5px 0px;
font-size: 0.9em;
font-weight: 500;
color: #294756;
}

div {
padding: 5px 10px;
button {
background: linear-gradient(to right, rgb(126, 87, 194), rgb(98, 0, 234));
margin-top: 15px;
margin-bottom: 5px;
width: 100%;
border-radius: 5px;
padding: 10px;
color: #fff;
cursor: pointer;
}

.error {
font-size: 11px;
padding: 2px 10px;
}
.error {
font-size: 11px;
padding: 2px 10px;
}
}

button {
padding: 7px 22px;
margin: 15px auto;
.popup__body {
display: flex;
justify-content: center;
padding: 15px 15px 0px 15px;
p {
padding-top: 5px;
text-decoration: underline;
font-size: 1.2em;
}
.icon__button {
cursor: pointer;
background-color: lightblue;
.copy__icon {
display: block;
padding-right: 5px;
cursor: pointer;
}
.qr__icon {
display: block;
padding-right: 5px;
padding-top: 5px;
cursor: pointer;
}
}
}

.qr__holder {
display: flex;
justify-content: center;
padding-top: 10px;
}
}

#header {
padding: 5px;
padding: 15px;
display: flex;
justify-content: space-between;
align-items: center;
Expand All @@ -60,5 +92,9 @@ body {
background-color: transparent !important;
cursor: pointer;
}
.refresh__icon {
cursor: pointer;
padding-right: 5px;
}
}
}
}
15 changes: 10 additions & 5 deletions src/components/Icon/Copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ import React from 'react';
const Copy: React.FC = () => {
return (
<svg
viewBox="-3 -2 24 24"
width={24}
height={24}
viewBox="-2 -2 30 30"
width={20}
height={20}
fill="none"
strokeWidth="2"
stroke="#b9b9b9"
strokeLinecap="round"
strokeLinejoin="round"
preserveAspectRatio="xMinYMin"
className="files_svg__jam files_svg__jam-files"
>
<path d="M6 15H2a2 2 0 01-2-2V2a2 2 0 012-2h8a2 2 0 012 2v3h3l3 3v10a2 2 0 01-2 2H8a2 2 0 01-2-2v-3zm0-2V7a2 2 0 012-2h2V2H2v11h4zm8.172-6H8v11h8V8.828L14.172 7z" />
<rect width="13" height="13" x="9" y="9" rx="2" ry="2" />
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
</svg>
);
};
Expand Down
7 changes: 4 additions & 3 deletions src/components/Icon/QRCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import React from 'react';
const QRCode: React.FC = () => {
return (
<svg
viewBox="-2 -2 24 24"
width={24}
height={24}
viewBox="-2 -2 30 30"
width={20}
height={20}
fill="#b9b9b9"
preserveAspectRatio="xMinYMin"
className="qr-code_svg__jam qr-code_svg__jam-qr-code"
>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Icon/Refresh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import React from 'react';
const Refresh: React.FC = () => {
return (
<svg
viewBox="-1.5 -2.5 24 24"
viewBox="-2 -2 24 24"
width={24}
height={24}
fill="#b8b8b8"
preserveAspectRatio="xMinYMin"
className="refresh_svg__jam refresh_svg__jam-refresh"
>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Icon/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const Settings: React.FC = () => {
return (
<svg
viewBox="-2 -2 24 24"
width="32"
height="32"
width={24}
height={24}
fill="#b8b8b8"
preserveAspectRatio="xMinYMin"
className="cog_svg__jam cog_svg__jam-cog"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Spinner: React.FC = () => {
width="24"
height="24"
fill="none"
stroke="currentColor"
stroke="#b8b8b8"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
Expand Down
1 change: 1 addition & 0 deletions src/components/Icon/Tick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Check: React.FC = () => {
viewBox="-5 -7 24 24"
width={24}
height={24}
fill="#b8b8b8"
preserveAspectRatio="xMinYMin"
className="check_svg__jam check_svg__jam-check"
>
Expand Down
13 changes: 5 additions & 8 deletions src/components/Input/styles.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
input {
height: 35px;
width: 100%;
display: flex;
position: relative;
margin: 0px;
border-radius: 100px;
border: 5px solid rgb(245, 245, 245);
border-radius: 5px;
padding: 0px 10px !important;
background-color: #EBEBEB;
}

select {
height: 35px;
padding: 10px 15px;
padding: 0px 10px;
width: 100%;
display: flex;
position: relative;
margin: 0px;
border-radius: 100px;
border-radius: 5px;
background-color: rgb(245, 245, 245);

option {
Expand Down