Skip to content

Commit

Permalink
preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
anirbanpaulcom committed Jul 19, 2024
1 parent 3aebeb6 commit 82e8e32
Show file tree
Hide file tree
Showing 57 changed files with 775 additions and 412 deletions.
2 changes: 1 addition & 1 deletion apps/extension/content/ContentApp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import DubLogo from "../public/icons/logo";
import Extension from "../src/extension";
import Extension from "../src";

export default function ContentApp() {
const [isOpen, setIsOpen] = React.useState(false);
Expand Down
3 changes: 1 addition & 2 deletions apps/extension/content/base.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;
9 changes: 8 additions & 1 deletion apps/extension/content/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
position: fixed;
bottom: 0;
right: 0;
z-index: 99999;
z-index: 99999 !important;
color: black;
}
button{

}
p {
margin:0;
}

@keyframes blink { 50% { fill: transparent }}
Expand Down
7 changes: 6 additions & 1 deletion apps/extension/content/content.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import ReactDOM from "react-dom/client";
import ContentApp from "./ContentApp";
import("./base.css");
Expand All @@ -10,5 +11,9 @@ function initial() {
rootDiv.id = "extension-root";
document.body.appendChild(rootDiv);
const root = ReactDOM.createRoot(rootDiv);
root.render(<ContentApp />);
root.render(
<React.StrictMode>
<ContentApp />
</React.StrictMode>,
);
}
1 change: 1 addition & 0 deletions apps/extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"background": {
"service_worker": "./background.ts"
},
"action": { "default_popup": "popup.html" },
"content_scripts": [
{
"matches": [
Expand Down
14 changes: 14 additions & 0 deletions apps/extension/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./content/base.css">
<link rel="stylesheet" href="./content/content.css">
</head>
<body>
<div id="root" style="margin:0;"></div>
<script type="module" src="popup.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions apps/extension/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import Extension from './src/index.tsx';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<Extension />
);
8 changes: 6 additions & 2 deletions apps/extension/public/IconMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ interface IconMenuProps {
text?: string;
icon: JSX.Element;
style?: CSSProperties;
className?: string;
}

function IconMenu(props: IconMenuProps) {
const { text, icon, style } = props;
const { text, icon, style, className } = props;
return (
<div className={`flex items-center ${text ? "gap-1.5" : ""}`} style={style}>
<div
className={`flex items-center ${text ? "gap-1.5" : ""} ${className}`}
style={style}
>
{icon}
{text && <span className="text-xs">{text}</span>}
</div>
Expand Down
88 changes: 88 additions & 0 deletions apps/extension/public/icons/clickIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
export default function ClickIcon(className: { className?: string }) {
return (
<svg
height="18"
width="18"
viewBox="0 0 18 18"
xmlns="http://www.w3.org/2000/svg"
className={`h-4 w-4 text-gray-700 ${className}`}
>
<g fill="currentColor">
<path
d="M8.095,7.778l7.314,2.51c.222,.076,.226,.388,.007,.47l-3.279,1.233c-.067,.025-.121,.079-.146,.146l-1.233,3.279c-.083,.219-.394,.215-.47-.007l-2.51-7.314c-.068-.197,.121-.385,.318-.318Z"
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
></path>
<line
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
x1="12.031"
x2="16.243"
y1="12.031"
y2="16.243"
></line>
<line
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
x1="7.75"
x2="7.75"
y1="1.75"
y2="3.75"
></line>
<line
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
x1="11.993"
x2="10.578"
y1="3.507"
y2="4.922"
></line>
<line
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
x1="3.507"
x2="4.922"
y1="11.993"
y2="10.578"
></line>
<line
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
x1="1.75"
x2="3.75"
y1="7.75"
y2="7.75"
></line>
<line
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
x1="3.507"
x2="4.922"
y1="3.507"
y2="4.922"
></line>
</g>
</svg>
);
}
33 changes: 33 additions & 0 deletions apps/extension/public/icons/emailIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export default function EmailIcon({ className }: { className?: string }) {
return (
<svg
className={className}
xmlns="http://www.w3.org/2000/svg"
fill="none"
height="92"
viewBox="0 0 92 92"
width="92"
>
<path
d="m21.6354 66h8.4828v-20.6008l-12.1182-9.0887v26.0541c0 2.0116 1.6299 3.6354 3.6354 3.6354z"
fill="#4285f4"
/>
<path
d="m59.2031 66h8.4827c2.0117 0 3.6355-1.6298 3.6355-3.6354v-26.0541l-12.1182 9.0887"
fill="#34a853"
/>
<path
d="m59.2031 29.6458v15.7536l12.1182-9.0886v-4.8473c0-4.4959-5.1321-7.0588-8.7251-4.3626"
fill="#fbbc04"
/>
<path
d="m30.1172 45.3991v-15.7536l14.5418 10.9064 14.5418-10.9064v15.7536l-14.5418 10.9064"
fill="#ea4335"
/>
<path
d="m18 31.4635v4.8473l12.1182 9.0886v-15.7536l-3.3931-2.5449c-3.5991-2.6962-8.7251-.1333-8.7251 4.3626z"
fill="#c5221f"
/>
</svg>
);
}
21 changes: 21 additions & 0 deletions apps/extension/public/icons/facebookIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default function FacebookIcon({ className }: { className?: string }) {
return (
<svg
className={className}
xmlns="http://www.w3.org/2000/svg"
fill="none"
height="24"
viewBox="0 0 24 24"
width="24"
>
<path
d="m23 12c0-6.07578-4.9242-11-11-11-6.07578 0-11 4.92422-11 11 0 5.4914 4.02187 10.0418 9.2812 10.8668v-7.6871h-2.79292v-3.1797h2.79292v-2.42344c0-2.75644 1.6415-4.27968 4.1551-4.27968 1.2032 0 2.4621.21484 2.4621.21484v2.70703h-1.3879c-1.3664 0-1.7917.84863-1.7917 1.71875v2.0625h3.0507l-.4877 3.1797h-2.563v7.6871c5.2593-.825 9.2812-5.3754 9.2812-10.8668z"
fill="#1877f2"
/>
<path
d="m16.2818 15.1797.4877-3.1797h-3.0507v-2.0625c0-.87012.4253-1.71875 1.7917-1.71875h1.3879v-2.70703s-1.2589-.21484-2.4621-.21484c-2.5136 0-4.1551 1.52324-4.1551 4.27968v2.42344h-2.79292v3.1797h2.79292v7.6871c.5608.0881 1.1344.1332 1.7188.1332s1.158-.0451 1.7188-.1332v-7.6871z"
fill="#fff"
/>
</svg>
);
}
19 changes: 19 additions & 0 deletions apps/extension/public/icons/instagramIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default function InstagramIcon({ className }: { className?: string }) {
return (
<svg
className={className}
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
viewBox="0 0 16 16"
>
<radialGradient id="a" cx="13.286131%" cy="100.4724%" r="130.546822%">
<stop offset=".09" stop-color="#fa8f21" />
<stop offset=".78" stop-color="#d82d7e" />
</radialGradient>
<path
d="m5.33397336 8c0-1.472704 1.19358374-2.66688 2.66634665-2.66688s2.66698669 1.194176 2.66698669 2.66688-1.19422378 2.66688-2.66698669 2.66688-2.66634665-1.194176-2.66634665-2.66688m-1.44172167 0c0 2.2688 1.83917757 4.107904 4.10806832 4.107904 2.26889079 0 4.10806829-1.839104 4.10806829-4.107904s-1.8391775-4.107904-4.10806829-4.107904c-2.26889075 0-4.10806832 1.839104-4.10806832 4.107904m7.41872871-4.270784c-.000212.5301933.4294399.96017178.9596544.96038385.5302145.00021206.9602102-.4294226.9604223-.9596159s-.4294397-.96017183-.9596542-.96038395h-.0003841c-.5299623.00024699-.9595793.42967504-.9600384.959616m-6.54278967 10.782592c-.7799992-.03552-1.20395216-.16544-1.48569143-.2752-.37351894-.145408-.6400256-.318592-.92022881-.5984s-.45365015-.546048-.59842394-.919552c-.10982839-.2816-.23975359-.705664-.275211-1.485632-.03878556-.843264-.04652987-1.096576-.04652987-3.23296s.00838434-2.388992.04652987-3.23296c.03552142-.779968.16640665-1.2032.275211-1.485632.14541382-.373504.31860475-.64.59842394-.920192s.54606984-.453632.92022881-.5984c.28161126-.109824.70569223-.239744 1.48569143-.2752.84329773-.038784 1.09661986-.046528 3.23212928-.046528 2.13550939 0 2.38908759.008384 3.23308929.046528.7799992.03552 1.2032482.1664 1.4856915.2752.3735189.144768.6400256.318592.9202288.5984s.4530101.546688.5984239.920192c.1098284.2816.2397536.705664.275211 1.485632.0387856.843968.0465299 1.096576.0465299 3.23296s-.0077443 2.388992-.0465299 3.23296c-.0355214.779968-.1660866 1.203904-.275211 1.485632-.1454138.373504-.3186047.64-.5984239.919552s-.5467099.452992-.9202288.5984c-.2816113.109824-.7056923.239744-1.4856915.2752-.8432977.038784-1.0966198.046528-3.23308929.046528-2.13646946 0-2.38908756-.007744-3.23212928-.046528m-.06624265-14.46336c-.85168207.038784-1.43365735.173824-1.94190168.371584-.52635705.204224-.97194288.478208-1.41720869.922752s-.71855674.890816-.92278891 1.417152c-.19776791.508544-.33281331 1.090176-.37159886 1.941824-.03942558.852992-.04844994 1.125696-.04844994 3.29824s.00902436 2.445248.04844994 3.29824c.03878555.851712.17383095 1.43328.37159886 1.941824.20423217.526016.47758711.9728.92278891 1.417152.44520181.444352.89085164.717952 1.41720869.922752.50920437.19776 1.09021961.3328 1.94190168.371584.85347414.038784 1.12574103.048448 3.29837193.048448 2.17263089 0 2.44534579-.009024 3.29837189-.048448.8517461-.038784 1.4333374-.173824 1.9419017-.371584.5260371-.2048.9719429-.478208 1.4172087-.922752s.7179807-.891136.9227889-1.417152c.1977679-.508544.3334534-1.090176.3715989-1.941824.0387855-.853632.0478099-1.125696.0478099-3.29824s-.0090244-2.445248-.0478099-3.29824c-.0387856-.851712-.173831-1.4336-.3715989-1.941824-.2048082-.526016-.4782271-.971904-.9227889-1.417152s-.8911716-.718528-1.4165687-.922752c-.5092043-.19776-1.0908596-.33344-1.9419016-.371584-.8530261-.038784-1.1257411-.048448-3.29837196-.048448-2.17263091 0-2.44553782.009024-3.29901196.048448"
fill="url(#a)"
/>
</svg>
);
}
7 changes: 4 additions & 3 deletions apps/extension/public/icons/linkTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
const LinkTemplate = () => {
return (
<div className="mb-3 mt-5 flex items-center rounded-md border border-gray-200 bg-white p-3 opacity-100 shadow-lg">
<div className="mb-4 flex w-[400px] items-center rounded-md border border-gray-200 bg-white p-3 opacity-100 shadow-lg">
<div className="mr-2 h-10 w-10 rounded-full bg-gray-200"></div>
<div>
<div className="mb-2.5 flex items-center space-x-2">
<div className="h-6 w-28 rounded-md bg-gray-200"></div>
<div className="h-6 w-6 rounded-full bg-gray-200"></div>
<div className="h-6 w-20 rounded-md bg-gray-200"></div>
<div className="h-6 w-28 rounded-md bg-gray-200"></div>
</div>
<div className="h-4 w-60 rounded-md bg-gray-200 sm:w-80"></div>
<div className="h-4 w-70 rounded-md bg-gray-200"></div>
</div>
<div className="ml-4 h-10 w-9 rounded-md bg-gray-200"></div>
</div>
);
};
Expand Down
16 changes: 16 additions & 0 deletions apps/extension/public/icons/linkedinIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default function LinkedinIcon({ className }: { className?: string }) {
return (
<svg
className={className}
xmlns="http://www.w3.org/2000/svg"
enable-background="new 0 0 112.196 112.196"
viewBox="0 0 112.196 112.196"
>
<circle cx="56.098" cy="56.097" fill="#007ab9" r="56.098" />
<path
d="m89.616 60.611v23.128h-13.409v-21.578c0-5.418-1.936-9.118-6.791-9.118-3.705 0-5.906 2.491-6.878 4.903-.353.862-.444 2.059-.444 3.268v22.524h-13.41s.18-36.546 0-40.329h13.411v5.715c-.027.045-.065.089-.089.132h.089v-.132c1.782-2.742 4.96-6.662 12.085-6.662 8.822 0 15.436 5.764 15.436 18.149zm-54.96-36.642c-4.587 0-7.588 3.011-7.588 6.967 0 3.872 2.914 6.97 7.412 6.97h.087c4.677 0 7.585-3.098 7.585-6.97-.089-3.956-2.908-6.967-7.496-6.967zm-6.791 59.77h13.405v-40.33h-13.405z"
fill="#f1f2f2"
/>
</svg>
);
}
25 changes: 25 additions & 0 deletions apps/extension/public/icons/loading-circle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { cn } from "@dub/utils";

export default function LoadingCircle({ className }: { className?: string }) {
return (
<svg
aria-hidden="true"
className={cn(
"h-4 w-4 animate-spin fill-gray-600 text-gray-200",
className,
)}
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
/>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
/>
</svg>
);
}
44 changes: 21 additions & 23 deletions apps/extension/public/icons/pinterestIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
const PinterestIcon = () => {
export default function PinterestIcon({ className }: { className?: string }) {
return (
<svg
height="28px"
width="28px"
version="1.1"
id="Layer_1"
className={className}
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
viewBox="0 0 511.998 511.998"
xmlSpace="preserve"
height="60"
viewBox="0 0 60 60"
width="60"
>
<path
style={{ fill: "#ffffff" }}
d="M405.017,52.467C369.774,18.634,321.001,0,267.684,0C186.24,0,136.148,33.385,108.468,61.39
c-34.114,34.513-53.675,80.34-53.675,125.732c0,56.993,23.839,100.737,63.76,117.011c2.68,1.098,5.377,1.651,8.021,1.651
c8.422,0,15.095-5.511,17.407-14.35c1.348-5.071,4.47-17.582,5.828-23.013c2.906-10.725,0.558-15.884-5.78-23.353
c-11.546-13.662-16.923-29.817-16.923-50.842c0-62.451,46.502-128.823,132.689-128.823c68.386,0,110.866,38.868,110.866,101.434
c0,39.482-8.504,76.046-23.951,102.961c-10.734,18.702-29.609,40.995-58.585,40.995c-12.53,0-23.786-5.147-30.888-14.121
c-6.709-8.483-8.921-19.441-6.222-30.862c3.048-12.904,7.205-26.364,11.228-39.376c7.337-23.766,14.273-46.213,14.273-64.122
c0-30.632-18.832-51.215-46.857-51.215c-35.616,0-63.519,36.174-63.519,82.354c0,22.648,6.019,39.588,8.744,46.092
c-4.487,19.01-31.153,132.03-36.211,153.342c-2.925,12.441-20.543,110.705,8.618,118.54c32.764,8.803,62.051-86.899,65.032-97.713
c2.416-8.795,10.869-42.052,16.049-62.495c15.817,15.235,41.284,25.535,66.064,25.535c46.715,0,88.727-21.022,118.298-59.189
c28.679-37.02,44.474-88.618,44.474-145.282C457.206,127.983,438.182,84.311,405.017,52.467z"
/>
<g fill="none" fill-rule="evenodd">
<path
d="m.88383368 30c0-16.5685433 13.01696742-30 29.07421222-30s29.0742122 13.4314567 29.0742122 30-13.0169674 30-29.0742122 30-29.07421222-13.4314567-29.07421222-30zm0 0"
fill="#cb2027"
/>
<path
d="m17.5869165 25.6564894c0 3.3025724 1.2117686 6.2406804 3.8107776 7.3355665.4261755.1797797.8079146.0061846.9315096-.4806921.0859792-.3369537.2893529-1.1870153.3800857-1.5410299.1246285-.4815451.0762652-.6504485-.2676514-1.0701477-.749424-.9121208-1.228303-2.0929514-1.228303-3.7655638 0-4.8525593 3.5185312-9.1967024 9.1621527-9.1967024 4.9973311 0 7.7428767 3.15073 7.7428767 7.3585988 0 5.5364899-2.3745538 10.2092694-5.8996988 10.2092694-1.9467249 0-3.4040301-1.6613095-2.9369319-3.6988128.5592778-2.4324642 1.6426977-5.0577171 1.6426977-6.8135016 0-1.5717396-.8176286-2.8826599-2.509723-2.8826599-1.9901278 0-3.5888026 2.1243009-3.5888026 4.9700665 0 1.8125121.5935868 3.038341.5935868 3.038341s-2.036631 8.9038939-2.3935684 10.4632642c-.7109814 3.1055185-.1068539 6.9124551-.0558038 7.2969662.0299687.2277636.3137412.2819321.4422966.1098298.1835324-.2471704 2.5537459-3.2665312 3.3595937-6.283546.2279688-.8543268 1.3089085-5.2780166 1.3089085-5.2780166.646497 1.2725333 2.5361781 2.3934374 4.545734 2.3934374 5.9821644 0 10.040752-5.6273395 10.040752-13.1597466 0-5.6955832-4.6753227-11.0000442-11.7812097-11.0000442-8.8413843 0-13.299279 6.5407397-13.299279 11.9951238zm0 0"
fill="#fff"
/>
<path
d="m59.0322581 30c0 16.5685433-13.0169674 30-29.0742122 30-5.9552518 0-11.4923157-1.8474866-16.1021256-5.0172246l33.3140887-49.16336437c7.1939642 5.46123927 11.8622491 14.25838627 11.8622491 24.18058897zm0 0"
fill="#000"
fill-opacity=".08"
/>
</g>
</svg>
);
};
export default PinterestIcon;
}
6 changes: 3 additions & 3 deletions apps/extension/public/icons/redditIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const RedditIcon = () => {
export default function RedditIcon({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -7,6 +7,7 @@ const RedditIcon = () => {
width="28px"
height="28px"
viewBox="0 0 256 256"
className={className}
>
<g transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
<circle cx="45" cy="45" r="45" fill="rgb(255,69,0)" />
Expand All @@ -18,5 +19,4 @@ const RedditIcon = () => {
</g>
</svg>
);
};
export default RedditIcon;
}
Loading

0 comments on commit 82e8e32

Please sign in to comment.