Skip to content

Commit 39d5da0

Browse files
committed
Merge branch 'develop' into fix-dynamic-breakpoint-view
2 parents e12fd5e + a8ffd60 commit 39d5da0

55 files changed

Lines changed: 2042 additions & 256 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"axios-cache-adapter": "^2.7.3",
1414
"country-emoji": "^1.5.4",
1515
"dompurify": "^2.2.7",
16+
"firebase": "^11.2.0",
1617
"htmlparser2": "^8.0.1",
1718
"jsonpath": "^1.1.1",
1819
"normalize.css": "^8.0.1",

public/auth.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
window.addEventListener('message', (event) => {
2+
if (event.data.type === 'TOKEN_RECEIVED') {
3+
// Forward to content script
4+
window.postMessage(event.data, '*')
5+
}
6+
})

public/background.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
/*chrome.browserAction.onClicked.addListener(function (tab) {
2-
chrome.tabs.create({ url: "chrome://newtab" });
3-
}
4-
);*/
5-
61
const uninstallUrl = `https://hackertab.dev/uninstall.html`
72
if (chrome.runtime.setUninstallURL) {
83
chrome.runtime.setUninstallURL(uninstallUrl)
9-
}
4+
}

public/base.manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
2+
"manifest_version": 3,
23
"name": "Hackertab.dev - developer news",
34
"description": "All developer news in one tab",
45
"version": "1.20.1",
56
"chrome_url_overrides": {
67
"newtab": "index.html"
78
},
9+
"host_permissions": ["https://*.hackertab.dev/*"],
10+
"content_scripts": [
11+
{
12+
"matches": ["http://127.0.0.1:5173/*", "http://localhost:5173/*", "https://hackertab.dev/*"],
13+
"run_at": "document_start",
14+
"js": ["content.js"]
15+
}
16+
],
817
"icons": {
918
"16": "/logos/logo16.png",
1019
"32": "/logos/logo32.png",

public/chrome.manifest.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"manifest_version": 3,
32
"background": {
43
"service_worker": "background.js"
5-
},
6-
"host_permissions": ["https://*.hackertab.dev/*"]
4+
}
75
}

public/content.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const script = document.createElement('script')
2+
script.src = chrome.runtime.getURL('auth.js')
3+
document.documentElement.appendChild(script)
4+
5+
// Listen for messages from the injected script
6+
window.addEventListener('message', (event) => {
7+
if (event.source !== window || !event.data || event.data.type !== 'TOKEN_RECEIVED') {
8+
return
9+
}
10+
11+
chrome.runtime.sendMessage({ ...event.data })
12+
})

public/firefox.manifest.json

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
{
2-
"manifest_version": 2,
3-
"background": {
4-
"scripts": [
5-
"background.js"
6-
]
7-
},
8-
"permissions": [
9-
"https://*.hackertab.dev/*"
10-
],
11-
"content_security_policy": "script-src 'self' object-src 'self'",
12-
"applications": {
13-
"gecko": {
14-
"id": "{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"
15-
}
16-
}
17-
}
2+
"background": {
3+
"scripts": ["background.js"]
4+
}
5+
}

src/App.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { useEffect, useLayoutEffect, useState } from 'react'
22
import { DNDLayout } from 'src/components/Layout'
3-
import { setupAnalytics, setupIdentification, trackPageView } from 'src/lib/analytics'
3+
import {
4+
identifyAdvBlocked,
5+
setupAnalytics,
6+
setupIdentification,
7+
trackPageView,
8+
} from 'src/lib/analytics'
49
import { useUserPreferences } from 'src/stores/preferences'
510
import { AppContentLayout } from './components/Layout'
11+
import { verifyAdvStatus } from './features/adv/utils/status'
612
import { isWebOrExtensionVersion } from './utils/Environment'
713
import { lazyImport } from './utils/lazyImport'
814
const { OnboardingModal } = lazyImport(() => import('src/features/onboarding'), 'OnboardingModal')
@@ -30,6 +36,11 @@ export const App = () => {
3036
document.body.classList.remove('preload')
3137
setupAnalytics()
3238
setupIdentification()
39+
const adVerifier = async () => {
40+
const status = await verifyAdvStatus()
41+
identifyAdvBlocked(status)
42+
}
43+
adVerifier()
3344
}, [])
3445

