generated from IqbalLx/chrome-extension-boilerplate-react-vite
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
496 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Honest — Find the Best Deals, Honestly</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app-container"></div> | ||
<script type="module" src="./src/index.tsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "@extension/landing-page", | ||
"version": "0.1.0", | ||
"description": "chrome extension - landing page", | ||
"private": true, | ||
"sideEffects": true, | ||
"files": [ | ||
"dist/**" | ||
], | ||
"scripts": { | ||
"clean:node_modules": "pnpx rimraf node_modules", | ||
"clean:turbo": "rimraf .turbo", | ||
"clean": "pnpm clean:turbo && pnpm clean:node_modules", | ||
"build": "vite build", | ||
"dev": "cross-env __DEV__=true vite", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
"lint:fix": "pnpm lint --fix", | ||
"prettier": "prettier . --write --ignore-path ../../.prettierignore", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"dependencies": { | ||
"@extension/ui": "workspace:*", | ||
"lucide-react": "^0.469.0" | ||
}, | ||
"devDependencies": { | ||
"@extension/tailwindcss-config": "workspace:*", | ||
"@extension/tsconfig": "workspace:*", | ||
"@extension/vite-config": "workspace:*", | ||
"postcss-load-config": "^6.0.1", | ||
"cross-env": "^7.0.3", | ||
"@vitejs/plugin-react-swc": "^3.7.2" | ||
}, | ||
"postcss": { | ||
"plugins": { | ||
"tailwindcss": {}, | ||
"autoprefixer": {} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { Button } from '@extension/ui/lib/components/ui/button'; | ||
import { Card, CardContent, CardHeader, CardTitle } from '@extension/ui/lib/components/ui/card'; | ||
import { GithubIcon } from 'lucide-react'; | ||
import { useState, useEffect } from 'react'; | ||
|
||
export default function LandingPage() { | ||
const githubUrl = 'https://github.com/IqbalLx/honest'; | ||
|
||
const [browser, setBrowser] = useState('chrome'); | ||
|
||
useEffect(() => { | ||
const userAgent = navigator.userAgent.toLowerCase(); | ||
if (userAgent.includes('firefox')) { | ||
setBrowser('firefox'); | ||
} else { | ||
setBrowser('chrome'); | ||
} | ||
}, []); | ||
|
||
const storeLink = | ||
browser === 'firefox' | ||
? 'https://addons.mozilla.org/en-US/firefox/addon/honest/' | ||
: 'https://chrome.google.com/webstore/detail/honest/'; | ||
|
||
return ( | ||
<div className="min-h-screen bg-gray-100 flex flex-col items-center justify-between"> | ||
{/* Header */} | ||
<header className="w-full py-4 bg-white shadow-md"> | ||
<div className="container mx-auto px-4 flex justify-between items-center"> | ||
<h1 className="text-2xl font-bold">Honest</h1> | ||
<a href={githubUrl} target="_blank" rel="noopener noreferrer" className="text-gray-500 hover:text-black"> | ||
<GithubIcon className="w-5 h-5" /> | ||
</a> | ||
</div> | ||
</header> | ||
|
||
{/* Hero Section */} | ||
<main className="flex-1 flex items-center justify-center text-center px-4"> | ||
<div className="max-w-3xl"> | ||
<h1 className="text-4xl font-extrabold leading-tight"> | ||
Find the Best Deals, <span className="text-yellow-600">Honestly</span> | ||
</h1> | ||
<p className="mt-4 text-lg text-gray-600"> | ||
Honest is a community-driven coupon-finder extension that helps you save money without stealing your | ||
affiliate referral cookies. We believe in transparency and user-first experience. | ||
</p> | ||
<a href={storeLink} target="_blank" rel="noopener noreferrer"> | ||
<Button className="mt-6 bg-yellow-600 hover:bg-yellow-500"> | ||
{browser === 'firefox' ? 'Add to Firefox' : 'Add to Chrome'} — It's free! | ||
</Button> | ||
</a> | ||
</div> | ||
</main> | ||
|
||
{/* Features Section */} | ||
<section className="bg-white py-12 w-full"> | ||
<div className="container mx-auto px-4 grid grid-cols-1 md:grid-cols-3 gap-8"> | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>Community-Driven</CardTitle> | ||
</CardHeader> | ||
<CardContent>Anyone can upload and vote for coupons. Honest is powered by its users.</CardContent> | ||
</Card> | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>No Affiliate Stealing</CardTitle> | ||
</CardHeader> | ||
<CardContent>Your privacy is respected. We don’t steal or overwrite your affiliate cookies.</CardContent> | ||
</Card> | ||
<Card> | ||
<CardHeader> | ||
<CardTitle>Open Source</CardTitle> | ||
</CardHeader> | ||
<CardContent>Honest is open-source. Check out our code and contribute on GitHub.</CardContent> | ||
</Card> | ||
</div> | ||
</section> | ||
|
||
{/* Footer */} | ||
<footer className="w-full py-4 bg-gray-900 text-white text-center"> | ||
<p> | ||
Made with ❤️ by the Honest team. Check out our code on | ||
<a | ||
href={githubUrl} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="text-yellow-500 hover:underline ml-1"> | ||
GitHub | ||
</a> | ||
. | ||
</p> | ||
</footer> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', | ||
'Droid Sans', 'Helvetica Neue', sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createRoot } from 'react-dom/client'; | ||
import '@src/index.css'; | ||
import '@extension/ui/dist/global.css'; | ||
import LandingPage from '@src/LandingPage'; | ||
|
||
function init() { | ||
const appContainer = document.querySelector('#app-container'); | ||
if (!appContainer) { | ||
throw new Error('Can not find #app-container'); | ||
} | ||
const root = createRoot(appContainer); | ||
root.render(<LandingPage />); | ||
} | ||
|
||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import baseConfig from '@extension/tailwindcss-config'; | ||
import { withUI } from '@extension/ui'; | ||
|
||
export default withUI({ | ||
...baseConfig, | ||
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "@extension/tsconfig/base", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@src/*": ["src/*"] | ||
}, | ||
"types": ["chrome", "../../vite-env.d.ts"] | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { resolve } from 'node:path'; | ||
import { withPageConfig } from '@extension/vite-config'; | ||
import react from '@vitejs/plugin-react-swc'; | ||
|
||
const rootDir = resolve(__dirname); | ||
const srcDir = resolve(rootDir, 'src'); | ||
|
||
export default withPageConfig({ | ||
resolve: { | ||
alias: { | ||
'@src': srcDir, | ||
}, | ||
}, | ||
publicDir: resolve(rootDir, 'public'), | ||
build: { | ||
outDir: resolve(rootDir, 'dist'), | ||
}, | ||
envDir: "../.env" | ||
}, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
packages: | ||
- "backend" | ||
- "chrome-extension" | ||
- "landing-page" | ||
- "pages/*" | ||
- "packages/*" | ||
- "tests/*" |