3546
useEffect(() => {

src/assets/App.css

Lines changed: 174 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -122,44 +122,25 @@ a {
122122
}
123123

124124
.extras {
125-
display: none;
126-
flex-direction: row;
127-
align-content: center;
128125
order: 2;
129126
}
130127

131-
.extraBtn {
132-
background-color: var(--button-background-color);
133-
color: var(--button-text-color);
134-
margin-left: 8px;
135-
height: 40px;
136-
width: 40px;
137-
line-height: 44px;
138-
font-size: 18px;
139-
text-align: center;
140-
border: 0;
141-
border-radius: 20px;
142-
cursor: pointer;
143-
position: relative;
128+
.buttonsFlex {
144129
display: inline-flex;
145-
align-items: center;
146-
justify-content: center;
147-
}
148-
149-
.extraBtn:first-child {
150-
margin-left: 0;
130+
flex-direction: row;
131+
align-content: center;
132+
column-gap: 8px;
133+
row-gap: 8px;
151134
}
152135

153-
.extraTextBtn {
154-
padding: 0 16px;
155-
width: auto;
156-
min-width: 40px;
136+
.dndButton {
157137
font-weight: bold;
158138
}
159139

160-
.darkModeBtn {
161-
background-color: var(--dark-mode-background-color);
162-
color: var(--dark-mode-text-color);
140+
.profileImage {
141+
height: 40px;
142+
width: 40px;
143+
border-radius: 20px;
163144
}
164145

165146
.badgeCount {
@@ -1175,6 +1156,41 @@ Producthunt item
11751156
font-size: 24px;
11761157
}
11771158

1159+
/* User */
1160+
.profileImageContainer {
1161+
position: relative;
1162+
1163+
img {
1164+
width: 40px;
1165+
height: 40px;
1166+
border-radius: 50%;
1167+
border: 1px solid var(--tooltip-accent-color);
1168+
}
1169+
1170+
.streak {
1171+
position: absolute;
1172+
display: inline-block;
1173+
bottom: -12px;
1174+
left: 0;
1175+
right: 0;
1176+
color: white;
1177+
1178+
.content {
1179+
background-color: var(--tooltip-accent-color);
1180+
font-size: 10px;
1181+
border-radius: 12px;
1182+
font-weight: bold;
1183+
padding: 2px 8px;
1184+
display: inline-flex;
1185+
align-items: center;
1186+
justify-content: center;
1187+
}
1188+
.icon {
1189+
font-size: 12px;
1190+
}
1191+
}
1192+
}
1193+
11781194
/* Small devices (portrait tablets and large phones, 600px and up) */
11791195
@media only screen and (min-width: 768px) {
11801196
.floatingFilter {
@@ -1198,10 +1214,6 @@ Producthunt item
11981214
position: relative;
11991215
}
12001216

1201-
.extras {
1202-
display: block;
1203-
}
1204-
12051217
.scrollButton {
12061218
align-items: center;
12071219
display: flex;
@@ -1349,6 +1361,135 @@ Producthunt item
13491361
color: var(--primary-text-color);
13501362
border-radius: 10px;
13511363
}
1364+
1365+
.dangerToast {
1366+
background-color: #ff4d4f;
1367+
color: white;
1368+
padding: 10px 20px;
1369+
border-radius: 10px;
1370+
}
1371+
.successToast {
1372+
background-color: #52c41a;
1373+
color: white;
1374+
padding: 10px 20px;
1375+
border-radius: 10px;
1376+
}
13521377
.capitalize {
13531378
text-transform: capitalize;
13541379
}
1380+
1381+
/**
1382+
Modal
1383+
**/
1384+
1385+
.Modal {
1386+
position: absolute;
1387+
left: 50%;
1388+
top: 50%;
1389+
transform: translate(-50%, -50%);
1390+
width: 650px;
1391+
background-color: var(--card-background-color);
1392+
padding: 24px;
1393+
border-radius: 10px;
1394+
box-shadow: 0 0 20px #00000052;
1395+
z-index: 3;
1396+
max-height: 80vh;
1397+
overflow-y: auto;
1398+
}
1399+
1400+
.Overlay {
1401+
position: fixed;
1402+
top: 0;
1403+
left: 0;
1404+
right: 0;
1405+
bottom: 0;
1406+
background-color: var(--overlay-background-color);
1407+
backdrop-filter: blur(2px);
1408+
}
1409+
1410+
.modalHeader {
1411+
display: flex;
1412+
flex-direction: row;
1413+
align-items: center;
1414+
justify-content: space-between;
1415+
margin-bottom: 16px;
1416+
position: relative;
1417+
}
1418+
1419+
.modalTitle {
1420+
margin: 0;
1421+
padding: 0;
1422+
color: var(--primary-text-color);
1423+
font-size: 1.3em;
1424+
display: inline-flex;
1425+
width: 100%;
1426+
column-gap: 8px;
1427+
align-items: center;
1428+
}
1429+
.modalCloseBtn {
1430+
align-items: center;
1431+
position: absolute;
1432+
background-color: transparent;
1433+
border-radius: 50%;
1434+
top: 0;
1435+
right: 0;
1436+
border: none;
1437+
color: var(--primary-text-color);
1438+
cursor: pointer;
1439+
display: flex;
1440+
justify-content: center;
1441+
margin: 0;
1442+
padding: 0;
1443+
text-align: center;
1444+
}
1445+
.modalCloseBtn:hover {
1446+
opacity: 0.7;
1447+
}
1448+
.settingContent .form {
1449+
display: flex;
1450+
flex-direction: row;
1451+
align-items: center;
1452+
gap: 12px;
1453+
}
1454+
1455+
.settingContent input[type='text'] {
1456+
flex: 1;
1457+
background-color: var(--settings-input-background-color);
1458+
border: 1px solid var(--settings-input-border-color);
1459+
border-radius: 50px;
1460+
padding: 6px 18px;
1461+
color: var(--settings-input-text-color);
1462+
font-size: 14px;
1463+
}
1464+
1465+
.settingContent input[type='text']::placeholder {
1466+
/* Chrome, Firefox, Opera, Safari 10.1+ */
1467+
color: var(--settings-input-placeholder-color);
1468+
opacity: 1;
1469+
font-size: 14px;
1470+
}
1471+
1472+
.settingContent input[type='text']:focus {
1473+
border-color: var(--settings-input-border-focus-color);
1474+
}
1475+
@media (max-width: 768px) {
1476+
.Modal {
1477+
left: 0;
1478+
top: 0;
1479+
margin: 0;
1480+
height: 100vh;
1481+
max-height: 100vh;
1482+
transform: translate(0, 0);
1483+
border-radius: 0;
1484+
position: relative;
1485+
box-shadow: none;
1486+
width: auto;
1487+
}
1488+
.settingContent {
1489+
margin-top: 6px;
1490+
}
1491+
.settingRow {
1492+
flex-direction: column;
1493+
align-items: flex-start;
1494+
}
1495+
}

src/assets/variables.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ html.dark {
3131

3232
/** Buttons **/
3333
--button-background-color: #1c2026;
34+
--button-hover-background-color: #181c21;
3435
--button-text-color: #fff;
36+
--button-hover-text-color: #d0d0d0;
3537

3638
/**Card **/
3739
--card-background-color: #0d1116;
@@ -117,6 +119,8 @@ html.light {
117119

118120
--button-background-color: #d2deeb;
119121
--button-text-color: #3c5065;
122+
--button-hover-background-color: #b9cadc;
123+
--button-hover-text-color: #3c5065;
120124

121125
/**Card **/
122126
--card-background-color: #ffffff;

0 commit comments

Comments
 (0)